From: <sv...@ww...> - 2004-06-05 20:48:40
|
Author: mkrose Date: 2004-06-05 13:48:34 -0700 (Sat, 05 Jun 2004) New Revision: 993 Modified: trunk/CSP/base/app.py trunk/CSP/tools/bootstrap.py Log: Minor cleanup of app and bootstrap Modified: trunk/CSP/base/app.py =================================================================== --- trunk/CSP/base/app.py 2004-06-05 20:45:58 UTC (rev 992) +++ trunk/CSP/base/app.py 2004-06-05 20:48:34 UTC (rev 993) @@ -99,12 +99,18 @@ Start the application. Parses arguments, sets up logging, and calls main(args). + + Args: + disable_interspersed_args: if true, command line flags must preceed + positional arguments. otherwise, command line flags can be mixed + with positional arguments. """ if disable_interspersed_args: opt.disable_interspersed_args() result = 0 try: - frame = inspect.stack()[-1][0] + stack = inspect.stack() + frame = stack[1][0] name = frame.f_globals.get('__name__', '') if name == '__main__': doc = frame.f_globals.get('__doc__', None) Modified: trunk/CSP/tools/bootstrap.py =================================================================== --- trunk/CSP/tools/bootstrap.py 2004-06-05 20:45:58 UTC (rev 992) +++ trunk/CSP/tools/bootstrap.py 2004-06-05 20:48:34 UTC (rev 993) @@ -1,17 +1,15 @@ import sys import os.path -if not getattr(sys, 'CSP', 0): - +try: + import CSP +except: dn = os.path.dirname root = dn(dn(dn(__file__))) sys.path.insert(0, root) - try: import CSP except: print 'Unable to import the main CSP module. Check that you have' print 'a complete working copy.' sys.exit(1) - - sys.CSP = root |