You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
412 B

  1. #!/usr/bin/env python
  2. import sys
  3. import traceback
  4. from jinja2 import Environment
  5. from jinja2.exceptions import TemplateSyntaxError
  6. env = Environment()
  7. errors = False
  8. for template in sys.argv[1:]:
  9. try:
  10. with open(template) as t:
  11. env.parse(t.read())
  12. except TemplateSyntaxError as e:
  13. print (template)
  14. traceback.print_exc()
  15. errors = True
  16. if errors:
  17. exit (1)