Changeset 2633 for trunk/python
- Timestamp:
- 08/08/12 10:20:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/env.py
r2622 r2633 52 52 os.environ["CASAPATH"] = "%s %s somwhere" % ( asapdata, plf) 53 53 54 # set up user space55 if os.environ["USER"] == 'root':56 return57 try:58 import IPython59 # 0.11+ doesn't use user dir60 if int(IPython.__version__.split(".")[1]) >= 11:61 return62 except:63 # no ipython so we don't need user dir64 return65 userdir = os.environ["HOME"]+"/.asap"66 if not os.path.exists(userdir):67 os.mkdir(userdir)68 print 'First time ASAP use. Setting up ~/.asap'69 # os.makedirs(os.path.join(userdir, "profile_default"))70 if not is_casapy():71 shutil.copyfile(asapdata+"/data/ipy_user_conf.py",72 userdir+"/ipy_user_conf.py")73 # shutil.copyfile(asapdata+"/data/ipython_config.py",74 # userdir+"/profile_default/ipython_config.py")75 f = file(userdir+"/asapuserfuncs.py", "w")76 f.close()77 f = file(userdir+"/ipythonrc", "w")78 f.close()79 else:80 if not is_casapy():81 # upgrade to support later ipython versions82 83 if not os.path.exists(userdir+"/ipy_user_conf.py"):84 shutil.copyfile(asapdata+"/data/ipy_user_conf.py",85 userdir+"/ipy_user_conf.py")86 # if not os.path.exists(userdir+"/profile_default/ipython_config.py"):87 # shutil.copyfile(asapdata+"/data/ipython_config.py",88 # userdir+"/profile_default/ipython_config.py")89 90 91 54 def get_revision(): 92 55 """Get the revision of the software. Only useful within casapy."""
Note:
See TracChangeset
for help on using the changeset viewer.