Ignore:
Timestamp:
May 3, 2007, 6:23:44 PM (18 years ago)
Author:
ole
Message:

Added points datafile as a caching dependency.
Also implemented that caching now throws an error if dependency file has been removed after caching has taken place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/caching/caching.py

    r4333 r4425  
    282282  # Force singletons into a tuple.
    283283  #
     284
    284285  if dependencies and type(dependencies) != types.TupleType \
    285286                  and type(dependencies) != types.ListType:
     
    817818  (argsfile,compressed1) = myopen(CD+FN+'_'+file_types[1],"rb",compression)
    818819  (admfile,compressed2) =  myopen(CD+FN+'_'+file_types[2],"rb",compression)
     820
     821  if verbose is True and deps is not None:
     822    print 'Caching: Dependencies are', deps.keys()
    819823
    820824  if not (argsfile and datafile and admfile) or \
     
    15041508  import types
    15051509
     1510  #print 'Caching DEBUG: Dependencies are', dependencies
    15061511  d = {}
    15071512  if dependencies:
     
    15121517    for FN in dependencies:
    15131518      expanded_FN = glob.glob(FN)
    1514      
     1519
     1520      if expanded_FN == []:
     1521        errmsg = 'ERROR (caching.py): Dependency '+FN+' does not exist.'
     1522        raise Exception, errmsg     
     1523
    15151524      expanded_dependencies += expanded_FN
    15161525
     
    15191528      if not type(FN) == types.StringType:
    15201529        errmsg = 'ERROR (caching.py): Dependency must be a string.\n'
    1521         errmsg += '                    Dependency given: %s' %FN
     1530        errmsg += '                   Dependency given: %s' %FN
    15221531        raise Exception, errmsg     
    15231532      if not os.access(FN,os.F_OK):
Note: See TracChangeset for help on using the changeset viewer.