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
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
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
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
def wraps(func): return orig_wraps(func, WRAPPER_ASSIGNMENTS)