Changeset 5384

Show
Ignore:
Timestamp:
09/10/08 22:34:11 (4 months ago)
Author:
lmacken
Message:

Add an auto_reload_templates configuration option to our AppConfig?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tg/configuration.py

    r5371 r5384  
    113113        self.serve_static = True 
    114114        self.use_legacy_renderer = True 
    115  
     115        self.auto_reload_templates = True 
    116116 
    117117    def setup_paths(self): 
     
    183183            input_encoding='utf-8', output_encoding='utf-8', 
    184184            imports=['from webhelpers.html import escape'], 
    185             default_filters=['escape']) 
     185            default_filters=['escape'], 
     186            filesystem_checks=self.auto_reload_templates) 
    186187 
    187188        self.render_functions.mako = render_mako 
     
    196197            genshi.template.filters.insert(0, Translator(ugettext)) 
    197198        loader = TemplateLoader(search_path=self.paths.templates, 
    198                                 auto_reload=True
     199                                auto_reload=self.auto_reload_templates
    199200 
    200201        config['pylons.app_globals'].genshi_loader = loader 
     
    208209 
    209210        config['pylons.app_globals'].jinja_env = Environment(loader=ChoiceLoader( 
    210                 [FileSystemLoader(path) for path in self.paths['templates']])) 
     211                [FileSystemLoader(path, auto_reload=self.auto_reload_templates) 
     212                 for path in self.paths['templates']])) 
    211213        # Jinja's unable to request c's attributes without strict_c 
    212214        config['pylons.strict_c'] = True