Ignore:
Timestamp:
07/02/09 12:17:20 (15 years ago)
Author:
Malte Marquarding
Message:

Introduced print_log_dec(orator)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/__init__.py

    r1588 r1589  
    44"""
    55import os,sys,shutil, platform
     6import functools
    67
    78# Set up AIPSPATH and first time use of asap i.e. ~/.asap/*
     
    351352    asaplog.disable()
    352353
     354
     355def print_log_dec(f):
     356    @functools.wraps(f)
     357    def wrap_it(*args, **kw):
     358        val = f(*args, **kw)
     359        print_log()
     360        return val
     361    return wrap_it
     362
    353363def print_log():
    354     log = asaplog.pop()
     364    log = asaplog.pop().strip()
    355365    if len(log) and rcParams['verbose']: print log
    356366    return
     
    395405def is_ipython():
    396406    return '__IP' in dir(sys.modules["__main__"])
    397    
     407
    398408if is_ipython():
    399409    def version(): print  "ASAP %s(%s)"% (__version__, __date__)
Note: See TracChangeset for help on using the changeset viewer.