source:
issm/oecreview/Archive/23390-24306/ISSM-23754-23755.diff@
24307
Last change on this file since 24307 was 24307, checked in by , 5 years ago | |
---|---|
File size: 1.8 KB |
-
../trunk-jpl/src/m/dev/devpath.py
1 1 #!/usr/bin/env python 2 import os, sys2 import os, sys 3 3 import warnings 4 4 5 5 #Recover ISSM_DIR and USERNAME 6 6 ISSM_DIR = os.getenv('ISSM_DIR') 7 7 USERNAME = os.getenv('USER') 8 JPL_SVN 9 if (ISSM_DIR==None):8 JPL_SVN = os.getenv('JPL_SVN') 9 if ISSM_DIR is None: 10 10 raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!') 11 11 12 12 #Go through src/m and append any directory that contains a *.py file to PATH 13 for root, dirs,files in os.walk(ISSM_DIR+ '/src/m'):13 for root, dirs, files in os.walk(ISSM_DIR + '/src/m'): 14 14 if '.svn' in dirs: 15 15 dirs.remove('.svn') 16 16 for file in files: … … 25 25 sys.path.append(ISSM_DIR + '/lib') 26 26 sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs') 27 27 # If using clusters, we need to have the path to the cluster settings directory 28 if (JPL_SVN!=None):28 if JPL_SVN is not None: 29 29 if os.path.exists(JPL_SVN + '/usr/' + USERNAME): 30 30 sys.path.append(JPL_SVN + '/usr/' + USERNAME) 31 31 else: 32 warnings.warn('cluster settings should be in, '+ JPL_SVN +'/usr/' + USERNAME)32 warnings.warn('cluster settings should be in, {}/usr/{}'.format(JPL_SVN, USERNAME)) 33 33 34 34 #Manual imports for commonly used functions 35 35 from runme import runme #first because plotmodel may fail … … 42 42 #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ') 43 43 44 44 print("\n ISSM development path correctly loaded") 45 print( ("Current path is {}\n\n".format(ISSM_DIR)))45 print("Current path is {}\n\n".format(ISSM_DIR))
Note:
See TracBrowser
for help on using the repository browser.