A very (very very very very very...) simple python signal implementation
- Python 100%
Probably things will not work as expected. Also: - TODOs along the code - impossible to disconnect - impossible to connect a ConnectEmit instance to another ConnectEmit Tests are being created right now. |
||
|---|---|---|
| ce.py | ||
| README.md | ||
connectemit
A very (very very very very very...) simple python signal implementation, barely based on Qt signals.
This is not intended to be a drop-in replacement to pyqtSignal, but a lightweight (and limited) alternative.
See signalslot for a more robust and complete alternative.
Requirements
- python 2.7
Example
from ce import ConnectEmit
def abc(s, i):
print("ABC %s, %s" % (s, i))
def xyz(s, i):
print("XYZ %s, %s" % (s, i))
emitter = ConnectEmit(str, int, arguments=['s', 'i'])
emitter.connect(abc)
emitter.connect(xyz)
emitter.emit("123", 124)
TODO
This is a very (...) initial version, expect TODOs and XXXs and bugs along the code.
Also, the following are not currently supported (but are planned):
- diconnecting from function/methods
- connecting a ConnectEmit instance to another one (chaining)
- documentation
- tests
- python3 (should drop 2.7)