1 from manager
import cNM
, NMI
3 from device07
import cDevice_07
10 def SetWifiEnabled(self
, v
):
11 self
.set_property("WirelessEnabled", v
)
13 def SetOnline(self
, v
):
17 print "State:", self
.NM_STATE
[self
.get_property("State")]
18 print "Wifi enabled:", self
.get_property("WirelessEnabled")
19 print "Wifi HW enabled:", self
.get_property("WirelessHardwareEnabled")
22 opaths
= self
.nmi
.GetDevices()
23 return map(cDevice_07
, opaths
)
25 def ActiveConnections(self
):
26 aconns
= self
.get_property("ActiveConnections")
27 return map(cActiveConnection
, aconns
)
29 def ActivateConnection(self
, conn
, device
, ap
):
30 # passing *_handler makes the call asynchronous
31 self
.nmi
.ActivateConnection(USC
,
32 conn
.__dbus
_object
_path
__,
35 reply_handler
=self
.silent_handler
,
36 error_handler
=self
.err_handler
,
39 class cActiveConnection(cObject
):
40 def __init__(self
, opath
):
41 cObject
.__init
__(self
, opath
)
43 def get_property(self
, property_name
):
44 return cObject
.get_property(self
, NMI
, property_name
)
48 for P
in ["ServiceName", "Connection", "SpecificObject",]:
49 print " %s: %s" % (P
, self
.get_property(P
))
50 devs
= self
.get_property("Devices")