From 0b4137c4b59526977d841b3d9add2bc68ad4b1e5 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 7 Apr 2015 17:31:48 +0300 Subject: [PATCH] test/test-nap: Run indefinitely This makes test-nap run indefinitely until ctrl+c is pressed. --- test/test-nap | 17 ++++++++++------- 1 file 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() -- 2.47.3