summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-12-19 22:11:32 -0800
committerMarcel Holtmann <marcel@holtmann.org>2009-12-19 22:11:32 -0800
commit55aada694e22c0980ca107143b8d237f8415e28f (patch)
tree4cd2bf94ed011ab3dc8f24634871fa9f3a164da5 /test
parent3c9c554c5b8aed721d14c0e3d4d9f7ca3f47a28a (diff)
downloadconnman-55aada694e22c0980ca107143b8d237f8415e28f.tar.gz
connman-55aada694e22c0980ca107143b8d237f8415e28f.tar.bz2
connman-55aada694e22c0980ca107143b8d237f8415e28f.zip
Add support for more advanced service property listing
Diffstat (limited to 'test')
-rwxr-xr-xtest/list-services21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/list-services b/test/list-services
index 522e122c..107dba8c 100755
--- a/test/list-services
+++ b/test/list-services
@@ -2,6 +2,17 @@
import dbus
+def extract_values(values):
+ val = "{"
+ for key in values.keys():
+ val += " " + key + "="
+ if key in ["MTU"]:
+ val += int(values[key])
+ else:
+ val += str(values[key])
+ val += " }"
+ return val
+
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
@@ -18,7 +29,15 @@ for path in properties["Services"]:
print "[ %s ]" % (path)
for key in properties.keys():
- if key in ["Strength"]:
+ if key in ["IPv4", "Ethernet"]:
+ val = extract_values(properties[key])
+ elif key in ["Favorite", "AutoConnect",
+ "SetupRequired", "PassphraseRequired"]:
+ if properties[key] == dbus.Boolean(1):
+ val = "true"
+ else:
+ val = "false"
+ elif key in ["Strength"]:
val = int(properties[key])
else:
val = str(properties[key])