9a68d20e51ba5510d30324f7f9ce87f571e0de78
[connman] / test / list-profiles
1 #!/usr/bin/python
2
3 import dbus
4
5 bus = dbus.SystemBus()
6
7 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
8                                         "org.moblin.connman.Manager")
9
10 properties = manager.GetProperties()
11
12 for path in properties["Profiles"]:
13         print "[ %s ]" % (path)
14
15         profile = dbus.Interface(bus.get_object("org.moblin.connman", path),
16                                                 "org.moblin.connman.Profile")
17
18         properties = profile.GetProperties()
19         for key in properties.keys():
20                 if key in ["Services"]:
21                         list = ""
22                         for path in properties["Services"]:
23                                 val = str(path)
24                                 list = list + val[val.rfind("/") + 1:] + " "
25                         print "    Services = [ %s]" % (list)
26                 else:
27                         print "    %s = %s" % (key, properties[key])
28
29         print