How to use the decorator.new_wrapper function in decorator

To help you get started, we’ve selected a few decorator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benadida / helios-server / helios_auth / auth_systems / facebookclient / djangofb / __init__.py View on Github external
def newdecorator(view):
                return decorator.new_wrapper(original(view), view)
            return decorator.new_wrapper(newdecorator, original)
github benadida / helios-server / helios_auth / auth_systems / facebookclient / djangofb / __init__.py View on Github external
def updater(f):
        def updated(*args, **kwargs):
            original = f(*args, **kwargs)
            def newdecorator(view):
                return decorator.new_wrapper(original(view), view)
            return decorator.new_wrapper(newdecorator, original)
        return decorator.new_wrapper(updated, f)
    require_login = updater(require_login)
github benadida / helios-server / helios_auth / auth_systems / facebookclient / djangofb / __init__.py View on Github external
def updated(*args, **kwargs):
            original = f(*args, **kwargs)
            def newdecorator(view):
                return decorator.new_wrapper(original(view), view)
            return decorator.new_wrapper(newdecorator, original)
        return decorator.new_wrapper(updated, f)