def __call__(self, func): """ Decorator function to add a Hook to a Part's function Args: func: Function to decorate with Hook Returns: Decorated function """ func.Hook = self MethodMeta.wrap_method(func) return func
def __call__(self, func): """ Decorator function to add a Hook to a Part's function Args: func: Function to decorate with Hook Returns: Decorated function """ if not hasattr(func, "Hooked"): func.Hooked = [] func.Hooked.append(self) # TODO: is this needed? MethodMeta.wrap_method(func) return func
def __call__(self, func): """ Decorator function to add a Hook to a Part's function Args: func: Function to decorate with Hook Returns: Decorated function """ if not hasattr(func, "Hooked"): func.Hooked = [] func.Hooked.append(self) # TODO: is this needed? MethodMeta.wrap_method(func) return func