diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-09-16 04:56:49 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-09-16 04:56:49 +0000 |
| commit | a9fed7675d8da572dee840676714b2653e3f7f79 (patch) | |
| tree | 93327afae95fb9cf6b1d0cb72da265af42a705bd /repoze/bfg/interfaces.py | |
| parent | a37220b84dee4cc8b1b12f34643ce97dad89ffe1 (diff) | |
| download | pyramid-a9fed7675d8da572dee840676714b2653e3f7f79.tar.gz pyramid-a9fed7675d8da572dee840676714b2653e3f7f79.tar.bz2 pyramid-a9fed7675d8da572dee840676714b2653e3f7f79.zip | |
Checkpoint. Not 100% test coverage.
Diffstat (limited to 'repoze/bfg/interfaces.py')
| -rw-r--r-- | repoze/bfg/interfaces.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 827654b1d..928ee6c54 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -74,21 +74,26 @@ class ITraverserFactory(Interface): def __call__(context): """ Return an object that implements ITraverser """ -class ITemplateRenderer(Interface): +class IRenderer(Interface): + def __call__(value): + """ Call a the renderer implementation with the result of the + view (``value``) passed in and return a result (a string or + unicode object useful as a response body)""" + +class IRendererFactory(Interface): + def __call__(name): + """ Return an object that implements ``IRenderer`` """ + +class ITemplateRenderer(IRenderer): 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 ITemplateRendererFactory(Interface): - def __call__(path, auto_reload=False): - """ Return an object that implements ``ITemplateRenderer`` """ +class ITemplateRendererFactory(IRendererFactory): + def __call__(path): + """ Return an object that implements ``ITemplateRenderer`` """ class IViewPermission(Interface): def __call__(context, request): |
