Fix default values for built-in enabled plugins
[connman] / test / list-profiles
index fcf1830..710a36c 100755 (executable)
@@ -7,16 +7,28 @@ bus = dbus.SystemBus()
 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
                                        "org.moblin.connman.Manager")
 
-profiles = manager.ListProfiles()
+properties = manager.GetProperties()
 
-for path in profiles:
-       print "[ %s ]" % (path)
+active = properties["ActiveProfile"]
 
-       element = dbus.Interface(bus.get_object("org.moblin.connman", path),
+for path in properties["Profiles"]:
+       if (active == path):
+               print "[ %s ]  <== active" % (path)
+       else:
+               print "[ %s ]" % (path)
+
+       profile = dbus.Interface(bus.get_object("org.moblin.connman", path),
                                                "org.moblin.connman.Profile")
 
-       properties = element.GetProperties()
+       properties = profile.GetProperties()
        for key in properties.keys():
-               print "    %s = %s" % (key, properties[key])
+               if key in ["Services"]:
+                       list = ""
+                       for path in properties["Services"]:
+                               val = str(path)
+                               list = list + val[val.rfind("/") + 1:] + " "
+                       print "    Services = [ %s]" % (list)
+               else:
+                       print "    %s = %s" % (key, properties[key])
 
        print