Simple implementation of signal/slot pattern.
Classes
| Signal | Represents typical Signal pattern with connect, disconnect and emit. |
Bases: object
Represents typical Signal pattern with connect, disconnect and emit. Can be used as a descriptor. Example:
class Car(object):
temperatureChanged = Signal(float)
def set_temperature(self, temp):
self.__temp = temp
self.temperatureChanged.emit(temp)
car = Car()
def on_temp_changed(temp):
print("Car temperature changed to {0}".format(temp))
car.temperatureChanged.connect(on_temp_changed)
car.set_temperature(13.4)