Ignore:
Timestamp:
11/12/08 14:48:42 (11 years ago)
Author:
cbyrom
Message:

Create new config file - to specify the help text for the MILK app.
Add code to milkMiddleware to read in all data from this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/config/milkMiddleware.py

    r4594 r4599  
    55from ndgUtils.models.myconfig import myConfig 
    66from ndgUtils.lib.atomvalidator import AtomValidator 
     7import milk_server.lib.helpers as h 
    78 
    89class NDGConfigError(Exception):   
     
    147148        self.config=cf 
    148149         
     150        self.__setUpHelpText(g) 
     151 
     152 
     153    def __setUpHelpText(self, g): 
     154         
     155        cf = CONFIG['app_conf']['helpConfigfile'] 
     156        cf = myConfig(cf) 
     157        # NB, the cf.config class lowercases everything. 
     158        for (section, val) in cf.config.items('ATOM_EDITOR'): 
     159            setattr(g, section, val) 
     160             
     161        # extend the granulite example link - to add a valid location 
     162        g.example_granulite = g.example_granulite.replace('HREF', \ 
     163            h.url_for(controller = 'atom_editor/listatom', \ 
     164                      action='showExampleGranulite')) 
     165         
    149166         
    150167    def __call__(self,environ,start_response): 
Note: See TracChangeset for help on using the changeset viewer.