(name, cls)
return wrapper
Handler arguments initialization decorator

    Define successor for handler class cls with func as argument generator
Handler arguments initialization decorator
Handler arguments initialization decorator
def handler_args(name, cls):
    """Handler arguments initialization decorator

    Define successor for handler class cls with func as argument generator
    """
    def wrapper(func):
        def _init_override(self, table_name, args, dest_table):
            cls.__init__(self, table_name, func(args.copy()), dest_table)
        dct = {'__init__': _init_override, 'handler_name': name}
        module = sys.modules[cls.__module__]
        newname = '%s_%s' % (cls.__name__, name.replace('.','_'))
        newcls = new.classobj(newname, (cls,), dct)
        setattr(module, newname, newcls)
        module.__londiste_handlers__.append(newcls)
        module.__all__.append(newname)
        return func
    return wrapper
def handler_args ( name , cls ) : def wrapper ( func ) : def _init_override ( self , table_name , args , dest_table ) : cls . __init__ ( self , table_name , func ( args . copy ( ) ) , dest_table ) dct = { '__init__' : _init_override , 'handler_name' : name } module = sys . modules [ cls . __module__ ] newname = '%s_%s' % ( cls . __name__ , name . replace ( '.' , '_' ) ) newcls = new . classobj ( newname , ( cls , ) , dct ) setattr ( module , newname , newcls ) module . __londiste_handlers__ . append ( newcls ) module . __all__ . append ( newname ) return func return wrapper