Changeset 715 for trunk/python


Ignore:
Timestamp:
11/17/05 14:33:14 (19 years ago)
Author:
mar637
Message:

updated logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/__init__.py

    r710 r715  
    226226    return False
    227227
    228 from asap._asap import LogSink as _asaplog
    229 # use null sink if verbose==False
    230 #asaplog=_asaplog(rcParams['verbose'])
     228
     229# workaround for ipython, which redirects this if banner=0 in ipythonrc
     230sys.stdout = sys.__stdout__
     231sys.stderr = sys.__stderr__
     232
     233# Logging
     234from asap._asap import Log as _asaplog
     235global asaplog
    231236asaplog=_asaplog()
    232 global asaplog
     237if rcParams['verbose']:
     238    asaplog.enable()
     239else:
     240    asaplog.disable()
     241
     242def print_log():
     243    log = asaplog.pop()
     244    if len(log) and rcParams['verbose']: print log
     245    return
     246
    233247from asapfitter import *
    234248from asapreader import reader
    235249
    236250from asapmath import *
    237 from asap._asap import _math_setlog
    238 _math_setlog(asaplog)
    239 
    240251from scantable import *
    241252from asaplinefind import *
     
    248259if rcParams['useplotter']:
    249260    from  asapplotter import *
    250     if rcParams['verbose']:
    251         print "Initialising GUI asapplotter with the name 'plotter' ..."
    252261    gui = os.environ.has_key('DISPLAY') and rcParams['plotter.gui']
    253262    plotter = asapplotter(gui)
     263    del gui
    254264
    255265__date__ = '$Date$'.split()[1]
     
    264274        print filter(lambda x: not x.startswith('_'), sts)
    265275        return
    266 else:
    267     pass
    268 
    269 def commands():
    270     x = """
     276
     277    def commands():
     278        x = """
    271279    [The scan container]
    272280        scantable           - a container for integrations/scans
     
    403411            ASAP> help average_time
    404412
    405     """
    406     print x
    407     return
     413            """
     414        print x
     415        return
    408416
    409417def welcome():
Note: See TracChangeset for help on using the changeset viewer.