diff options
author | Ryan S. Arnold <ryan.arnold@linaro.org> | 2016-09-02 14:30:12 -0500 |
---|---|---|
committer | Ryan S. Arnold <ryan.arnold@linaro.org> | 2016-09-02 14:30:12 -0500 |
commit | fefa752922c71211f168badc591f8873fdb19e49 (patch) | |
tree | 56c9bbd8e0bde70a419af918c0d1942e8695b8bb /rn.py | |
parent | 0c5d8bc08c904bde1547773cbd52f56aaa599116 (diff) |
rn.py: If jinja can't generate output, print exception and let user fix template.
Diffstat (limited to 'rn.py')
-rw-r--r-- | rn.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -24,6 +24,9 @@ from linaropy.rn.rnseries import RNSeries from linaropy.rn.rngen import rngen from linaropy.rninput import yninput +from jinja2.exceptions import TemplateSyntaxError +import traceback + rnProj=[] # Cleanup the temporary project directory if necessary. @@ -90,7 +93,12 @@ def generate(track, to_date, to_series, gccsource, persist): # Generate the temporary output files to the projdir. with cd(rnProj[0].projdir): - rngen(next_rn, gccclone) + try: + rngen(next_rn, gccclone) + except TemplateSyntaxError: + traceback.print_exc(file=sys.stdout) + print "Please correct the template and try again." + continue print "Please direct your browser to the rendered .html files in" print "%s and make sure that they look correct." % rnProj[0].projdir |