diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2014-03-11 17:39:18 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2014-03-11 19:32:18 -0500 |
commit | 0c1fcd2b50908bda607fce70c796033e33832b11 (patch) | |
tree | 05af7c047cdb39229efd344bba4aa2198ea9105c /test/set-call-forwarding | |
parent | c54e4763f8f4f6239a778994cf68f077ad2b170d (diff) | |
download | ofono-0c1fcd2b50908bda607fce70c796033e33832b11.tar.bz2 |
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.
Diffstat (limited to 'test/set-call-forwarding')
-rwxr-xr-x | test/set-call-forwarding | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/set-call-forwarding b/test/set-call-forwarding index 1c06b681..a22a6730 100755 --- a/test/set-call-forwarding +++ b/test/set-call-forwarding @@ -8,19 +8,19 @@ import dbus.mainloop.glib def property_changed(property, value): if len(value.__str__()) > 0: - print "CF property %s changed to %s" % (property, value) + print("CF property %s changed to %s" % (property, value)) else: - print "CF property %s changed to disabled" % (property) + print("CF property %s changed to disabled" % (property)) if canexit: mainloop.quit(); if __name__ == "__main__": if len(sys.argv) < 3: - print "Usage: %s <property> <value>" % (sys.argv[0]) - print "Properties can be: VoiceUnconditional, VoiceBusy," - print " VoiceNoReply, VoiceNoReplyTimeout, VoiceNotReachable" - print "Value: number to or the timeout" + print("Usage: %s <property> <value>" % (sys.argv[0])) + print("Properties can be: VoiceUnconditional, VoiceBusy,") + print(" VoiceNoReply, VoiceNoReplyTimeout, VoiceNotReachable") + print("Value: number to or the timeout") sys.exit(1) property = sys.argv[1] @@ -47,16 +47,16 @@ if __name__ == "__main__": cf.SetProperty(property, dbus.UInt16(value), timeout = 100) except dbus.DBusException, e: - print "Unable SetProperty", e + print("Unable SetProperty %s" % e) sys.exit(1); else: try: cf.SetProperty(property, value, timeout = 100) except dbus.DBusException, e: - print "Unable SetProperty", e + print("Unable SetProperty %s" % e) sys.exit(1); - print "Set Property successful" + print("Set Property successful") canexit = True |