Changeset 2621 for trunk/python
- Timestamp:
- 08/06/12 12:15:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/env.py
r2499 r2621 53 53 54 54 # set up user space 55 # userdir = os.environ["HOME"]+"/.asap" 56 # if not os.path.exists(userdir): 57 # print 'First time ASAP use. Setting up ~/.asap' 58 # os.makedirs(os.path.join(userdir, "profile_default")) 59 # if not is_casapy(): 60 # shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 61 # userdir+"/ipy_user_conf.py") 62 # shutil.copyfile(asapdata+"/data/ipython_config.py", 63 # userdir+"/profile_default/ipython_config.py") 64 # f = file(userdir+"/asapuserfuncs.py", "w") 65 # f.close() 66 # f = file(userdir+"/ipythonrc", "w") 67 # f.close() 68 # else: 69 # if not is_casapy(): 70 # # upgrade to support later ipython versions 55 if os.environ["USER"] == 'root': 56 return 57 try: 58 import IPython 59 # 0.11+ doesn't use user dir 60 if int(IPython.__version__.split(".")[1]) >= 11: 61 return 62 except: 63 # no ipython so we don't need user dir 64 return 65 userdir = os.environ["HOME"]+"/.asap" 66 if not os.path.exists(userdir): 67 print 'First time ASAP use. Setting up ~/.asap' 68 # os.makedirs(os.path.join(userdir, "profile_default")) 69 if not is_casapy(): 70 shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 71 userdir+"/ipy_user_conf.py") 72 # shutil.copyfile(asapdata+"/data/ipython_config.py", 73 # userdir+"/profile_default/ipython_config.py") 74 f = file(userdir+"/asapuserfuncs.py", "w") 75 f.close() 76 f = file(userdir+"/ipythonrc", "w") 77 f.close() 78 else: 79 if not is_casapy(): 80 # upgrade to support later ipython versions 71 81 72 #if not os.path.exists(userdir+"/ipy_user_conf.py"):73 #shutil.copyfile(asapdata+"/data/ipy_user_conf.py",74 #userdir+"/ipy_user_conf.py")82 if not os.path.exists(userdir+"/ipy_user_conf.py"): 83 shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 84 userdir+"/ipy_user_conf.py") 75 85 # if not os.path.exists(userdir+"/profile_default/ipython_config.py"): 76 86 # shutil.copyfile(asapdata+"/data/ipython_config.py",
Note:
See TracChangeset
for help on using the changeset viewer.