Changeset 16109
- Timestamp:
- 09/08/13 20:08:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/organizer.py
r16100 r16109 6 6 from savevars import * 7 7 from model import model 8 from whichdb import whichdb 8 9 9 10 class organizer(object): … … 28 29 self.repository ='./' 29 30 self.prefix ='model.' 30 self.extension ='' #default extension of python to save models.31 31 self.trunkprefix ='' 32 32 self.steps =[] … … 55 55 self.requestedsteps=options.getfieldvalue('steps',[0]) 56 56 57 #Get extension58 self.extension=options.getfieldvalue('extension','')59 60 57 #Get trunk prefix (only if provided by user) 61 58 if options.exist('trunkprefix'): … … 72 69 s+="%s\n" % " Repository: '%s'" % self.repository 73 70 s+="%s\n" % " Prefix: '%s'" % self.prefix 74 s+="%s\n" % " Extension: '%s'" % self.extension75 71 if not self.steps: 76 72 s+="%s\n" % " no step" … … 101 97 if not isinstance(string,(str,unicode)): 102 98 raise TypeError("argument provided is not a string") 103 path=os.path.join(self.repository,self.prefix+'.step#'+string+'.python' +self.extension)99 path=os.path.join(self.repository,self.prefix+'.step#'+string+'.python') 104 100 105 101 #figure out if the model is there, otherwise, we have to use the default path supplied by user. 106 if os.path.exists(path):102 if whichdb(path): 107 103 md=loadmodel(path) 108 104 return md … … 110 106 #If we are here, the model has not been found. Try trunk prefix if provided 111 107 if self.trunkprefix: 112 path2=os.path.join(self.repository,self.trunkprefix+string +self.extension)108 path2=os.path.join(self.repository,self.trunkprefix+string) 113 109 if not os.path.exists(path2): 114 110 raise IOError("Could find neither '%s' nor '%s'" % (path,path2))
Note:
See TracChangeset
for help on using the changeset viewer.