##// 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 cases when these fragments are assembled from another place.
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 sanitize_settings_and_apply_defaults(settings)
140 sanitize_settings_and_apply_defaults(settings)
150
141
151 config = Configurator(settings=settings)
142 config = Configurator(settings=settings)
152 load_pyramid_environment(global_config, settings)
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 includeme_first(config)
147 includeme_first(config)
157 includeme(config)
148 includeme(config)
@@ -284,11 +275,6 b' def includeme(config):'
284 if asbool(settings.get('appenlight', 'false')):
275 if asbool(settings.get('appenlight', 'false')):
285 config.include('appenlight_client.ext.pyramid_tween')
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 # Includes which are required. The application would fail without them.
278 # Includes which are required. The application would fail without them.
293 config.include('pyramid_mako')
279 config.include('pyramid_mako')
294 config.include('pyramid_beaker')
280 config.include('pyramid_beaker')
@@ -452,16 +438,21 b' def sanitize_settings_and_apply_defaults'
452 function.
438 function.
453 """
439 """
454
440
455 # Pyramid's mako renderer has to search in the templates folder so that the
441 settings.setdefault('rhodecode.edition', 'Community Edition')
456 # old templates still work. Ported and new templates are expected to use
442
457 # real asset specifications for the includes.
443 if 'mako.default_filters' not in settings:
458 mako_directories = settings.setdefault('mako.directories', [
444 # set custom default filters if we don't have it defined
459 # Base templates of the original Pylons application
445 settings['mako.imports'] = 'from rhodecode.lib.base import h_filter'
460 'rhodecode:templates',
446 settings['mako.default_filters'] = 'h_filter'
461 ])
447
462 log.debug(
448 if 'mako.directories' not in settings:
463 "Using the following Mako template directories: %s",
449 mako_directories = settings.setdefault('mako.directories', [
464 mako_directories)
450 # Base templates of the original application
451 'rhodecode:templates',
452 ])
453 log.debug(
454 "Using the following Mako template directories: %s",
455 mako_directories)
465
456
466 # Default includes, possible to change as a user
457 # Default includes, possible to change as a user
467 pyramid_includes = settings.setdefault('pyramid.includes', [
458 pyramid_includes = settings.setdefault('pyramid.includes', [
General Comments 0
You need to be logged in to leave comments. Login now