def register(event, callback):
    """Register a plugin callback for a specific event

    The event must be declared in this module.

    :param event: the event to listen to
    :param callback: a function to execute when the event is raised
    """
    # if not event in EVENTS:
    #     print "Event %s not registered" % event
    #     return 0
    if event not in CALLBACKS.keys():
        CALLBACKS[event] = {}
    fullname = "%s.%s" % (callback.__module__, callback.__name__)
    if fullname not in CALLBACKS[event]:
        CALLBACKS[event][fullname] = callback
    return 1
dataset/ETHPy150Open tonioo/modoboa/modoboa/lib/events.py/register/original