3 from svc_connection
import Connection
5 # server analog of cApplet
6 class UserSettings(dbus
.service
.Object
):
8 def __init__(self
, opath
, conmaps
):
10 dbus
.service
.Object
.__init
__(self
, bus
, opath
)
11 #print "CONMAPS:", conmaps
12 self
.conns
= map(self
.newCon
, conmaps
)
14 def addCon(self
, conmap
):
15 c
= self
.newCon(conmap
)
20 def newCon(self
, conmap
):
21 cpath
= "/MyConnection/%d" % self
.counter
22 self
.counter
= self
.counter
+ 1
23 c
= Connection(cpath
, conmap
)
24 self
.NewConnection(cpath
) # announce it
27 @dbus.service
.method(dbus_interface
='org.freedesktop.NetworkManagerSettings',
28 in_signature
='', out_signature
='ao')
29 def ListConnections(self
):
30 return [c
.__dbus
_object
_path
__ for c
in self
.conns
]
32 #this is for EMITTING a signal, not receiving it
33 @dbus.service
.signal(dbus_interface
='org.freedesktop.NetworkManagerSettings',
35 def NewConnection(self
, opath
):
37 #print "signalling newconn:", opath
39 def GetByNet(self
, net_name
):
40 "Returns connection, or None"