Ignore:
Timestamp:
23/09/09 09:34:19 (11 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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         
Note: See TracChangeset for help on using the changeset viewer.