Beispiel #1
0
def no_op_wraps(func):
    """Replaces functools.wraps in order to undo wrapping when generating Sphinx documentation."""
    if func.__module__ is None or 'blessed' not in func.__module__:
        return functools.orig_wraps(func)

    def wrapper(decorator):
        sys.stderr.write('patched for function signature: {0!r}\n'.format(func))
        return func
    return wrapper
Beispiel #2
0
def no_op_wraps(func):
    """
    Replaces functools.wraps in order to undo wrapping when generating Sphinx documentation
    """
    if func.__module__ is None or 'ocellaris' not in func.__module__:
        return functools.orig_wraps(func)

    def wrapper(decorator):
        return func

    return wrapper
Beispiel #3
0
def no_op_wraps(func):
    """
    Replaces functools.wraps in order to undo wrapping when generating Sphinx documentation
    """
    import sys
    if func.__module__ is None or 'blessed' not in func.__module__:
        return functools.orig_wraps(func)
    def wrapper(decorator):
        sys.stderr.write('patched for function signature: {0!r}\n'.format(func))
        return func
    return wrapper
Beispiel #4
0
def no_op_wraps( func ):
    '''
    Replaces functools.wraps in order to undo wrapping when generating
    Sphinx documentation. This must be done before "confmgr" is imported.
    '''
    if func.__module__ is None or 'confmgr' not in func.__module__:
        return functools.orig_wraps(func)

    def wrapper(decorator):
        '''
        Return the original function
        '''
        return func

    return wrapper
Beispiel #5
0
def wraps(func):
    return orig_wraps(func, WRAPPER_ASSIGNMENTS)