1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 """
34 This class is used for connecting one instance of a class to another.
35 """
36
37
38 __author__ = "Olof Svensson"
39 __contact__ = "svensson@esrf.fr"
40 __license__ = "LGPLv3+"
41 __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
42
43
44 from EDObject import EDObject
45 from EDVerbose import EDVerbose
46
48 """
49 This class is used for connecting one instance of a class to another.
50 """
51
57
58
60 """
61 Connects a signal between an object and a method in an other object.
62 """
63 if (_pyClassMethod == None):
64 EDVerbose.error("EDSlot.connect: None class method")
65 return
66 self.synchronizeOn()
67 self.__listMethod.append(_pyClassMethod)
68 self.synchronizeOff()
69
70
71 - def call(self, _tupleArguments=None):
72 """
73 Calls a slot with a list of arguments.
74 @param _tupleArguments: arguments to be passed to the slot method
75 @type _tupleArguments: tuple
76 """
77 self.synchronizeOn()
78 for pyMethod in self.__listMethod:
79 if (pyMethod is not None):
80 self.executeMethod(pyMethod, _tupleArguments)
81 self.synchronizeOff()
82
83
85 if (_tupleArguments is None):
86 _pyMethod()
87 else:
88 _pyMethod(_tupleArguments)
89
90
92 return self.__listMethod
93
94
96 self.__listMethod = []
97