import dbus
import dbus.mainloop.glib
except:
- print "Failed import, aborting test"
+ print("Failed import, aborting test")
sys.exit(0)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
# Start it up
reply = i.Echo("hello world")
-print "TestSuiteForkingEchoService initial reply OK"
+print("TestSuiteForkingEchoService initial reply OK")
def ignore(*args, **kwargs):
pass
global o
global i
if counter > 10:
- print "Activated 10 times OK, TestSuiteForkingEchoService pass"
+ print("Activated 10 times OK, TestSuiteForkingEchoService pass")
loop.quit()
return
counter += 1
def check_counter():
if counter == 0:
- print "Failed to get NameOwnerChanged for TestSuiteForkingEchoService"
+ print("Failed to get NameOwnerChanged for TestSuiteForkingEchoService")
sys.exit(1)
GObject.timeout_add(15000, check_counter)
import dbus.mainloop.glib
from gi.repository import GObject
except:
- print "Failed import, aborting test"
+ print("Failed import, aborting test")
sys.exit(0)
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
exitcode = 0
def handle_noreceipt():
- print "Failed to get signal"
+ print("Failed to get signal")
global exitcode
exitcode = 1
loop.quit()
bus = dbus.SessionBus()
def sighandler(*args, **kwargs):
- print "got signal"
+ print("got signal")
loop.quit()
bus.add_signal_receiver(sighandler, dbus_interface='org.freedesktop.TestSuite', signal_name='Foo')