diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-05-04 16:06:50 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-05-04 15:26:41 +0200 |
commit | 152f3c77ee978a024c57a2f6e791cd00041df8a3 (patch) | |
tree | d46dda18405212594c23ca81194d88908d8b1af3 /test | |
parent | 65af499cc67950a3c40626f704025e4f371bc2b7 (diff) | |
download | connman-152f3c77ee978a024c57a2f6e791cd00041df8a3.tar.gz connman-152f3c77ee978a024c57a2f6e791cd00041df8a3.tar.bz2 connman-152f3c77ee978a024c57a2f6e791cd00041df8a3.zip |
test: Show autoconnect and state in services list
Show the autoconnect "A" and state "R"eady or "O"nline
indicators in the services list.
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-connman | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test-connman b/test/test-connman index 473af628..67b0c85c 100755 --- a/test/test-connman +++ b/test/test-connman @@ -27,9 +27,21 @@ if len(sys.argv) < 2: def print_services(services): for path, properties in services: identifier = path[path.rfind("/") + 1:] + state = " " + autoconnect = " " if properties["Favorite"] == dbus.Boolean(1): favorite = "*" + + if properties["AutoConnect"] == dbus.Boolean(1): + autoconnect = " A" + else: + autoconnect = " " + + if properties["State"] == "ready": + state = "R" + elif properties["State"] == "online": + state = "O" else: favorite = " " @@ -38,7 +50,8 @@ def print_services(services): else: name = "{" + properties["Type"] + "}" - print "%s %-26s { %s }" % (favorite, name, identifier) + print "%s%s%s %-26s { %s }" % (favorite, autoconnect, state, + name, identifier) if sys.argv[1] == "state": properties = manager.GetProperties() |