# Path: epymc/events.py
# def DBG(msg):
# def listener_add(name, func, *a, **ka):
# def listener_add_single_shot(event, func, *a, **ka):
# def listener_del(name):
# def event_emit(event):


from epymc import events
        (name, cb, data) = lis
        DBG('  * ' + name)


def listener_del(name):
    global _listeners

    DBG('Listener Del: ' + name)
    for lis in _listeners:
        (n, cb, data) = lis
        if n == name:
            _listeners.remove(lis)
            return


def listener_promote(name):
    global _listeners

    DBG('Listener Promote: ' + name)
    for lis in _listeners:
        (n, cb, data) = lis
        if n == name:
            _listeners.remove(lis)
            _listeners.append(lis)
            return


def event_emit(event):
    DBG('Emit Event: ' + event + '  listeners: ' + str(len(_listeners)))


# Path: epymc/events.py
# def DBG(msg):
# def listener_add(name, func, *a, **ka):
# def listener_add_single_shot(event, func, *a, **ka):
# def listener_del(name):
# def event_emit(event):


# Path: epymc/input_events.py
from epymc import events

        (name, cb, data) = lis
        DBG('  * ' + name)


def listener_del(name):
    global _listeners

    DBG('Listener Del: ' + name)
    for lis in _listeners:
        (n, cb, data) = lis
        if n == name:
            _listeners.remove(lis)
            return


def listener_promote(name):
    global _listeners

    DBG('Listener Promote: ' + name)
    for lis in _listeners:
        (n, cb, data) = lis
        if n == name:
            _listeners.remove(lis)
            _listeners.append(lis)
            return


def event_emit(event):
    DBG('Emit Event: ' + event + '  listeners: ' + str(len(_listeners)))


    events.event_emit('KEEP_ALIVE')