mirror of git://git.sysmocom.de/ofono
list-operators: Update to the new API
This commit is contained in:
parent
b67a324ff4
commit
e7c6ba28ad
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
import dbus
|
import dbus
|
||||||
|
import sys
|
||||||
|
|
||||||
bus = dbus.SystemBus()
|
bus = dbus.SystemBus()
|
||||||
|
|
||||||
|
@ -23,14 +24,12 @@ for path in properties["Modems"]:
|
||||||
netreg = dbus.Interface(bus.get_object('org.ofono', path),
|
netreg = dbus.Interface(bus.get_object('org.ofono', path),
|
||||||
'org.ofono.NetworkRegistration')
|
'org.ofono.NetworkRegistration')
|
||||||
|
|
||||||
properties = netreg.GetProperties()
|
if len(sys.argv) == 2 and sys.argv[1] == 'scan':
|
||||||
|
operators = netreg.Scan()
|
||||||
for path in properties["Operators"]:
|
else:
|
||||||
operator = dbus.Interface(bus.get_object('org.ofono', path),
|
operators = netreg.GetOperators()
|
||||||
'org.ofono.NetworkOperator')
|
|
||||||
|
|
||||||
properties = operator.GetProperties()
|
|
||||||
|
|
||||||
|
for path, properties in operators:
|
||||||
print " [ %s ]" % (path)
|
print " [ %s ]" % (path)
|
||||||
|
|
||||||
for key in properties.keys():
|
for key in properties.keys():
|
||||||
|
|
Loading…
Reference in New Issue