diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-04-10 14:33:57 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-04-17 13:43:45 +0300 |
commit | 943d6daf73ce001d0f09e2fffbe3752e0ff325ac (patch) | |
tree | 35e37043d358a2c1ffd642e1fc4b3f22cb5474ae /test | |
parent | 4ee201a58891b5807fa6c6b9b3fb1ef4755dffdd (diff) | |
download | bluez-943d6daf73ce001d0f09e2fffbe3752e0ff325ac.tar.gz |
test: Fix opp-client not printing progress
This avoid KeyError expection and fixes print usage.
Diffstat (limited to 'test')
-rwxr-xr-x | test/opp-client | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/opp-client b/test/opp-client index 3078d490a..878c263c2 100755 --- a/test/opp-client +++ b/test/opp-client @@ -49,23 +49,25 @@ class OppClient: print("Transfer created: %s" % path) def error(self, err): - print err + print(err) mainloop.quit() def properties_changed(self, interface, properties, invalidated, path): if path != self.transfer_path: return - if properties['Status'] == 'complete' or \ - properties['Status'] == 'error': + if "Status" in properties and \ + (properties["Status"] == "complete" or \ + properties["Status"] == "error"): if self.verbose: - print("Transfer %s" % properties['Status']) + print("Transfer %s" % properties["Status"]) mainloop.quit() return - if properties["Transferred"] == None: + if "Transferred" not in properties: return + value = properties["Transferred"] speed = (value - self.transferred) / 1000 print("Transfer progress %d/%d at %d kBps" % (value, self.transfer_size, |