Le 06/01/2011 09:37, Chris McDonough a écrit :
On Thu, 2011-01-06 at 09:30 +0100, Stéphane Klein wrote:
Hi,
I wonder if I can load imperative python configuration instruction from
<include package="…" /> in ZCML file ?
No, sorry. Use config.include(somefunc) instead.
Ok, thanks.
I would like to have your suggestion about this problem :
* I have a main application based on Pyramid
In "configure.zcml" of this application I have :
::
<include package="mypackage"/>
* In "mypackage" initialisation I would like do :
::
reload_templates = config.settings.get('reload_templates', False)
directories = config.settings.get('jinja2.directories')
...
environment = Environment(loader=loader,
auto_reload=reload_templates,
autoescape=autoescape,
extensions=extensions)
config.registry.registerUtility(environment, IJinja2Environment)
I can't do that if I use zcml to initialize "mypackage". I need to say
to my "mypackage" users to do something like :
::
config.include('mypackage.initialise')
This question is in relation with
https://github.com/Pylons/pyramid_jinja2/issues/issue/13
Thanks for your help.
Regards,
Stephane
--
Stéphane Klein <[email protected]>
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
pro: http://www.is-webdesign.com
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.