source: TI12-security/trunk/NDGSecurity/python/Tests/authtest/authtest/config/environment.py @ 7080

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/Tests/authtest/authtest/config/environment.py@7080
Revision 7080, 1.3 KB checked in by pjkersha, 9 years ago (diff)
  • Property svn:keywords set to Id
Line 
1"""Pylons environment configuration"""
2import os
3
4from pylons import config
5
6import authtest.lib.app_globals as app_globals
7import authtest.lib.helpers
8from authtest.config.routing import make_map
9
10def load_environment(global_conf, app_conf):
11    """Configure the Pylons environment via the ``pylons.config``
12    object
13    """
14    # Pylons paths
15    root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
16    paths = dict(root=root,
17                 controllers=os.path.join(root, 'controllers'),
18                 static_files=os.path.join(root, 'public'),
19                 templates=[os.path.join(root, 'templates')])
20
21    # Initialize config with the basic options
22    config.init_app(global_conf, app_conf, package='authtest',
23                    #template_engine='mako',
24                    template_engine='kid', 
25                    paths=paths)
26
27    config['routes.map'] = make_map()
28    config['pylons.g'] = app_globals.Globals()
29    config['pylons.h'] = authtest.lib.helpers
30
31    # Customize templating options via this variable
32    tmpl_options = config['buffet.template_options']
33
34    # CONFIGURATION OPTIONS HERE (note: all config options will override
35    # any Pylons config options)
36#    kidopts = {'kid.assume_encoding':'utf-8', 'kid.encoding':'utf-8'}
37#    config.add_template_engine('kid', 'authtest.templates', kidopts)
38
Note: See TracBrowser for help on using the repository browser.