Ticket #130: loader_callback.diff
| File loader_callback.diff, 2.0 KB (added by cmlenz, 16 years ago) |
|---|
-
doc/plugin.txt
190 190 191 191 .. _`Understanding HTML, XML and XHTML`: http://webkit.org/blog/?p=68 192 192 193 ``genshi.loader_callback`` 194 -------------------------- 195 The callback function that should be invoked whenever the template loader loads 196 a new template. Unlike the other options, this option can **not** be passed as 197 a string value, but rather must be a reference to the actual function. That 198 means it can not be loaded from non-Python configuration files. 199 193 200 ``genshi.lookup_errors`` 194 201 ------------------------ 195 202 The error handling style to use in template expressions. Can be either -
genshi/template/plugin.py
58 58 raise ConfigurationError('Invalid value for max_cache_size: "%s"' % 59 59 options.get('genshi.max_cache_size')) 60 60 61 loader_callback = options.get('genshi.loader_callback', None) 62 if loader_callback and not callable(loader_callback): 63 raise ConfigurationError('loader callback must be a function') 64 61 65 lookup_errors = options.get('genshi.lookup_errors', 'lenient') 62 66 if lookup_errors not in ('lenient', 'strict'): 63 67 raise ConfigurationError('Unknown lookup errors mode "%s"' % … … 67 71 auto_reload=auto_reload, 68 72 max_cache_size=max_cache_size, 69 73 default_class=self.template_class, 70 variable_lookup=lookup_errors) 74 variable_lookup=lookup_errors, 75 callback=loader_callback) 71 76 72 77 def load_template(self, templatename, template_string=None): 73 78 """Find a template specified in python 'dot' notation, or load one from
