Last change
on this file since 19895 was 19895, checked in by bdef, 9 years ago |
NEW:Adding directory to hold the python 3 implementation of the interface
|
File size:
546 bytes
|
Line | |
---|
1 | import os
|
---|
2 | import MatlabFuncs as m
|
---|
3 |
|
---|
4 | def issmdir():
|
---|
5 | """
|
---|
6 | ISSMDIR - Get ISSM_DIR environment variable
|
---|
7 |
|
---|
8 | Usage:
|
---|
9 | ISSM_DIR=issmdir()
|
---|
10 | """
|
---|
11 |
|
---|
12 | if not m.ispc():
|
---|
13 | ISSM_DIR =os.environ['ISSM_DIR']
|
---|
14 | else:
|
---|
15 | ISSM_DIR =os.environ['ISSM_DIR_WIN']
|
---|
16 | if m.strcmpi(ISSM_DIR[-1],'/') or m.strcmpi(ISSM_DIR[-1],'\\'):
|
---|
17 | ISSM_DIR = ISSM_DIR[:-1] #shave off the last '/'
|
---|
18 |
|
---|
19 | if not ISSM_DIR:
|
---|
20 | raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
|
---|
21 |
|
---|
22 | return ISSM_DIR
|
---|
23 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.