# 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
        self.doc = base.__doc__
        self.__call__ = func

        # parse function object information

        # get min args
        func_info = inspect.getargspec(base)
        self.min_args = len(func_info.args) - 1
        if func_info.varargs:
            self.max_args = None
        else:
            self.max_args = self.min_args
        if func_info.defaults is not None:
            self.min_args -= len(func_info.defaults)

    def __call__(self, *arg, **kw):
        return self.func(*arg, **kw)

    def is_compatible(self, rights):
        if self.user_types is None:
            return True
        return not rights.isdisjoint(self.user_types)

    def get_help(self):
        syntax = self.get_syntax()
        if self.doc is None:
            return syntax
        return "%s\n%s" % (self.doc, syntax)

    def get_syntax(self):

# 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

        self.doc = base.__doc__
        self.__call__ = func

        # parse function object information

        # get min args
        func_info = inspect.getargspec(base)
        self.min_args = len(func_info.args) - 1
        if func_info.varargs:
            self.max_args = None
        else:
            self.max_args = self.min_args
        if func_info.defaults is not None:
            self.min_args -= len(func_info.defaults)

    def __call__(self, *arg, **kw):
        return self.func(*arg, **kw)

    def is_compatible(self, rights):
        if self.user_types is None:
            return True
        return not rights.isdisjoint(self.user_types)

    def get_help(self):
        syntax = self.get_syntax()
        if self.doc is None:
            return syntax
        return "%s\n%s" % (self.doc, syntax)

    def get_syntax(self):

        func_info = inspect.getargspec(self.base)