7 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
8 "org.moblin.connman.Manager")
10 properties = manager.GetProperties()
12 def print_properties(key, value):
14 interface = "org.moblin.connman.Profile"
15 elif key == "Devices":
16 interface = "org.moblin.connman.Device"
17 elif key == "Services":
18 interface = "org.moblin.connman.Service"
19 elif key == "Providers":
20 interface = "org.moblin.connman.Provider"
27 obj = dbus.Interface(bus.get_object("org.moblin.connman", path),
30 properties = obj.GetProperties()
32 for key in properties.keys():
33 if key in ["Networks", "Services", "Providers"]:
36 if key in ["Powered", "Scanning", "Connected",
37 "Available", "Remember", "Default"]:
38 if properties[key] == dbus.Boolean(1):
42 elif key in ["Strength", "Priority"]:
43 val = int(properties[key])
45 val = str(properties[key])
47 print " %s = %s" % (key, val)
49 if "Networks" in properties.keys():
51 for path in properties["Networks"]:
53 list = list + val[val.rfind("/") + 1:] + " "
54 print " Networks = [ %s]" % (list)
55 if "Services" in properties.keys():
57 for path in properties["Services"]:
59 list = list + val[val.rfind("/") + 1:] + " "
60 print " Services = [ %s]" % (list)
61 if "Providers" in properties.keys():
63 for path in properties["Providers"]:
65 list = list + val[val.rfind("/") + 1:] + " "
66 print " Providers = [ %s]" % (list)
69 for key in properties.keys():
70 if key in ["Profiles", "Devices", "Services", "Providers"]:
71 print_properties(key, properties[key])
72 elif key in ["AvailableTechnologies", "EnabledTechnologies",
73 "ConnectedTechnologies",
74 "AvailableDebugs", "EnabledDebugs"]:
77 for val in properties[key]:
78 list = list + val + " "
79 print " [ %s]" % (list)
80 elif key in ["OfflineMode"]:
82 if properties[key] == dbus.Boolean(1):
86 elif key in ["DefaultTechnology"]:
88 if properties[key] == "":
91 print " %s" % (properties[key])
94 print " %s" % (properties[key])