diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-04-07 17:31:48 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-04-07 18:04:33 +0300 |
commit | 0b4137c4b59526977d841b3d9add2bc68ad4b1e5 (patch) | |
tree | ca5e3f4638dde7c8a4361ff7daf9848f096ebc7b /test | |
parent | 8232c1a035b1b4078213143312ebecf55328e4a1 (diff) | |
download | bluez-0b4137c4b59526977d841b3d9add2bc68ad4b1e5.tar.gz |
test/test-nap: Run indefinitely
This makes test-nap run indefinitely until ctrl+c is pressed.
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-nap | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/test-nap b/test/test-nap index 00a2585af..ab67a7509 100755 --- a/test/test-nap +++ b/test/test-nap @@ -7,6 +7,11 @@ import sys import time import dbus import bluezutils +import dbus.mainloop.glib +try: + from gi.repository import GObject +except ImportError: + import gobject as GObject bus = dbus.SystemBus() @@ -29,16 +34,14 @@ if (len(args) < 1): else: bridge = args[0] +dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + +mainloop = GObject.MainLoop() + server.Register(service, bridge) print("Server for %s registered for %s" % (service, bridge)) print("Press CTRL-C to disconnect") -try: - time.sleep(1000) - print("Terminating connection") -except: - pass - -server.Unregister(service) +mainloop.run() |