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/send-ussd | |
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/send-ussd')
-rwxr-xr-x | test/send-ussd | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/send-ussd b/test/send-ussd index fcabd21c..e5858836 100755 --- a/test/send-ussd +++ b/test/send-ussd @@ -4,7 +4,7 @@ import sys import dbus if (len(sys.argv) < 2): - print "Usage: %s [modem] <ussd-string>" % (sys.argv[0]) + print("Usage: %s [modem] <ussd-string>" % (sys.argv[0])) sys.exit(1) bus = dbus.SystemBus() @@ -27,13 +27,13 @@ ussd = dbus.Interface(bus.get_object('org.ofono', path), properties = ussd.GetProperties() state = properties["State"] -print "State: %s" % (state) +print("State: %s" % (state)) if state == "idle": result = ussd.Initiate(ussdstring, timeout=100) - print result[0] + ": " + result[1] + print(result[0] + ": " + result[1]) elif state == "user-response": - print ussd.Respond(ussdstring, timeout=100) + print(ussd.Respond(ussdstring, timeout=100)) else: sys.exit(1); @@ -43,15 +43,15 @@ state = properties["State"] if state == "idle": sys.exit(0) -print "State: %s" % (state) +print("State: %s" % (state)) while state == "user-response": response = raw_input("Enter response: ") - print ussd.Respond(response, timeout=100) + print(ussd.Respond(response, timeout=100)) properties = ussd.GetProperties() state = properties["State"] if state != "idle": - print "State: %s" % (state) + print("State: %s" % (state)) |