def __init__(cls, *args, **kwargs): HandlerMeta.__init__(cls, *args, **kwargs) for name in ItemMeta.wordAccessors: if hasattr(cls, name): s = getattr(cls, name) setattr(cls, name, WordAccessor(name)) setattr(cls, '_%s' % name, s)
def __call__(cls, *args, **kwargs): self = HandlerMeta.__call__(cls, *args, **kwargs) for name in ItemMeta.wordAccessors: n = '_%s' % name if hasattr(cls, n): setattr(self, name, getattr(cls, n)) return self