Changeset 1080 for trunk/python
- Timestamp:
- 07/25/06 09:34:03 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r1076 r1080 3 3 4 4 """ 5 import os,sys 5 import os,sys,shutil, platform 6 7 # Set up AIPSPATH and first time use of asap i.e. ~/.asap/* 8 plf = None 9 if sys.platform == "linux2": 10 if platform.architecture()[0] == '64bit': 11 plf = 'linux_64b' 12 else: 13 plf = 'linux_gnu' 14 elif sys.platform == 'darwin': 15 plf = 'darwin' 16 else: 17 # Shouldn't happen - default to linux 18 plf = 'linux' 19 asapdata = __path__[-1] 20 os.environ["AIPSPATH"] = "%s %s somwhere" % ( asapdata, plf) 21 userdir = os.environ["HOME"]+"/.asap" 22 if not os.path.exists(userdir): 23 print 'First time ASAP use. Setting up ~/.asap' 24 os.mkdir(userdir) 25 shutil.copyfile(asapdata+"/data/ipythonrc-asap", userdir+"/ipythonrc-asap") 26 f = file(userdir+"/asapuserfuncs.py", "w") 27 f.close() 28 f = file(userdir+"/ipythonrc", "w") 29 f.close() 30 del asapdata, userdir, shutil, platform 6 31 7 32 def _validate_bool(b): … … 165 190 val = val.strip() 166 191 try: cval = converter(val) # try to convert to proper type or raise 167 except Exception, msg:192 except ValueError, msg: 168 193 print ('Bad val "%s" on line #%d\n\t"%s"\n\tin file "%s"\n\t%s' % (val, cnt, line, fname, msg)) 169 194 continue … … 295 320 296 321 from asapmath import * 297 from scantable import *322 from scantable import scantable 298 323 from asaplinefind import * 299 324 #from asapfit import *
Note:
See TracChangeset
for help on using the changeset viewer.