3 class cNM_06(manager
.cNM
):
7 def SetWifiEnabled(self
, v
):
8 # TODO: async call, catch the state signal and exit
9 # weird: synchronous call works, but times out
10 # asynchronous call does not work
11 self
.nmi
.setWirelessEnabled(v
,
12 reply_handler
=self
.quitter_handler
,
13 error_handler
=self
.quitter_handler
)
17 def SetOnline(self
, v
):
20 reply_handler
=self
.quitter_handler
,
21 error_handler
=self
.quitter_handler
)
24 reply_handler
=self
.quitter_handler
,
25 error_handler
=self
.quitter_handler
)
30 print "State:", self
.NM_STATE
[self
.nmi
.state()]
31 we
= self
.nmi
.getWirelessEnabled()
32 if isinstance(we
, tuple):
33 print "Wifi enabled:", bool(we
[0])
34 print "Wifi HW enabled:", bool(we
[1])
36 print "Wifi enabled:", bool(we
)
39 dup
= self
.nmi
.getDialup()
41 except dbus
.exceptions
.DBusException
, e
:
42 #if e.get_dbus_name() == "org.freedesktop.NetworkManager.NoDialup":
48 opaths
= self
.nmi
.getDevices()
49 return map(cDevice_06
, opaths
)
51 def ActiveConnections(self
):
52 return [] # at most one active connection, FIXME find it
54 def ActivateConnection(self
, conn
, device
, ap
):
55 # passing *_handler makes the call asynchronous
56 self
.nmi
.setActiveDevice(device
.opath
, ssid_str(conn
.Ssid()),
57 reply_handler
=self
.silent_handler
,
58 error_handler
=self
.err_handler
,