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
  • ../trunk-jpl/src/m/dev/devpath.py

     
    11#!/usr/bin/env python
    2 import os,sys
     2import os, sys
    33import warnings
    44
    55#Recover ISSM_DIR and USERNAME
    66ISSM_DIR = os.getenv('ISSM_DIR')
    77USERNAME = os.getenv('USER')
    8 JPL_SVN  = os.getenv('JPL_SVN')
    9 if(ISSM_DIR==None):
     8JPL_SVN = os.getenv('JPL_SVN')
     9if ISSM_DIR is None:
    1010    raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!')
    1111
    1212#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'):
     13for root, dirs, files in os.walk(ISSM_DIR + '/src/m'):
    1414    if '.svn' in dirs:
    1515        dirs.remove('.svn')
    1616        for file in files:
     
    2525sys.path.append(ISSM_DIR + '/lib')
    2626sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs')
    2727# If using clusters, we need to have the path to the cluster settings directory
    28 if(JPL_SVN!=None):
     28if JPL_SVN is not None:
    2929    if os.path.exists(JPL_SVN + '/usr/' + USERNAME):
    3030        sys.path.append(JPL_SVN + '/usr/' + USERNAME)
    3131    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))
    3333
    3434#Manual imports for commonly used functions
    3535from runme import runme         #first because plotmodel may fail
     
    4242#c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
    4343
    4444print("\n  ISSM development path correctly loaded")
    45 print(("Current path is {}\n\n".format(ISSM_DIR)))
     45print("Current path is {}\n\n".format(ISSM_DIR))
Note: See TracBrowser for help on using the repository browser.