diff mbox series

[BlueZ,1/1] test/example-gatt: fix deprecation warning

Message ID 20240531193622.1696328-2-me@prestonhunt.com (mailing list archive)
State Accepted
Commit 684a17f7cc789735f4cf46847525d70483dbb148
Headers show
Series Fix GLib deprecation warning in example-gatt-client/server | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Preston Hunt May 31, 2024, 7:36 p.m. UTC
Use GLib instead of GObject to fix deprecation warning. Remove python2
gobject import.
---
 test/example-gatt-client |  7 ++-----
 test/example-gatt-server | 11 ++++-------
 2 files changed, 6 insertions(+), 12 deletions(-)

Comments

bluez.test.bot@gmail.com May 31, 2024, 9:42 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=857808

---Test result---

Test Summary:
CheckPatch                    PASS      0.82 seconds
GitLint                       PASS      0.61 seconds
BuildEll                      PASS      24.44 seconds
BluezMake                     PASS      1728.31 seconds
MakeCheck                     PASS      14.17 seconds
MakeDistcheck                 PASS      211.65 seconds
CheckValgrind                 PASS      251.05 seconds
CheckSmatch                   PASS      361.44 seconds
bluezmakeextell               PASS      132.11 seconds
IncrementalBuild              PASS      1507.35 seconds
ScanBuild                     PASS      994.73 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/test/example-gatt-client b/test/example-gatt-client
index 5e6bef9d7..38ca97eae 100755
--- a/test/example-gatt-client
+++ b/test/example-gatt-client
@@ -2,10 +2,7 @@ 
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
 import dbus
-try:
-  from gi.repository import GObject
-except ImportError:
-  import gobject as GObject
+from gi.repository import GLib
 import sys
 
 from dbus.mainloop.glib import DBusGMainLoop
@@ -189,7 +186,7 @@  def main():
     global bus
     bus = dbus.SystemBus()
     global mainloop
-    mainloop = GObject.MainLoop()
+    mainloop = GLib.MainLoop()
 
     om = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, '/'), DBUS_OM_IFACE)
     om.connect_to_signal('InterfacesRemoved', interfaces_removed_cb)
diff --git a/test/example-gatt-server b/test/example-gatt-server
index 77231c3ad..83b700901 100755
--- a/test/example-gatt-server
+++ b/test/example-gatt-server
@@ -7,10 +7,7 @@  import dbus.mainloop.glib
 import dbus.service
 
 import array
-try:
-  from gi.repository import GObject
-except ImportError:
-  import gobject as GObject
+from gi.repository import GLib
 import sys
 
 from random import randint
@@ -305,7 +302,7 @@  class HeartRateMeasurementChrc(Characteristic):
         if not self.notifying:
             return
 
-        GObject.timeout_add(1000, self.hr_msrmt_cb)
+        GLib.timeout_add(1000, self.hr_msrmt_cb)
 
     def StartNotify(self):
         if self.notifying:
@@ -392,7 +389,7 @@  class BatteryLevelCharacteristic(Characteristic):
                 service)
         self.notifying = False
         self.battery_lvl = 100
-        GObject.timeout_add(5000, self.drain_battery)
+        GLib.timeout_add(5000, self.drain_battery)
 
     def notify_battery_level(self):
         if not self.notifying:
@@ -649,7 +646,7 @@  def main():
 
     app = Application(bus)
 
-    mainloop = GObject.MainLoop()
+    mainloop = GLib.MainLoop()
 
     print('Registering GATT application...')