Dependency fixes after the split.
[cnetworkmanager.git] / manager07.py
blob289befa138ba94434fafcd0a38fd6cac17cfacb3
1 from manager import cNM, NMI
2 from object import *
3 from device07 import cDevice_07
4 from applet import USC
6 class cNM_07(cNM):
7 def Api(self):
8 return "07"
10 def SetWifiEnabled(self, v):
11 self.set_property("WirelessEnabled", v)
13 def SetOnline(self, v):
14 self.nmi.Sleep(not v)
16 def Dump0(self):
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")
21 def Devices(self):
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__,
33 device.opath,
34 ap.opath,
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)
46 def Dump(self):
47 print self.opath
48 for P in ["ServiceName", "Connection", "SpecificObject",]:
49 print " %s: %s" % (P, self.get_property(P))
50 devs = self.get_property("Devices")
51 print " Devices:"
52 for dev in devs:
53 print " ", dev