|
| def | __init__ (self) |
| |
| def | Connect (self, object, channel, function, args) |
| |
| def | Disconnect (self, object, channel, function, args) |
| |
| def | Emit (self, object, channel, *args) |
| |
Definition at line 46 of file CONNECTOR.py.
◆ __init__()
| def gui.CONNECTOR.CONNECTOR.__init__ |
( |
|
self | ) |
|
◆ Connect()
| def gui.CONNECTOR.CONNECTOR.Connect |
( |
|
self, |
|
|
|
object, |
|
|
|
channel, |
|
|
|
function, |
|
|
|
args |
|
) |
| |
Definition at line 51 of file CONNECTOR.py.
51 def Connect(self, object, channel, function, args):
54 if idx
in self.connections:
55 channels = self.connections[idx]
57 channels = self.connections[idx] = {}
59 if channel
in channels:
60 receivers = channels[channel]
62 receivers = channels[channel] = []
64 for funct,fargs
in receivers[:]:
66 receivers.remove((funct,fargs))
67 elif (function,args) == (funct(),fargs):
68 receivers.remove((funct,fargs))
70 receivers.append((
ref(function),args))
def ref(target, callback=None)
References gui.CONNECTOR.CONNECTOR.connections, and gui.CONNECTOR.ref().
◆ Disconnect()
| def gui.CONNECTOR.CONNECTOR.Disconnect |
( |
|
self, |
|
|
|
object, |
|
|
|
channel, |
|
|
|
function, |
|
|
|
args |
|
) |
| |
Definition at line 74 of file CONNECTOR.py.
74 def Disconnect(self, object, channel, function, args):
76 receivers = self.connections[id(object)][channel]
78 raise ConnectorError(
'no receivers for channel %s of %s' % (channel, object))
80 for funct,fargs
in receivers[:]:
82 receivers.remove((funct,fargs))
84 for funct,fargs
in receivers:
85 if (function,args) == (funct(),fargs):
86 receivers.remove((funct,fargs))
89 channels = self.connections[id(object)]
93 del self.connections[id(object)]
96 raise ConnectorError(
'receiver %s%s is not connected to channel %s of %s' \
97 % (function, args, channel, object))
References gui.CONNECTOR.CONNECTOR.connections.
◆ Emit()
| def gui.CONNECTOR.CONNECTOR.Emit |
( |
|
self, |
|
|
|
object, |
|
|
|
channel, |
|
|
* |
args |
|
) |
| |
Definition at line 100 of file CONNECTOR.py.
100 def Emit(self, object, channel, *args):
103 receivers = self.connections[id(object)][channel]
109 for rfunc, fargs
in copy(receivers):
116 if (rfunc,fargs)
in receivers:receivers.remove((rfunc,fargs))
118 traceback.print_exc()
References gui.CONNECTOR.CONNECTOR.connections.
◆ connections
| gui.CONNECTOR.CONNECTOR.connections |
The documentation for this class was generated from the following file: