Changeset 1237
- Timestamp:
- 09/05/06 09:31:15 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/Release2.1.0b/python/scantable.py
r1236 r1237 33 33 if average is None: 34 34 average = rcParams['scantable.autoaverage'] 35 #varlist = vars()35 varlist = vars() 36 36 from asap._asap import stmath 37 37 self._math = stmath() … … 72 72 and isinstance(filename[-1], str): 73 73 self._fill(filename, unit, average) 74 self._add_history("scantable", varlist) 74 75 print_log() 75 76 … … 831 832 832 833 833 def history(self): 834 def history(self, filename=None): 835 """ 836 Print the history. Optionally to a file. 837 """ 834 838 hist = list(self._gethistory()) 835 839 out = "-"*80 … … 848 852 out += "\n %s = %s" % (s[0], s[1]) 849 853 out += "\n"+"-"*80 850 try: 851 from IPython.genutils import page as pager 852 except ImportError: 853 from pydoc import pager 854 pager(out) 854 if filename is not None: 855 if filename is "": 856 filename = 'scantable_history.txt' 857 import os 858 filename = os.path.expandvars(os.path.expanduser(filename)) 859 if not os.path.isdir(filename): 860 data = open(filename, 'w') 861 data.write(out) 862 data.close() 863 else: 864 msg = "Illegal file name '%s'." % (filename) 865 if rcParams['verbose']: 866 print msg 867 else: 868 raise IOError(msg) 869 if rcParams['verbose']: 870 try: 871 from IPython.genutils import page as pager 872 except ImportError: 873 from pydoc import pager 874 pager(out) 875 else: 876 return out 855 877 return 856 857 878 # 858 879 # Maths business … … 1667 1688 self.set_fluxunit(unit) 1668 1689 self.set_freqframe(rcParams['scantable.freqframe']) 1669 #self._add_history("scantable", varlist) 1670 1690
Note:
See TracChangeset
for help on using the changeset viewer.