summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest/list-operators15
1 files changed, 7 insertions, 8 deletions
diff --git a/test/list-operators b/test/list-operators
index 52ef95a0..c29ab028 100755
--- a/test/list-operators
+++ b/test/list-operators
@@ -1,6 +1,7 @@
#!/usr/bin/python
import dbus
+import sys
bus = dbus.SystemBus()
@@ -23,14 +24,12 @@ for path in properties["Modems"]:
netreg = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.NetworkRegistration')
- properties = netreg.GetProperties()
-
- for path in properties["Operators"]:
- operator = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.NetworkOperator')
-
- properties = operator.GetProperties()
+ if len(sys.argv) == 2 and sys.argv[1] == 'scan':
+ operators = netreg.Scan()
+ else:
+ operators = netreg.GetOperators()
+ for path, properties in operators:
print " [ %s ]" % (path)
for key in properties.keys():
@@ -41,5 +40,5 @@ for path in properties["Modems"]:
else:
val = str(properties[key])
print " %s = %s" % (key, val)
-
+
print