aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mako/template.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-06-16 13:35:27 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-06-16 13:35:27 +0000
commit895be87b671e77bb1c08bd7297ad91dd730430ce (patch)
treeb274a9e1e185737ba2f53dffd19343eb90a49c63 /lib/mako/template.py
parent6c44081089bc49f606ac1224b4148cf8e9e7a3cb (diff)
downloadexternal_python_mako-895be87b671e77bb1c08bd7297ad91dd730430ce.tar.gz
external_python_mako-895be87b671e77bb1c08bd7297ad91dd730430ce.tar.bz2
external_python_mako-895be87b671e77bb1c08bd7297ad91dd730430ce.zip
- variable names declared in render methods by internal
codegen prefixed by "__M_" to prevent name collisions with user code
Diffstat (limited to 'lib/mako/template.py')
-rw-r--r--lib/mako/template.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mako/template.py b/lib/mako/template.py
index 8350484..52725b0 100644
--- a/lib/mako/template.py
+++ b/lib/mako/template.py
@@ -16,7 +16,10 @@ 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, 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):
+ 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
@@ -28,6 +31,7 @@ class Template(object):
format_exceptions - catch exceptions and format them into an error display template
"""
+
if uri:
self.module_id = re.sub(r'\W', "_", uri)
self.uri = uri