Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: mojo/public/third_party/jinja2/sandbox.py

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/third_party/jinja2/runtime.py ('k') | mojo/public/third_party/jinja2/tests.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 """ 2 """
3 jinja2.sandbox 3 jinja2.sandbox
4 ~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~
5 5
6 Adds a sandbox layer to Jinja as it was the default behavior in the old 6 Adds a sandbox layer to Jinja as it was the default behavior in the old
7 Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the 7 Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
8 default behavior is easier to use. 8 default behavior is easier to use.
9 9
10 The behavior can be changed by subclassing the environment. 10 The behavior can be changed by subclassing the environment.
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 class ImmutableSandboxedEnvironment(SandboxedEnvironment): 359 class ImmutableSandboxedEnvironment(SandboxedEnvironment):
360 """Works exactly like the regular `SandboxedEnvironment` but does not 360 """Works exactly like the regular `SandboxedEnvironment` but does not
361 permit modifications on the builtin mutable objects `list`, `set`, and 361 permit modifications on the builtin mutable objects `list`, `set`, and
362 `dict` by using the :func:`modifies_known_mutable` function. 362 `dict` by using the :func:`modifies_known_mutable` function.
363 """ 363 """
364 364
365 def is_safe_attribute(self, obj, attr, value): 365 def is_safe_attribute(self, obj, attr, value):
366 if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value): 366 if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value):
367 return False 367 return False
368 return not modifies_known_mutable(obj, attr) 368 return not modifies_known_mutable(obj, attr)
OLDNEW
« no previous file with comments | « mojo/public/third_party/jinja2/runtime.py ('k') | mojo/public/third_party/jinja2/tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698