From 0e21c22166f5160a2a64fad714d69d81897ef7d3 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 17 Aug 2008 17:32:54 +0000 Subject: - Add ```` directive. This directive currently allows only one attribute: ``reload_templates``. If e.g.:: is in your application's ZCML, you will not need to restart the appserver in order for ``z3c.pt`` or XSLT template changes to be detected and displayed. --- repoze/bfg/interfaces.py | 7 ++++++- repoze/bfg/meta.zcml | 6 ++++++ repoze/bfg/sampleapp/configure.zcml | 3 +++ repoze/bfg/template.py | 33 +++++++++++++++++++++------------ repoze/bfg/tests/test_zcml.py | 31 +++++++++++++++++++++++++++++++ repoze/bfg/zcml.py | 27 +++++++++++++++++++++++++++ 6 files changed, 94 insertions(+), 13 deletions(-) (limited to 'repoze') diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 4f1a203df..3a4c45373 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -27,7 +27,7 @@ class ITraverserFactory(Interface): """ Return an object that implements IPublishTraverser """ class ITemplateFactory(Interface): - def __call__(path): + def __call__(path, auto_reload=False): """ Return an an ITemplate given a filesystem path """ class ITemplate(Interface): @@ -79,3 +79,8 @@ class INewResponse(Interface): """ An event type that is emitted whenever any repoze.bfg view returns a response.""" response = Attribute('The response object') + +class ISettings(Interface): + """ Runtime settings for repoze.bfg """ + reload_templates = Attribute('Reload templates when they change') + diff --git a/repoze/bfg/meta.zcml b/repoze/bfg/meta.zcml index 72e963ae6..91b4f40e8 100644 --- a/repoze/bfg/meta.zcml +++ b/repoze/bfg/meta.zcml @@ -10,6 +10,12 @@ handler=".zcml.view" /> + + diff --git a/repoze/bfg/sampleapp/configure.zcml b/repoze/bfg/sampleapp/configure.zcml index a5f27595e..d20d7d8f9 100644 --- a/repoze/bfg/sampleapp/configure.zcml +++ b/repoze/bfg/sampleapp/configure.zcml @@ -4,6 +4,9 @@ + +