summaryrefslogtreecommitdiff
path: root/scripts/jinja2-debug.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/jinja2-debug.py')
-rwxr-xr-xscripts/jinja2-debug.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/scripts/jinja2-debug.py b/scripts/jinja2-debug.py
index 4f04436..96628dd 100755
--- a/scripts/jinja2-debug.py
+++ b/scripts/jinja2-debug.py
@@ -17,21 +17,23 @@ from werkzeug import script
import jinja2
-env = jinja2.Environment(extensions=['jinja2.ext.i18n', 'jinja2.ext.do',
- 'jinja2.ext.loopcontrols',
- 'jinja2.ext.with_',
- 'jinja2.ext.autoescape'],
- autoescape=True)
+env = jinja2.Environment(
+ extensions=[
+ "jinja2.ext.i18n",
+ "jinja2.ext.do",
+ "jinja2.ext.loopcontrols",
+ "jinja2.ext.with_",
+ "jinja2.ext.autoescape",
+ ],
+ autoescape=True,
+)
+
def shell_init_func():
def _compile(x):
print(env.compile(x, raw=True))
- result = {
- 'e': env,
- 'c': _compile,
- 't': env.from_string,
- 'p': env.parse
- }
+
+ result = {"e": env, "c": _compile, "t": env.from_string, "p": env.parse}
for key in jinja2.__all__:
result[key] = getattr(jinja2, key)
return result
@@ -40,8 +42,9 @@ def shell_init_func():
def action_compile():
print(env.compile(sys.stdin.read(), raw=True))
+
action_shell = script.make_shell(shell_init_func)
-if __name__ == '__main__':
+if __name__ == "__main__":
script.run()