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-network-registration | |
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-network-registration')
-rwxr-xr-x | test/test-network-registration | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/test-network-registration b/test/test-network-registration index cfc1a433..f692efa7 100755 --- a/test/test-network-registration +++ b/test/test-network-registration @@ -6,18 +6,18 @@ import dbus import dbus.mainloop.glib def network_property_changed(name, value): - print "Network Registration property '%s' changed to '%s'" %\ - (name, value) + print("Network Registration property '%s' changed to '%s'" %\ + (name, value)) if name == 'Name' and canexit: mainloop.quit() if __name__ == "__main__": if len(sys.argv) < 2: - print "Usage: %s [modem] <path> - Register to PLMN on <path>" %\ - (sys.argv[0]) - print "Usage: %s [modem] default - Register to default PLMN" %\ - (sys.argv[0]) + print("Usage: %s [modem] <path> - Register to PLMN on <path>" %\ + (sys.argv[0])) + print("Usage: %s [modem] default - Register to default PLMN" %\ + (sys.argv[0])) sys.exit(1) canexit = False @@ -44,15 +44,15 @@ if __name__ == "__main__": props = netreg.GetProperties() - print "Status is: '%s', Operator Name is: '%s'" %\ - (props['Status'], props['Name']) + print("Status is: '%s', Operator Name is: '%s'" %\ + (props['Status'], props['Name'])) if props.has_key('LocationAreaCode') and props.has_key('CellId'): - print "Location: '%d', Cell: '%d'" %\ - (props['LocationAreaCode'], props['CellId']) + print("Location: '%d', Cell: '%d'" %\ + (props['LocationAreaCode'], props['CellId'])) if props.has_key('Technology'): - print "Technology: '%s'" % (props['Technology']) + print("Technology: '%s'" % (props['Technology'])) try: if plmn == 'default': @@ -62,7 +62,7 @@ if __name__ == "__main__": op = dbus.Interface(obj, 'org.ofono.NetworkOperator') op.Register() except dbus.DBusException, e: - print "Unable to register: ", e + print("Unable to register: %s" % e) sys.exit(1) canexit = True |