8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
10 # FOR A PARTICULAR PURPOSE. |
10 # FOR A PARTICULAR PURPOSE. |
11 # |
11 # |
12 |
12 |
|
13 """PyAMS_template package |
|
14 |
|
15 This template is used to assign Chamelon templates to views or layouts. It's essentially an |
|
16 adaptation of "z3c.template" package for use with Pyramid. |
|
17 |
|
18 Templates are registered as adapters for a context and a request, and so can easily be overriden. |
|
19 You can also define view templates and layout templates, or use named adapters if needed. |
|
20 """ |
13 |
21 |
14 from pyramid.i18n import TranslationStringFactory |
22 from pyramid.i18n import TranslationStringFactory |
15 _ = TranslationStringFactory('pyams_template') |
23 _ = TranslationStringFactory('pyams_template') |
16 |
24 |
17 |
25 |
18 def includeme(config): |
26 def includeme(config): |
19 """Pyramid include""" |
27 """Pyramid include""" |
20 |
28 |
21 # define configuration settings |
29 # define configuration settings |
22 from pyams_template import template |
30 from pyams_template import template # pylint: disable=import-outside-toplevel |
23 template.configuration_settings = config.registry.settings |
31 template.CONFIGURATION_SETTINGS = config.registry.settings |
24 |
32 |
25 # load registry components |
33 # load registry components |
26 config.scan() |
34 config.scan() |
27 |
35 |
28 if hasattr(config, 'load_zcml'): |
36 if hasattr(config, 'load_zcml'): |