#!/usr/bin/env python3


import logging
import threading


logger = logging.getLogger("barython")


class _Hook(threading.Thread):
    #: list of callbacks
    callbacks = None

    def notify(self, *args, **kwargs):
        for c in self.callbacks:
            try:
                threading.Thread(target=c, args=args, kwargs=kwargs).start()
            except:
                continue

    def __init__(self, callbacks=None, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.callbacks = []
        if callbacks is not None:
            self.callbacks.extend(callbacks)

Add the abstract class _Hook
Add the abstract class _Hook

Related to #2
Should be used by the panel to handle events and spread it through the
widgets.
