summaryrefslogtreecommitdiffstats
path: root/test/test-advice-of-charge
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2014-03-11 17:39:18 +0100
committerDenis Kenzior <denkenz@gmail.com>2014-03-11 19:32:18 -0500
commit0c1fcd2b50908bda607fce70c796033e33832b11 (patch)
tree05af7c047cdb39229efd344bba4aa2198ea9105c /test/test-advice-of-charge
parentc54e4763f8f4f6239a778994cf68f077ad2b170d (diff)
downloadofono-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-advice-of-charge')
-rwxr-xr-xtest/test-advice-of-charge32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/test-advice-of-charge b/test/test-advice-of-charge
index 9f3f6556..bb52f5b0 100755
--- a/test/test-advice-of-charge
+++ b/test/test-advice-of-charge
@@ -7,16 +7,16 @@ import dbus.mainloop.glib
def cm_property_changed(name, value):
- print "CallMeter property: '%s' changed to '%s'" % (name, str(value))
+ print("CallMeter property: '%s' changed to '%s'" % (name, str(value)))
if canexit:
mainloop.quit()
def cm_maximum_reached():
- print "Only 30 seconds call time remains, recharge."
+ print("Only 30 seconds call time remains, recharge.")
def print_useage(s):
- print "Usage: %s <property> <newvalue> <password>" % (s)
- print "Usage: %s reset <password>" % (s)
+ print("Usage: %s <property> <newvalue> <password>" % (s))
+ print("Usage: %s reset <password>" % (s))
sys.exit(1);
if __name__ == "__main__":
@@ -51,24 +51,24 @@ if __name__ == "__main__":
properties = cm.GetProperties()
- print "Currency: %s" % (properties['Currency'])
- print "PricePerUnit %s" % (properties['PricePerUnit'])
- print "Call meter for the current call: %s" % (properties['CallMeter'])
- print "Call meter for current and previous calls: %s" %\
- properties['AccumulatedCallMeter']
- print "Call meter maximum, once reached calls are not possible: %s" %\
- properties['AccumulatedCallMeterMaximum']
+ print("Currency: %s" % (properties['Currency']))
+ print("PricePerUnit %s" % (properties['PricePerUnit']))
+ print("Call meter for the current call: %s" % (properties['CallMeter']))
+ print("Call meter for current and previous calls: %s" %\
+ properties['AccumulatedCallMeter'])
+ print("Call meter maximum, once reached calls are not possible: %s" %\
+ properties['AccumulatedCallMeterMaximum'])
total = properties['PricePerUnit'] * properties['AccumulatedCallMeter']
- print "Accumulated Meter in Currency: %s %s" %\
- (total, properties['Currency'])
+ print("Accumulated Meter in Currency: %s %s" %\
+ (total, properties['Currency']))
if (sys.argv[1] == 'reset'):
- print "Resetting Accumulated Call Meter"
+ print("Resetting Accumulated Call Meter")
try:
cm.Reset(pin)
except dbus.DBusException, e:
- print "Unable to reset ACM: ", e
+ print("Unable to reset ACM: %s" % e)
sys.exit(1)
else:
try:
@@ -78,7 +78,7 @@ if __name__ == "__main__":
newvalue = float(newvalue)
cm.SetProperty(property, newvalue, pin)
except dbus.DBusException, e:
- print "Unable to set property: ", e
+ print("Unable to set property: %s" % e)
sys.exit(1)
canexit = True