Ejemplo n.º 1
0
    def __init__(self):
        super(BaseComponent, self).__init__()

        self.obj_listeners = []

        self.gen_id = generate_id(self)

        self.router = Router()
        self._internal_router = Router()

        # This was init because I couldn't figure out how to append to a cls variable
        # in the subclass definitions. The mixin can do it, but I'd need a metaclass
        # to do it for the Series and Listening Component
        # also was done to bind to self
        self.add_component_hooks = EventHook()
        self.components = []

        self.broadcast_hooks = EventHook()
        self.broadcast_hooks += self.publish
        self.broadcast_hooks += self.send

        self.front = self
        self._init_hooks.fire(self)
Ejemplo n.º 2
0
 def __init__(self, event_cls=None, label_name=None):
     self.gen_id = generate_id(self)
     self.label_name = label_name
     self._hash = None
     self.event_cls = event_cls