diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-07-12 22:25:03 -0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-07-12 22:25:03 -0300 |
commit | 83571bf295a3c1466300f852c3be4277da8d7efa (patch) | |
tree | 25a405b8f70efa84b9ed358f5f6b3cb6d80ebabe | |
parent | 205546a2cfb0e5a2662b33288041952e351cab4c (diff) | |
download | connman-83571bf295a3c1466300f852c3be4277da8d7efa.tar.gz connman-83571bf295a3c1466300f852c3be4277da8d7efa.tar.bz2 connman-83571bf295a3c1466300f852c3be4277da8d7efa.zip |
Update counter test script to print roaming ones as well
-rwxr-xr-x | test/test-counter | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/test/test-counter b/test/test-counter index 111d4fc5..2cdee341 100755 --- a/test/test-counter +++ b/test/test-counter @@ -23,31 +23,34 @@ def make_bytes_readable(bytes): return '' +def print_stats(stats): + keys = stats.keys() + keys.sort() + + for key in keys: + val = int(stats[key]) + str = " %s = %s" % (key, val) + + if key in ["RX.Bytes", "TX.Bytes"]: + hstr = make_bytes_readable(val) + if hstr: + str = "%s (%s)" % (str, hstr) + + print str + class Counter(dbus.service.Object): @dbus.service.method("org.moblin.connman.Counter", - in_signature='', out_signature='') + in_signature='', out_signature='') def Release(self): print("Release") mainloop.quit() @dbus.service.method("org.moblin.connman.Counter", - in_signature='oa{sv}', out_signature='') - def Usage(self, path, stats): + in_signature='oa{sv}a{sv}', out_signature='') + def Usage(self, path, home, roaming): print "%s" % (path) - - keys = stats.keys() - keys.sort() - - for key in keys: - val = int(stats[key]) - str = " %s = %s" % (key, val) - - if key in ["RX.Bytes", "TX.Bytes"]: - hstr = make_bytes_readable(val) - if hstr: - str = "%s (%s)" % (str, hstr) - - print str + print_stats(home) + print_stats(roaming) if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) |