# Path: cuwo/types.py
# class AttributeSet(set):
#     """
#     set with attribute access, i.e.
# 
#         foo = AttributeSet()
#         foo.bar = True
#         foo.bar == 'bar' in foo == True
#         foo.bar = False
#         foo.bar == 'bar' in foo == False
# 
#     This works as a quick shorthand for membership testing.
#     """
# 
#     def __getattr__(self, name):
#         return name in self
# 
#     def __setattr__(self, name, value):
#         if value:
#             self.add(name)
#         else:
#             self.discard(name)
# 
# class AttributeDict(dict):
#     """
#     dict with attribute access
#     """
#     def __init__(self, *args, **kw):
#         super(AttributeDict, self).__init__(*args, **kw)
#         self.__dict__ = self


from cuwo.types import AttributeSet, AttributeDict
import collections
import sys
import inspect
            import traceback

    def get(self):
        return self.items.values()

    def call(self, event_name, **kw):
        try:
            handlers = self.cached_calls[event_name]
        except KeyError:
            handlers = []
            for script in self.items.values():
                f = getattr(script, event_name, None)
                if not f:
                    continue
                handlers.append(f)
            self.cached_calls[event_name] = handlers

        event = AttributeDict(kw)
        for handler in handlers:
            ret = handler(event)
            if ret is None:
                continue
            event.result = ret
            break
        else:
            event.result = None
        return event


class BaseScript:
    def call(self, event_name, **kw):

# Path: cuwo/types.py
# class AttributeSet(set):
#     """
#     set with attribute access, i.e.
# 
#         foo = AttributeSet()
#         foo.bar = True
#         foo.bar == 'bar' in foo == True
#         foo.bar = False
#         foo.bar == 'bar' in foo == False
# 
#     This works as a quick shorthand for membership testing.
#     """
# 
#     def __getattr__(self, name):
#         return name in self
# 
#     def __setattr__(self, name, value):
#         if value:
#             self.add(name)
#         else:
#             self.discard(name)
# 
# class AttributeDict(dict):
#     """
#     dict with attribute access
#     """
#     def __init__(self, *args, **kw):
#         super(AttributeDict, self).__init__(*args, **kw)
#         self.__dict__ = self


# Path: cuwo/script.py
from cuwo.types import AttributeSet, AttributeDict
import collections
import sys
import inspect
            import traceback


    def get(self):
        return self.items.values()

    def call(self, event_name, **kw):
        try:
            handlers = self.cached_calls[event_name]
        except KeyError:
            handlers = []
            for script in self.items.values():
                f = getattr(script, event_name, None)
                if not f:
                    continue
                handlers.append(f)
            self.cached_calls[event_name] = handlers

        event = AttributeDict(kw)
        for handler in handlers:
            ret = handler(event)
            if ret is None:
                continue
            event.result = ret
            break
        else:
            event.result = None
        return event


class BaseScript:
    def call(self, event_name, **kw):

        event = AttributeDict(kw)