diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-05-02 00:17:33 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-05-02 00:17:33 +0000 |
commit | 4c30e5188c96528be2bf8d6ac3d0f14ad7fc1870 (patch) | |
tree | f58008c0b1e74cde8daeb466e043f5ab0c9e0583 /lib/mako/template.py | |
parent | 276a880c0d8f6ba14e2e93e80518a419a9998215 (diff) | |
download | external_python_mako-4c30e5188c96528be2bf8d6ac3d0f14ad7fc1870.tar.gz external_python_mako-4c30e5188c96528be2bf8d6ac3d0f14ad7fc1870.tar.bz2 external_python_mako-4c30e5188c96528be2bf8d6ac3d0f14ad7fc1870.zip |
- added the 'encoding_errors' parameter to Template/TemplateLookup
for specifying the error handler associated with encoding to
'output_encoding' [ticket:40]
- the Template returned by html_error_template now defaults to
output_encoding=sys.getdefaultencoding(),
encoding_errors='htmlentityreplace' [ticket:37]
Diffstat (limited to 'lib/mako/template.py')
-rw-r--r-- | lib/mako/template.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mako/template.py b/lib/mako/template.py index 8254105..8350484 100644 --- a/lib/mako/template.py +++ b/lib/mako/template.py @@ -16,7 +16,7 @@ import imp, time, weakref, tempfile, shutil, os, stat, sys, re class Template(object): """a compiled template""" - def __init__(self, text=None, filename=None, uri=None, format_exceptions=False, error_handler=None, lookup=None, output_encoding=None, module_directory=None, cache_type=None, cache_dir=None, cache_url=None, module_filename=None, input_encoding=None, default_filters=['unicode'], buffer_filters=[], imports=None, preprocessor=None): + def __init__(self, text=None, filename=None, uri=None, format_exceptions=False, error_handler=None, lookup=None, output_encoding=None, encoding_errors='strict', module_directory=None, cache_type=None, cache_dir=None, cache_url=None, module_filename=None, input_encoding=None, default_filters=['unicode'], buffer_filters=[], imports=None, preprocessor=None): """construct a new Template instance using either literal template text, or a previously loaded template module text - textual template source, or None if a module is to be provided @@ -91,6 +91,7 @@ class Template(object): self.error_handler = error_handler self.lookup = lookup self.output_encoding = output_encoding + self.encoding_errors = encoding_errors self.cache_type = cache_type self.cache_dir = cache_dir self.cache_url = cache_url @@ -134,6 +135,7 @@ class DefTemplate(Template): self.input_encoding = parent.input_encoding self.imports = parent.imports self.output_encoding = parent.output_encoding + self.encoding_errors = parent.encoding_errors self.format_exceptions = parent.format_exceptions self.error_handler = parent.error_handler self.lookup = parent.lookup |