Changeset 1859 for trunk/python/utils.py


Ignore:
Timestamp:
08/05/10 14:40:38 (14 years ago)
Author:
Malte Marquarding
Message:

Ticket #193: the rcParamsverbose? flag is only used in standard asap cli mode. Otherwise log messages are always send to the logger and one needs to call asaplog.disable()/asaplog.enable() to controls this. I have also added the function name as the log origin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/utils.py

    r1824 r1859  
    6666    files = [os.path.expanduser(os.path.expandvars(path+"/"+f)) for f in os.listdir(path)]
    6767    return filter(lambda x: x.endswith(suffix),files)
     68
     69def page(message):
     70    verbose = False
     71    try:
     72        from asap.parameters import rcParams
     73        verbose = rcParams['verbose']
     74    except:
     75        pass
     76    if verbose:
     77        try:
     78            from IPython.genutils import page as pager
     79        except ImportError:
     80            from pydoc import pager
     81        pager(message)
     82        return None
     83    else:
     84        return message
Note: See TracChangeset for help on using the changeset viewer.