source: issm/oecreview/Archive/23390-24306/ISSM-23754-23755.diff@ 24307

Last change on this file since 24307 was 24307, checked in by Mathieu Morlighem, 5 years ago

NEW: adding Archive/23390-24306

File size: 1.8 KB
RevLine 
[24307]1Index: ../trunk-jpl/src/m/dev/devpath.py
2===================================================================
3--- ../trunk-jpl/src/m/dev/devpath.py (revision 23754)
4+++ ../trunk-jpl/src/m/dev/devpath.py (revision 23755)
5@@ -1,16 +1,16 @@
6 #!/usr/bin/env python
7-import os,sys
8+import os, sys
9 import warnings
10
11 #Recover ISSM_DIR and USERNAME
12 ISSM_DIR = os.getenv('ISSM_DIR')
13 USERNAME = os.getenv('USER')
14-JPL_SVN = os.getenv('JPL_SVN')
15-if(ISSM_DIR==None):
16+JPL_SVN = os.getenv('JPL_SVN')
17+if ISSM_DIR is None:
18 raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!')
19
20 #Go through src/m and append any directory that contains a *.py file to PATH
21-for root,dirs,files in os.walk(ISSM_DIR+ '/src/m'):
22+for root, dirs, files in os.walk(ISSM_DIR + '/src/m'):
23 if '.svn' in dirs:
24 dirs.remove('.svn')
25 for file in files:
26@@ -25,11 +25,11 @@
27 sys.path.append(ISSM_DIR + '/lib')
28 sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs')
29 # If using clusters, we need to have the path to the cluster settings directory
30-if(JPL_SVN!=None):
31+if JPL_SVN is not None:
32 if os.path.exists(JPL_SVN + '/usr/' + USERNAME):
33 sys.path.append(JPL_SVN + '/usr/' + USERNAME)
34 else:
35- warnings.warn('cluster settings should be in, '+ JPL_SVN +'/usr/' + USERNAME)
36+ warnings.warn('cluster settings should be in, {}/usr/{}'.format(JPL_SVN, USERNAME))
37
38 #Manual imports for commonly used functions
39 from runme import runme #first because plotmodel may fail
40@@ -42,4 +42,4 @@
41 #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
42
43 print("\n ISSM development path correctly loaded")
44-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.