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/test-call-barring | |
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/test-call-barring')
-rwxr-xr-x | test/test-call-barring | 26 |
1 files changed, 13 insertions, 13 deletions
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 <property> <newvalue> <password>" % (s) - print "Usage: %s disableall <password>" % (s) - print "Usage: %s passwd <old_password> <new_password>" % (s) + print("Usage: %s <property> <newvalue> <password>" % (s)) + print("Usage: %s disableall <password>" % (s)) + print("Usage: %s passwd <old_password> <new_password>" % (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 |