From 5524b1732417c539cf3f6cf75e0ef5cbad4e710a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 13 Oct 2010 02:41:53 -0500 Subject: [PATCH] test: Add get-icon script --- Makefile.am | 3 ++- test/get-icon | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 test/get-icon diff --git a/Makefile.am b/Makefile.am index 6c56459d..fd791cf4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -407,7 +407,8 @@ test_scripts = test/backtrace \ test/lock-pin \ test/unlock-pin \ test/enable-gprs \ - test/disable-gprs + test/disable-gprs \ + test/get-icon if TEST testdir = $(pkglibdir)/test diff --git a/test/get-icon b/test/get-icon new file mode 100755 index 00000000..eb6f0969 --- /dev/null +++ b/test/get-icon @@ -0,0 +1,27 @@ +#!/usr/bin/python + +import dbus +import sys + +bus = dbus.SystemBus() + +if len(sys.argv) == 2: + id = sys.argv[1] +else: + print "%s " % (sys.argv[0]) + sys.exit(0) + +manager = dbus.Interface(bus.get_object("org.ofono", "/"), + "org.ofono.Manager") + +modems = manager.GetModems() + +for path, properties in modems: + if "org.ofono.SimManager" not in properties["Interfaces"]: + continue + +sim = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.SimManager') + +icon = sim.GetIcon(dbus.Byte(int(sys.argv[1]))) +print icon