5 NMI
= 'org.freedesktop.NetworkManager'
7 class cNM(object.cObject
):
8 # TODO: pull them from introspection.xml
9 NM_STATE
= ["UNKNOWN", "ASLEEP", "CONNECTING", "CONNECTED", "DISCONNECTED",]
11 def __init__(self
, opath
, options
):
12 object.cObject
.__init
__(self
, opath
)
13 self
.nmi
= dbus
.Interface(self
.obj
, NMI
)
14 self
.options
= options
23 "Dumps its own info (not owned objects)."
29 for device
in self
.Devices():
32 if self
.options
.actcon
:
33 print "Active Connections"
34 aconns
= self
.ActiveConnections()
39 print "Wifi Networks:"
40 for dev
in self
.Devices():
43 def err_handler(self
, *args
):
46 def silent_handler(self
, *args
):
50 def quitter_handler(self
, *args
):
51 # exit the loop that runs only because of us
56 self
.bus
.add_signal_receiver(self
.state_changed_handler
,
58 signal_name
="StateChanged")
60 def state_changed_handler(self
, *args
):
63 print time
.strftime("(%X)"),