From 0c1fcd2b50908bda607fce70c796033e33832b11 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 11 Mar 2014 17:39:18 +0100 Subject: test: Make print calls compatible with Python 3 Turn print calls into print() function calls and avoid using comma-separated arguments, so that they work and look the same with both Python 2 and 3. --- test/test-call-barring | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'test/test-call-barring') diff --git a/test/test-call-barring b/test/test-call-barring index 5dd566e4..51b37780 100755 --- a/test/test-call-barring +++ b/test/test-call-barring @@ -7,14 +7,14 @@ import dbus.mainloop.glib def property_changed(name, value): - print "CallBarring property: '%s' changed to '%s'" % (name, str(value)) + print("CallBarring property: '%s' changed to '%s'" % (name, str(value))) if canexit: mainloop.quit() def print_useage(s): - print "Usage: %s " % (s) - print "Usage: %s disableall " % (s) - print "Usage: %s passwd " % (s) + print("Usage: %s " % (s)) + print("Usage: %s disableall " % (s)) + print("Usage: %s passwd " % (s)) sys.exit(1); if __name__ == "__main__": @@ -51,31 +51,31 @@ if __name__ == "__main__": properties = cb.GetProperties() - print "Barring settings for Incoming Voice calls: %s" %\ - (properties['VoiceIncoming']) - print "Barring settings for Outgoing Calls: %s" %\ - (properties['VoiceOutgoing']) + print("Barring settings for Incoming Voice calls: %s" %\ + (properties['VoiceIncoming'])) + print("Barring settings for Outgoing Calls: %s" %\ + (properties['VoiceOutgoing'])) if (sys.argv[1] == 'disableall'): - print "Disabling all barrings" + print("Disabling all barrings") try: cb.DisableAll(pin) except dbus.DBusException, e: - print "Unable to Disable All barrings: ", e + print("Unable to Disable All barrings: ", e) sys.exit(1) elif (sys.argv[1] == 'passwd'): try: cb.ChangePassword(old_password, new_password) except dbus.DBusException, e: - print "Unable to change password: ", e + print("Unable to change password: ", e) sys.exit(1) - print "Password changed" + print("Password changed") sys.exit(0) else: try: cb.SetProperty(property, newvalue, pin) except dbus.DBusException, e: - print "Unable to set property: ", e + print("Unable to set property: ", e) sys.exit(1) canexit = True -- cgit v1.2.3