From ec03e22b0bd92665aa83c4e27f494ec2df49b4d9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 May 2009 21:27:13 -0700 Subject: Add extra test script for listing services --- test/list-services | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/list-services (limited to 'test/list-services') diff --git a/test/list-services b/test/list-services new file mode 100755 index 00000000..522e122c --- /dev/null +++ b/test/list-services @@ -0,0 +1,27 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + +properties = manager.GetProperties() + +for path in properties["Services"]: + service = dbus.Interface(bus.get_object("org.moblin.connman", path), + "org.moblin.connman.Service") + + properties = service.GetProperties() + + print "[ %s ]" % (path) + + for key in properties.keys(): + if key in ["Strength"]: + val = int(properties[key]) + else: + val = str(properties[key]) + print " %s = %s" % (key, val) + + print -- cgit v1.2.3