[Erp5-report] r45078 leonardo - /erp5/trunk/products/ERP5Type/Utils.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Apr 5 10:05:11 CEST 2011
Author: leonardo
Date: Tue Apr 5 10:05:10 2011
New Revision: 45078
URL: http://svn.erp5.org?rev=45078&view=rev
Log:
store decorated function in easy to navigate attribute for IPython/ipdb debugging
Modified:
erp5/trunk/products/ERP5Type/Utils.py
Modified: erp5/trunk/products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Utils.py?rev=45078&r1=45077&r2=45078&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Utils.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Utils.py [utf8] Tue Apr 5 10:05:10 2011
@@ -79,11 +79,13 @@ def simple_decorator(decorator):
g.__name__ = f.__name__
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
More information about the Erp5-report
mailing list