diff genshi/template/loader.py @ 647:5af131b37ab4 experimental-sandboxed

restricted is the new secure
author aronacher
date Wed, 26 Sep 2007 17:56:41 +0000
parents e5363d3c22d3
children c7dcd4dc240d
line wrap: on
line diff
--- a/genshi/template/loader.py
+++ b/genshi/template/loader.py
@@ -78,7 +78,7 @@
     def __init__(self, search_path=None, auto_reload=False,
                  default_encoding=None, max_cache_size=25, default_class=None,
                  variable_lookup='strict', allow_exec=True,
-                 secure=False, callback=None):
+                 restricted=False, callback=None):
         """Create the template laoder.
         
         :param search_path: a list of absolute path names that should be
@@ -96,7 +96,7 @@
                                 (the default), "lenient", or a custom lookup
                                 class
         :param allow_exec: whether to allow Python code blocks in templates
-        :param secure: use secure template evaluation
+        :param restricted: use restricted template evaluation
         :param callback: (optional) a callback function that is invoked after a
                          template was initialized by this loader; the function
                          is passed the template object as only argument. This
@@ -122,7 +122,7 @@
         self.default_class = default_class or MarkupTemplate
         self.variable_lookup = variable_lookup
         self.allow_exec = allow_exec
-        self.secure = secure
+        self.restricted = restricted
         if callback is not None and not callable(callback):
             raise TypeError('The "callback" parameter needs to be callable')
         self.callback = callback
@@ -217,7 +217,7 @@
                                    loader=self, encoding=encoding,
                                    lookup=self.variable_lookup,
                                    allow_exec=self.allow_exec,
-                                   secure=self.secure)
+                                   restricted=self.restricted)
                         if self.callback:
                             self.callback(tmpl)
                         self._cache[filename] = tmpl
Copyright (C) 2012-2017 Edgewall Software