dabo Commit
Revision 3702
Date: 2007-11-16 04:09:07 -0800 (Fri, 16 Nov 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/3702
Changed:
U trunk/dabo/dBug.py
Log:
Added the mainProgram() function as a quick way to get the first program in the
calling stack.
Diff:
Modified: trunk/dabo/dBug.py
===================================================================
--- trunk/dabo/dBug.py 2007-11-15 23:31:01 UTC (rev 3701)
+++ trunk/dabo/dBug.py 2007-11-16 12:09:07 UTC (rev 3702)
@@ -35,6 +35,11 @@
return s
+def mainProgram():
+ """Returns the name of first program in the call stack"""
+ return inspect.stack()[-1][1]
+
+
def loggit(fnc):
"""Decorator function to create a log of all methods as they are
called. To use
it, modify all your methods from:
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]