summaryrefslogtreecommitdiff
path: root/contrib/render.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/render.py')
-rwxr-xr-xcontrib/render.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/contrib/render.py b/contrib/render.py
index d31c7f9bd..093db3559 100755
--- a/contrib/render.py
+++ b/contrib/render.py
@@ -1,14 +1,19 @@
#!/usr/bin/python
# This file is in the public domain.
-"""
-Expand Jinja2 templates based on JSON input.
+"""Expand Jinja2 templates based on JSON input.
+
+First command-line argument must be the JSON input from taler-auditor.
+Second command-line argument must be the JSON input from the
+taler-wire-auditor.
+
+The tool then reads the template from stdin and writes the expanded
+output to stdout.
-First command-line argument must be the JSON input.
-The tool reads the template from stdin and writes
-the expanded output to stdout.
+TODO: proper installation, man page, error handling, --help option.
@author Christian Grothoff
+
"""
import sys
@@ -23,10 +28,13 @@ class StdinLoader(BaseLoader):
def get_source(self, environment, template):
source = sys.stdin.read().decode('utf-8')
return source, self.path, lambda: false
-
-jsonFile = open (sys.argv[1], 'r')
-jsonData = json.load(jsonFile)
+
+jsonFile1 = open (sys.argv[1], 'r')
+jsonData1 = json.load(jsonFile)
+
+jsonFile2 = open (sys.argv[2], 'r')
+jsonData2 = json.load(jsonFile)
jinjaEnv = jinja2.Environment(loader=StdinLoader(),
lstrip_blocks=True,
@@ -35,4 +43,4 @@ jinjaEnv = jinja2.Environment(loader=StdinLoader(),
autoescape=False)
tmpl = jinjaEnv.get_template('stdin');
-print(tmpl.render(data = jsonData))
+print(tmpl.render(data = jsonData1, wire = jsonData2))