# Path: pubs/events.py
# class Event(object):
#     """Base event that can be sent to listeners.
#     """
# 
#     def send(self):
#         """ This function sends the instance of the class, i.e. the event
#         to be sent, to all function that listen to it.
#         """
#         for cls, f, args in _listener:
#             if isinstance(self, cls):
#                 f(self, *args)
# 
#     @classmethod
#     def listen(cls, *args):
#         def wrap(f):
#             _listener.append((cls, f, args))
# 
#             # next step allow us to call the function itself without Event raised
#             def wrapped_f(*args):
#                 f(*args)
#             return wrapped_f
#         return wrap
# 
# 
#     # Command events


import unittest
import dotdot
from pubs.events import Event



_output = None


class StringEvent(Event):
    def __init__(self, string):
        self.string = string

    def print_one(self):
        _output.append('one')


class AddEvent(Event):
    def __init__(self):
        pass

    def add(self, a, b):
        return a + b



# Path: pubs/events.py
# class Event(object):
#     """Base event that can be sent to listeners.
#     """
# 
#     def send(self):
#         """ This function sends the instance of the class, i.e. the event
#         to be sent, to all function that listen to it.
#         """
#         for cls, f, args in _listener:
#             if isinstance(self, cls):
#                 f(self, *args)
# 
#     @classmethod
#     def listen(cls, *args):
#         def wrap(f):
#             _listener.append((cls, f, args))
# 
#             # next step allow us to call the function itself without Event raised
#             def wrapped_f(*args):
#                 f(*args)
#             return wrapped_f
#         return wrap
# 
# 
#     # Command events


# Path: tests/test_events.py
import unittest
import dotdot
from pubs.events import Event




_output = None


class StringEvent(Event):
    def __init__(self, string):
        self.string = string

    def print_one(self):
        _output.append('one')


class AddEvent(Event):
    def __init__(self):
        pass

    def add(self, a, b):
        return a + b



class Info(Event):