mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
170ad4f5db
* - disable device when error indecates that the problem is not solvable on reconnect
- introduce a preOpenDelay of 2 seconds (currently value is hardcoded)
* rs232:
- make preOpenDelay available via webui
- fix preOpenDelay
- add basic usb serial detection
* - revert 3819ae7
- fix schema files
* make json checks compat with utf8+bom
* make shutdown effect a bit more flexible
24 lines
494 B
Python
24 lines
494 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.loads(f.read().decode('utf-8-sig'))
|
|
#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)
|