hyperion.ng/test/jsonchecks/checkjson.py
redPanther cab3c2fdc9 add more drawing func to effect engine (#400)
* - add more drawing func to effect engine
- make provider rs232 less noisy
- json checks: remove utf8 conversion temporarly and make it compat with py3 again

* fix compile prob
2017-02-16 07:33:58 +01:00

25 lines
489 B
Python

#!/usr/bin/env python
import json, sys
print("-- validate json files")
retval = 0
total = 0
errors = 0
for filename in sys.argv[1:]:
with open(filename) as f:
total += 1
msg = " check json %s ... " % filename
try:
data = f.read()
json.loads(data)
#print(msg + "ok")
except ValueError as e:
print(msg + 'invalid ('+str(e)+')')
retval = 1
errors += 1
print(" checked files: %s success: %s errors: %s" % (total,(total-errors),errors))
sys.exit(retval)