diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-09-02 03:58:27 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-09-02 03:58:27 -0700 |
commit | 7aec65b52656875e25df35b11cb6eb75eb2cc69f (patch) | |
tree | 87b8102f163b6a916f0c9edbb491495d70d529bb /test/list-operators | |
parent | 3d2d2595781c78a447a27f19b5cde67cf9dbe966 (diff) | |
download | ofono-7aec65b52656875e25df35b11cb6eb75eb2cc69f.tar.bz2 |
Add test script for listing all operator details
Diffstat (limited to 'test/list-operators')
-rwxr-xr-x | test/list-operators | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/list-operators b/test/list-operators new file mode 100755 index 00000000..3e9e4082 --- /dev/null +++ b/test/list-operators @@ -0,0 +1,40 @@ +#!/usr/bin/python + +import dbus + +bus = dbus.SystemBus() + +manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + +properties = manager.GetProperties() + +for path in properties["Modems"]: + modem = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.Modem') + + properties = modem.GetProperties() + + print "[ %s ]" % (path) + + if "org.ofono.NetworkRegistration" not in properties["Interfaces"]: + continue + + netreg = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.NetworkRegistration') + + properties = netreg.GetProperties() + + for path in properties["AvailableOperators"]: + operator = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.NetworkOperator') + + properties = operator.GetProperties() + + print " [ %s ]" % (path) + + for key in properties.keys(): + val = str(properties[key]) + print " %s = %s" % (key, val) + + print |