Changeset 15494


Ignore:
Timestamp:
07/15/13 16:42:54 (12 years ago)
Author:
cborstad
Message:

CHG: python models are saved as database structures, checking for their existence should be done with database methods rather than looking for path existence since databases often use multiple files with the same name but differenct extensions

Location:
issm/trunk-jpl/src/m/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/io/loadmodel.py

    r13947 r15494  
    11import os.path
    22from loadvars import *
     3from whichdb import whichdb
    34
    45def loadmodel(path):
     
    1213        """
    1314
    14         #check existence
    15         if os.path.exists(path):
     15        #check existence of database (independent of file extension!)
     16        if whichdb(path):
    1617                #do nothing
    1718                pass
  • issm/trunk-jpl/src/m/io/loadvars.py

    r13950 r15494  
    11import shelve
    22import os.path
     3from whichdb import whichdb
    34
    45def loadvars(*args):
     
    4849                raise TypeError("Unrecognized input arguments.")
    4950
    50         if os.path.exists(filename):
     51        if whichdb(filename):
    5152                print "Loading variables from file '%s'." % filename
    5253        else:
Note: See TracChangeset for help on using the changeset viewer.