mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
2c61b49b57
* add json check before compile * do more checking on effects * add effects checking * better effects checking. * integrate schema check for default config reduce size of default configs
24 lines
453 B
Python
24 lines
453 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:
|
|
json.load(f)
|
|
#print(msg + "ok")
|
|
except ValueError as e:
|
|
print(msg + 'invalid')
|
|
retval = 1
|
|
errors += 1
|
|
|
|
print(" checked files: %s success: %s errors: %s" % (total,(total-errors),errors))
|
|
|
|
sys.exit(retval)
|