Skip to content

Commit b5eee20

Browse files
committed
another one of those Py2/Py3 gotchas!
1 parent 54b235e commit b5eee20

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pysces/PyscesModel.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ def __init__(self,File=None,dir=None,loader='file',fString=None,autoload=True):
12961296
- *dir* if specified, the path to the input file otherwise the default PyscesModel directory (defined in the pys_config.ini file) is assumed.
12971297
- *autoload* autoload the model, pre 0.7.1 call mod.doLoad(). (default=True) **new**
12981298
- *loader* the default behaviour is to load PSC file, however, if this argument is set to 'string' an input file can be supplied as the *fString* argument (default='file')
1299-
- *fString* a string containing a PySCeS model file (use with *loader='string'*) the *File* argument now sepcifies the new input file name.
1299+
- *fString* a string containing a PySCeS model file (use with *loader='string'*) the *File* argument now specifies the new input file name.
13001300
13011301
"""
13021302

@@ -1377,37 +1377,37 @@ def LoadFromString(self,File=None,fString=None):
13771377

13781378
#grab model directory
13791379
chkmdir()
1380-
dir = MODEL_DIR
1380+
mdir = MODEL_DIR
13811381

13821382
# check for .psc extension
13831383
File = chkpsc(File)
13841384

1385-
print('Using model directory: ' + dir)
1385+
print('Using model directory: ' + mdir)
13861386

13871387
if not os.path.isdir(os.path.join(MODEL_DIR,"orca")):
13881388
os.mkdir(os.path.join(MODEL_DIR,"orca"))
13891389

1390-
dir = os.path.join(MODEL_DIR,"orca")
1390+
mdir = os.path.join(MODEL_DIR,"orca")
13911391

13921392
# write string to file
13931393
try:
1394-
outFile = file(os.path.join(dir,File),'w')
1394+
outFile = open(os.path.join(mdir, File),'w')
13951395
outFile.write(fString)
13961396
outFile.close()
13971397
print('Using file: ' + File)
13981398

1399-
if os.path.exists(os.path.join(dir,File)):
1400-
print(os.path.join(dir,File) + ' loading .....', end=' ')
1401-
self.ModelDir = dir
1399+
if os.path.exists(os.path.join(mdir, File)):
1400+
print(os.path.join(mdir, File) + ' loading .....', end=' ')
1401+
self.ModelDir = mdir
14021402
self.ModelFile = File
14031403
else:
1404-
print(os.path.join(dir,File) + ' does not exist')
1404+
print(os.path.join(mdir, File) + ' does not exist')
14051405
print('Please set with ModelDir and ModelFile .....', end=' ')
14061406
self.ModelFile = 'None'
1407-
self.ModelDir = dir
1407+
self.ModelDir = mdir
14081408
except Exception as e:
14091409
print(e)
1410-
print(os.path.join(dir,File) + ' does not exist please re-instantiate model .....', end=' ')
1410+
print(os.path.join(mdir, File) + ' does not exist please re-instantiate model .....', end=' ')
14111411
self.__settings__['display_debug'] = 0
14121412
self.ModelOutput = OUTPUT_DIR
14131413

0 commit comments

Comments
 (0)