(decorator)
return new_decorator
Decorator to turn simple function into well-behaved decorator

  See also http://wiki.python.org/moin/PythonDecoratorLibrary

  XXX We should use http://pypi.python.org/pypi/decorator/ instead,
      to make decorators ZPublisher-friendly (but it is probably to slow).
Decorator to turn simple function into well-behaved decorator
Decorator to turn simple function into well - behaved decorator
def simple_decorator(decorator):
  """Decorator to turn simple function into well-behaved decorator

  See also http://wiki.python.org/moin/PythonDecoratorLibrary

  XXX We should use http://pypi.python.org/pypi/decorator/ instead,
      to make decorators ZPublisher-friendly (but it is probably to slow).
  """
  def new_decorator(f):
    g = decorator(f)
    try:
      g.__name__ = f.__name__
    except AttributeError:
      # XXX: Should be "convertToMixedCase(f._transition_id)"
      g.__name__ = f._m.__name__ # WorkflowMethod
    else:
      g.__doc__ = f.__doc__
      g.__dict__.update(f.__dict__)
    g._original = f # for tab_completion navigation in IPython
    return g
  # Now a few lines needed to make simple_decorator itself
  # be a well-behaved decorator.
  new_decorator.__name__ = decorator.__name__
  new_decorator.__doc__ = decorator.__doc__
  new_decorator._original = decorator # for tab_completion navigation in IPython
  new_decorator.__dict__.update(decorator.__dict__)
  return new_decorator
def simple_decorator ( decorator ) : def new_decorator ( f ) : g = decorator ( f ) try : g . __name__ = f . __name__ except AttributeError : # XXX: Should be "convertToMixedCase(f._transition_id)" g . __name__ = f . _m . __name__ # WorkflowMethod else : g . __doc__ = f . __doc__ g . __dict__ . update ( f . __dict__ ) g . _original = f # for tab_completion navigation in IPython return g # Now a few lines needed to make simple_decorator itself # be a well-behaved decorator. new_decorator . __name__ = decorator . __name__ new_decorator . __doc__ = decorator . __doc__ new_decorator . _original = decorator # for tab_completion navigation in IPython new_decorator . __dict__ . update ( decorator . __dict__ ) return new_decorator