Changeset 791 for branches/Release12


Ignore:
Timestamp:
12/09/05 14:44:10 (18 years ago)
Author:
mar637
Message:

Request: added pager throuput for history and summary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release12/python/scantable.py

    r788 r791  
    226226                    raise IOError(msg)
    227227        if rcParams['verbose']:
    228             print info
     228            try:
     229                from IPython.genutils import page as pager
     230            except ImportError:
     231                from pydoc import pager
     232            pager(info)
    229233        else:
    230234            return info
     
    765769    def history(self):
    766770        hist = list(self._gethistory())
    767         print "-"*80
     771        out = "-"*80
    768772        for h in hist:
    769773            if h.startswith("---"):
    770                 print h
     774                out += "\n"+h
    771775            else:
    772776                items = h.split("##")
     
    774778                func = items[1]
    775779                items = items[2:]
    776                 print date
    777                 print "Function: %s\n  Parameters:" % (func)
     780                out += "\n"+date+"\n"
     781                out += "Function: %s\n  Parameters:" % (func)
    778782                for i in items:
    779783                    s = i.split("=")
    780                     print "   %s = %s" % (s[0],s[1])
    781                 print "-"*80
     784                    out += "\n   %s = %s" % (s[0],s[1])
     785                out += "\n"+"-"*80
     786        try:
     787            from IPython.genutils import page as pager
     788        except ImportError:
     789            from pydoc import pager
     790        pager(out)
    782791        return
    783792
Note: See TracChangeset for help on using the changeset viewer.