Changeset 2621
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/asap
r2499 r2621 2 2 import os 3 3 4 def main(): 4 def main10(): 5 from IPython.Shell import IPShellEmbed 6 7 banner = "HELLO" 8 exit_msg = "bye" 9 10 ipshell = IPShellEmbed(sys.argv[1:],banner,exit_msg) 11 return ipshell 12 13 14 def main11(): 5 15 from IPython.config.loader import Config 6 16 cfg = Config() … … 19 29 banner1 = welcome(), 20 30 exit_msg = '') 21 ipshell()31 return ipshell 22 32 23 33 try: … … 25 35 import IPython 26 36 from asap import * 27 main() 37 vers = int(IPython.__version__.split(".")[1]) 38 if vers >= 11: 39 ipshell = main11() 40 else: 41 ipshell = main10() 42 28 43 except ImportError: 29 print "No ipython found. Running standard python" 44 banner = "No ipython found. Running standard python" 45 import code 30 46 from asap import * 47 del main 48 code.interact(banner, local=locals()) -
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", -
trunk/setup.py
r2525 r2621 17 17 scripts = ["bin/asap", "bin/asap_update_data",], 18 18 license = 'GPL', 19 install_requires = ["ipython>=0.1 1", "matplotlib>=0.99", "numpy>=1.3"],19 install_requires = ["ipython>=0.10", "matplotlib>=0.99", "numpy>=1.3"], 20 20 # setup_requires = [ "scons>=1.0" ], 21 21 )
Note:
See TracChangeset
for help on using the changeset viewer.