Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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