etwist/server.py
changeset 7619 0d0344fd5231
parent 7570 648bf83945a5
child 7620 bc2d690b97bf
equal deleted inserted replaced
7618:5395007c415c 7619:0d0344fd5231
   172 
   172 
   173 class ConcatFiles(LongTimeExpiringFile):
   173 class ConcatFiles(LongTimeExpiringFile):
   174     def __init__(self, config, paths):
   174     def __init__(self, config, paths):
   175         _, ext = osp.splitext(paths[0])
   175         _, ext = osp.splitext(paths[0])
   176         self._resources = {}
   176         self._resources = {}
   177         # create a unique / predictable filename
   177         # create a unique / predictable filename. We don't consider cubes
       
   178         # version since uicache is cleared at server startup, and file's dates
       
   179         # are checked in debug mode
   178         fname = 'cache_concat_' + hashlib.md5(';'.join(paths)).hexdigest() + ext
   180         fname = 'cache_concat_' + hashlib.md5(';'.join(paths)).hexdigest() + ext
   179         filepath = osp.join(config.appdatahome, 'uicache', fname)
   181         filepath = osp.join(config.appdatahome, 'uicache', fname)
   180         LongTimeExpiringFile.__init__(self, config, filepath)
   182         LongTimeExpiringFile.__init__(self, config, filepath)
   181         self._concat_cached_filepath(filepath, paths)
   183         self._concat_cached_filepath(filepath, paths)
   182 
   184 
   220                     raise ConcatFileNotFoundError(path)
   222                     raise ConcatFileNotFoundError(path)
   221                 path = osp.join(dirpath, rid)
   223                 path = osp.join(dirpath, rid)
   222                 if os.stat(path).st_mtime > concat_lastmod:
   224                 if os.stat(path).st_mtime > concat_lastmod:
   223                     return False
   225                     return False
   224         return True
   226         return True
       
   227 
   225 
   228 
   226 class CubicWebRootResource(resource.Resource):
   229 class CubicWebRootResource(resource.Resource):
   227     def __init__(self, config, vreg=None):
   230     def __init__(self, config, vreg=None):
   228         resource.Resource.__init__(self)
   231         resource.Resource.__init__(self)
   229         self.config = config
   232         self.config = config