list-operators: Update to the new API

This commit is contained in:
Denis Kenzior 2010-08-18 17:47:14 -05:00
parent b67a324ff4
commit e7c6ba28ad
1 changed files with 7 additions and 8 deletions

View File

@ -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