Mercurial > genshi > mirror
comparison markup/plugin.py @ 29:ab8703fa68b8 trunk
* Minor simplification of template directives: they no longer get passed the template instance and the position, as no directive was actually using
that information.
* More docstrings.
author | cmlenz |
---|---|
date | Wed, 28 Jun 2006 10:40:39 +0000 |
parents | b4f78c05e5c9 |
children | 59eb24184e9c |
comparison
equal
deleted
inserted
replaced
28:35956040ba6e | 29:ab8703fa68b8 |
---|---|
10 # | 10 # |
11 # This software consists of voluntary contributions made by many | 11 # This software consists of voluntary contributions made by many |
12 # individuals. For the exact contribution history, see the revision | 12 # individuals. For the exact contribution history, see the revision |
13 # history and logs, available at http://markup.cmlenz.net/log/. | 13 # history and logs, available at http://markup.cmlenz.net/log/. |
14 | 14 |
15 """Basic support for the template engine plugin API used by TurboGears and | |
16 CherryPy/Buffet. | |
17 """ | |
18 | |
15 import os | 19 import os |
16 from pkg_resources import resource_filename | 20 from pkg_resources import resource_filename |
17 | 21 |
18 from markup.template import Context, Template, TemplateLoader | 22 from markup.template import Context, Template, TemplateLoader |
19 | 23 |
20 | 24 |
21 class TemplateEnginePlugin(object): | 25 class TemplateEnginePlugin(object): |
26 """Implementation of the plugin API.""" | |
22 | 27 |
23 def __init__(self, extra_vars_func=None, options=None): | 28 def __init__(self, extra_vars_func=None, options=None): |
24 if options is None: | 29 if options is None: |
25 options = {} | 30 options = {} |
26 # TODO get loader_args from the options dict | 31 # TODO get loader_args from the options dict |