Author: dmeyer
Date: Mon Feb 13 19:41:36 2006
New Revision: 1176
Added:
trunk/base/src/base/decorators.py
Log:
start decorators module
Added: trunk/base/src/base/decorators.py
==============================================================================
--- (empty file)
+++ trunk/base/src/base/decorators.py Mon Feb 13 19:41:36 2006
@@ -0,0 +1,23 @@
+import sys
+import logging
+
+log = logging.getLogger()
+
+def save_execution():
+ """
+ """
+ def decorator(func):
+
+ def newfunc(*args, **kwargs):
+ try:
+ func(*args, **kwargs)
+ except (KeyboardInterrupt, SystemExit), e:
+ sys.exit(0)
+ except Exception, e:
+ log.exception('crash:')
+
+ newfunc.func_name = func.func_name
+ return newfunc
+
+ return decorator
+
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog