summaryrefslogtreecommitdiff
path: root/test/test-manager
blob: 5ed672aaf7cd6ded25585da5ba825cf860dca866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python

import dbus

bus = dbus.SystemBus()

manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
					"org.moblin.connman.Manager")

properties = manager.GetProperties()

def print_properties(key, value):
	if (key == "Profiles"):
		interface = "org.moblin.connman.Profile"
	elif (key == "Devices"):
		interface = "org.moblin.connman.Device"
	elif (key == "Connections"):
		interface = "org.moblin.connman.Connection"
	else:
		return

	print "%s" % (key)
	for path in value:
		print "    %s" % (path)
		obj = dbus.Interface(bus.get_object("org.moblin.connman", path),
								interface)

		properties = obj.GetProperties()

		for key in properties.keys():
			print "        %s = %s" % (key, properties[key])

for key in properties.keys():
	if (key in ["Profiles", "Devices", "Connections"]):
		print_properties(key, properties[key])
	else:
		print "%s" % (key)
		print "    %s" % (properties[key])