diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-11-07 14:38:45 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-11-07 14:38:45 +0100 |
commit | f8af22b882f734c3d7dd0bcaf4673552d0a616c4 (patch) | |
tree | ceecec6976bad72306d484ff47749f5a1af623eb /contrib/render.py | |
parent | 45c443f3489537b33ffece578a920656adcc643b (diff) | |
download | exchange-f8af22b882f734c3d7dd0bcaf4673552d0a616c4.tar.xz |
more work on wire auditor and reporting (#4958)
Diffstat (limited to 'contrib/render.py')
-rwxr-xr-x | contrib/render.py | 26 |
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)) |