diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-10-13 02:41:53 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-10-13 05:04:47 -0500 |
commit | 5524b1732417c539cf3f6cf75e0ef5cbad4e710a (patch) | |
tree | f7fca6604e40bf631417e927191ab4dd4843214b /test/get-icon | |
parent | bd8c7e92bbbcb467e410884e541e89c1638aa22e (diff) | |
download | ofono-5524b1732417c539cf3f6cf75e0ef5cbad4e710a.tar.bz2 |
test: Add get-icon script
Diffstat (limited to 'test/get-icon')
-rwxr-xr-x | test/get-icon | 27 |
1 files changed, 27 insertions, 0 deletions
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 <icon id>" % (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 |