2010-06-19 18:17:05 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import dbus
|
|
|
|
import sys
|
|
|
|
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
|
|
|
|
if len(sys.argv) == 2:
|
|
|
|
path = sys.argv[1]
|
|
|
|
else:
|
|
|
|
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
|
|
|
'org.ofono.Manager')
|
2010-09-09 19:37:37 +00:00
|
|
|
modems = manager.GetModems()
|
|
|
|
path = modems[0][0]
|
2010-06-19 18:17:05 +00:00
|
|
|
|
|
|
|
netreg = dbus.Interface(bus.get_object('org.ofono', path),
|
|
|
|
'org.ofono.NetworkRegistration')
|
|
|
|
|
2010-08-20 09:53:32 +00:00
|
|
|
operators = netreg.GetOperators()
|
2010-06-19 18:17:05 +00:00
|
|
|
|
2010-08-20 09:53:32 +00:00
|
|
|
for entry in operators:
|
|
|
|
path = entry[0]
|
|
|
|
properties = entry[1]
|
2010-06-19 18:17:05 +00:00
|
|
|
|
|
|
|
print "[ %s ]" % (path)
|
|
|
|
|
|
|
|
for key in properties.keys():
|
|
|
|
if key in ["Technologies"]:
|
|
|
|
val = ""
|
|
|
|
for i in properties[key]:
|
|
|
|
val += i + " "
|
|
|
|
else:
|
|
|
|
val = str(properties[key])
|
|
|
|
print " %s = %s" % (key, val)
|
2010-09-09 19:37:37 +00:00
|
|
|
|
2010-06-19 18:17:05 +00:00
|
|
|
print
|
|
|
|
|