Ignore:
Timestamp:
20/11/08 15:36:44 (12 years ago)
Author:
cbyrom
Message:

Strip out code not relevant to MILK - mainly WCS and WMS stuff - also including the CSML server code + trackback code
Also tidy up structure of 'public' dir - setting up new 'style' dir and
centralising icons in icons dir + remove all unused icons, javascript and stylesheets.
Also strip out testcase code and populate new test directory structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/lib/csml_cache.py

    r2631 r4469  
    1212 
    1313from cache import Cache 
    14 import os, tempfile 
    15 import cdms 
    16 from ows_server.lib.csml_util import get_csml_doc 
    17  
    18 import logging 
    19 logger = logging.getLogger('csml_cache') 
     14import os, tempfile, logging 
     15try: 
     16    import cdms2 as cdms 
     17except: 
     18    import cdms 
    2019 
    2120class CDMSEntry(object): 
     
    3332     
    3433    def __init__(self, filename, varname): 
    35         logger.info('Caching file variable %s in %s' % (varname, filename)) 
     34        logging.info('Caching file variable %s in %s' % (varname, filename)) 
    3635        self._f = cdms.open(filename) 
    3736        self.var = self._f[varname] 
    3837    def __del__(self): 
    3938        filename = self._f.id 
    40         logger.info('Removing file %s' % filename) 
     39        logging.info('Removing file %s' % filename) 
    4140        self._f.close() 
    4241        os.remove(filename) 
     
    8483        """ 
    8584        return super(CSMLExtractCache, self).__getitem__(name).var 
    86  
    87  
    88 class CSMLDocumentCache(Cache): 
    89     """ 
    90     There is considerable overhead for parsing CSML documents. 
    91     This cache stores the csml.parser.Dataset objects in memory. 
    92  
    93     """ 
    94     def build(self, key, name, opened, entry): 
    95         return get_csml_doc(name) 
    96  
    97 #--------------------------------------------------------------------------- 
    98  
    99 from pylons import request 
    100 extractCache = CSMLExtractCache(request.environ['paste.config']['app_conf']['tmp_dir'], max_size=3) 
    101 csmlCache = CSMLDocumentCache(max_size=5) 
Note: See TracChangeset for help on using the changeset viewer.