Changeset 5755 for cows


Ignore:
Timestamp:
23/09/09 09:34:19 (10 years ago)
Author:
pnorton
Message:

Modified the browser sniffing code so that it dosen't trigger for IE 8. Also made some changes to the slab option parsers.

Location:
cows/trunk/cows
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/wms_controller.py

    r5718 r5755  
    371371            finalImg = Image.composite(finalImg, img, finalImg)     
    372372 
    373         # IE < 7 doesn't display the alpha layer right.  Here we sniff the 
     373        # IE 6.0 doesn't display the alpha layer right.  Here we sniff the 
    374374        # user agent and remove the alpha layer if necessary. 
    375375        try: 
    376376            ua = request.headers['User-Agent'] 
     377            log.debug("ua = %s" % (ua,)) 
    377378        except: 
    378379            pass 
    379380        else: 
    380             if 'MSIE' in ua and 'MSIE 7' not in ua: 
     381            if 'MSIE 6.0' in ua: 
    381382                finalImg = finalImg.convert('RGB') 
    382383 
  • cows/trunk/cows/service/imps/data_reader_geoplot_backend/data_reader_geoplot_layer_mapper.py

    r5692 r5755  
    2222    def __init__(self): 
    2323        self.layermapcache={} 
    24         self.readerClasses = [CSMLDataReader, ModisFileReader] 
     24        self.readerClasses = [CSMLDataReader]#, ModisFileReader] 
    2525    
    2626    def map(self, **kwargs): 
  • cows/trunk/cows/service/imps/data_reader_geoplot_backend/slab_options_json_generator.py

    r5692 r5755  
    66class SlabJSONGenerator(object): 
    77     
    8     def __init__(self, slabClasses): 
     8    def __init__(self, styleOptionsMap): 
    99                 
    10         #create a list of names for each of the styles (each slabClass has its onw style) 
    11         styleOptionNames = {} 
    12         for klass in slabClasses: 
    13             styleOptionNames[klass.style] = [x.name for x in klass.renderingOptions] 
    14          
    1510        self.commonOptions = [] 
    1611        self.styleOptions = {} 
    1712         
    18         #create an empty list to hold each styles specific options 
    19         for style in styleOptionNames.keys(): 
     13        #for each of the styles mentioned 
     14        for style in styleOptionsMap.keys(): 
     15             
     16            #create an empty list to hold each styles specific options 
    2017            self.styleOptions[style] = [] 
    21          
    22         #for each option in each class 
    23         for klass in slabClasses: 
    24             for option in klass.renderingOptions: 
     18             
     19            #for each of the options in this style 
     20            for option in styleOptionsMap[style]: 
    2521                 
    2622                #check if this option appears in all the others  
    2723                isCommon = True 
    28                 for styleNames in styleOptionNames.values(): 
     24                for styleNames in styleOptionsMap.values(): 
    2925                    if option.name not in styleNames: 
    3026                        isCommon = False 
     
    3531                        self.commonOptions.append(option) 
    3632                else: 
    37                     self.styleOptions[klass.style].append(option) 
     33                    self.styleOptions[style].append(option) 
    3834             
    3935         
  • cows/trunk/cows/service/imps/data_reader_geoplot_backend/slab_options_parser.py

    r5697 r5755  
    1515            self._slabOptionsLookup[option.name.lower()] = option 
    1616         
    17         self._renderOptions = renderOptions 
     17         
     18         
     19        self._renderOptions = {} 
     20        for k, v in renderOptions.items(): 
     21            self._renderOptions[k.lower()] = v 
    1822         
    1923    def getOption(self, optionName): 
Note: See TracChangeset for help on using the changeset viewer.