initial commit
This commit is contained in:
parent
f0f033b4fb
commit
d0245e09fc
11 changed files with 294 additions and 0 deletions
16
python_apps/media-monitor2/media/monitor/handler.py
Normal file
16
python_apps/media-monitor2/media/monitor/handler.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from pydispatch import dispatcher
|
||||
import abc
|
||||
|
||||
class Handler(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
def __init__(self, signal, target):
|
||||
self.target = target
|
||||
self.signal = signal
|
||||
def dummy(sender, event):
|
||||
self.handle(sender,event)
|
||||
dispatcher.connect(dummy, signal=signal, sender=dispatcher.Any, weak=False)
|
||||
@abc.abstractmethod
|
||||
def handle(self, sender, event): pass
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue