##// END OF EJS Templates
core: cleanup settings cleanups on pyramid app.
marcink -
r2316:41ee882b default
parent child Browse files
Show More
@@ -137,21 +137,12 b' def make_pyramid_app(global_config, **se'
137 137 cases when these fragments are assembled from another place.
138 138
139 139 """
140 # The edition string should be available in pylons too, so we add it here
141 # before copying the settings.
142 settings.setdefault('rhodecode.edition', 'Community Edition')
143
144 # As long as our Pylons application does expect "unprepared" settings, make
145 # sure that we keep an unmodified copy. This avoids unintentional change of
146 # behavior in the old application.
147 settings_pylons = settings.copy()
148
149 140 sanitize_settings_and_apply_defaults(settings)
150 141
151 142 config = Configurator(settings=settings)
152 143 load_pyramid_environment(global_config, settings)
153 144
154 add_pylons_compat_data(config.registry, global_config, settings_pylons)
145 add_pylons_compat_data(config.registry, global_config, settings.copy())
155 146
156 147 includeme_first(config)
157 148 includeme(config)
@@ -284,11 +275,6 b' def includeme(config):'
284 275 if asbool(settings.get('appenlight', 'false')):
285 276 config.include('appenlight_client.ext.pyramid_tween')
286 277
287 if 'mako.default_filters' not in settings:
288 # set custom default filters if we don't have it defined
289 settings['mako.imports'] = 'from rhodecode.lib.base import h_filter'
290 settings['mako.default_filters'] = 'h_filter'
291
292 278 # Includes which are required. The application would fail without them.
293 279 config.include('pyramid_mako')
294 280 config.include('pyramid_beaker')
@@ -452,11 +438,16 b' def sanitize_settings_and_apply_defaults'
452 438 function.
453 439 """
454 440
455 # Pyramid's mako renderer has to search in the templates folder so that the
456 # old templates still work. Ported and new templates are expected to use
457 # real asset specifications for the includes.
441 settings.setdefault('rhodecode.edition', 'Community Edition')
442
443 if 'mako.default_filters' not in settings:
444 # set custom default filters if we don't have it defined
445 settings['mako.imports'] = 'from rhodecode.lib.base import h_filter'
446 settings['mako.default_filters'] = 'h_filter'
447
448 if 'mako.directories' not in settings:
458 449 mako_directories = settings.setdefault('mako.directories', [
459 # Base templates of the original Pylons application
450 # Base templates of the original application
460 451 'rhodecode:templates',
461 452 ])
462 453 log.debug(
General Comments 0
You need to be logged in to leave comments. Login now