diff options
Diffstat (limited to 'repoze/bfg/interfaces.py')
| -rw-r--r-- | repoze/bfg/interfaces.py | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index bbff9bca7..71ef619c2 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -1,5 +1,6 @@ from zope.interface import Interface from zope.interface import Attribute +from zope.deprecation import deprecated from zope.component.interfaces import IObjectEvent @@ -26,20 +27,47 @@ class ITraverser(Interface): class ITraverserFactory(Interface): def __call__(context): - """ Return an object that implements IPublishTraverser """ + """ Return an object that implements ITraverser """ -class ITemplateFactory(Interface): - def __call__(path, auto_reload=False): - """ Return an an ITemplate given a filesystem path """ +class ITemplateRenderer(Interface): + def implementation(): + """ Return the object that the underlying templating system + uses to render the template; it is typically a callable that + accepts arbitrary keyword arguments and returns a string or + unicode object """ + + def __call__(**kw): + """ Call a the template implementation with the keywords + passed in as arguments and return the result (a string or + unicode object) """ -class ITemplate(Interface): +class ITestingTemplateRenderer(Interface): def __call__(**kw): - """ Return a string result given a template path """ + """ Accept keywords and process for test comparison purposes + (usually set all keywords as attributes of self); return value + is a string """ -class INodeTemplate(Interface): +class ITemplateRendererFactory(Interface): + def __call__(path, auto_reload=False): + """ Return an object that implements ``ITemplateRenderer`` """ + +class INodeTemplateRenderer(Interface): def __call__(node, **kw): - """ Return a string result given a template path """ - + """ Return a string result given a node and a template path """ + +ITemplate = ITemplateRenderer +deprecated('ITemplate', + ('repoze.bfg.interfaces.ITemplate should now be imported ' + 'as repoze.bfg.interfaces.ITemplateRenderer')) +INodeTemplate = INodeTemplateRenderer +deprecated('INodeTemplate', + ('repoze.bfg.interfaces.INodeTemplate should now be imported ' + 'as repoze.bfg.interfaces.INodeTemplateRenderer')) +ITemplateFactory = ITemplateRendererFactory +deprecated('ITemplateFactory', + ('repoze.bfg.interfaces.ITemplateFactory should now be imported ' + 'as repoze.bfg.interfaces.ITemplateRendererFactory')) + class ISecurityPolicy(Interface): """ A utility that provides a mechanism to check authorization using authentication data """ |
