diff options
author | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2010-02-15 14:20:30 -0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-02-15 11:25:43 -0800 |
commit | 913898ed5da9c9721c90d49bfc64a8e2b1ad4b5c (patch) | |
tree | fa95c096f475fef3df4fb60b64d7f61a7a355745 /test | |
parent | 0dc2c57ff5d457a96a8a252fc34f9e4662654f76 (diff) | |
download | connman-913898ed5da9c9721c90d49bfc64a8e2b1ad4b5c.tar.gz connman-913898ed5da9c9721c90d49bfc64a8e2b1ad4b5c.tar.bz2 connman-913898ed5da9c9721c90d49bfc64a8e2b1ad4b5c.zip |
Update test/list-networks to new properties hierarchy
The "Devices" property is gone, now need to walk "Technologies"
and then their devices.
Diffstat (limited to 'test')
-rwxr-xr-x | test/list-networks | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/test/list-networks b/test/list-networks index bf552c7c..052d318e 100755 --- a/test/list-networks +++ b/test/list-networks @@ -19,36 +19,42 @@ def convert_ssid(ssid_list): ssid = ssid + "." return ssid -for path in properties["Devices"]: - device = dbus.Interface(bus.get_object("org.moblin.connman", path), - "org.moblin.connman.Device") +for path in properties["Technologies"]: + technology = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Technology") - properties = device.GetProperties() + properties = technology.GetProperties() - try: - if properties["Type"] not in ["ethernet", "wifi", "wimax", - "bluetooth", "cellular"]: - continue - except: - continue + for path in properties["Devices"]: + device = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Device") - print "[ %s ]" % (path) + properties = device.GetProperties() - for path in properties["Networks"]: - network = dbus.Interface(bus.get_object("org.moblin.connman", path), - "org.moblin.connman.Network") + try: + if properties["Type"] not in ["ethernet", "wifi", "wimax", + "bluetooth", "cellular"]: + continue + except: + continue - properties = network.GetProperties() + print "[ %s ]" % (path) - print " [ %s ]" % (path) + for path in properties["Networks"]: + network = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Network") - for key in properties.keys(): - if key == "WiFi.SSID": - ssid = convert_ssid(properties[key]) - print " %s = [ %s ]" % (key, ssid) - elif key in ["Strength", "Priority"]: - print " %s = %d" % (key, properties[key]) - else: - print " %s = %s" % (key, properties[key]) + properties = network.GetProperties() - print + print " [ %s ]" % (path) + + for key in properties.keys(): + if key == "WiFi.SSID": + ssid = convert_ssid(properties[key]) + print " %s = [ %s ]" % (key, ssid) + elif key in ["Strength", "Priority"]: + print " %s = %d" % (key, properties[key]) + else: + print " %s = %s" % (key, properties[key]) + + print |