mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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
This commit is contained in:
@@ -12,14 +12,14 @@ retval = 0
|
||||
total = 0
|
||||
errors = 0
|
||||
with open("libsrc/effectengine/EffectDefinition.schema.json") as baseSchemaFile:
|
||||
baseSchema = json.loads(baseSchemaFile.read().decode('utf-8-sig'))
|
||||
baseSchema = json.loads(baseSchemaFile.read())
|
||||
baseValidator = Draft3Validator(baseSchema)
|
||||
for filename in glob.glob(jsonFiles+'/*.json'):
|
||||
with open(filename) as f:
|
||||
total += 1
|
||||
msg = " check effect %s ... " % filename
|
||||
try:
|
||||
effect = json.loads(f.read().decode('utf-8-sig'))
|
||||
effect = json.loads(f.read())
|
||||
script = path.basename(effect['script'])
|
||||
if not path.exists(jsonFiles+'/'+script):
|
||||
raise ValueError('script file: '+script+' not found.')
|
||||
@@ -31,7 +31,7 @@ with open("libsrc/effectengine/EffectDefinition.schema.json") as baseSchemaFile:
|
||||
|
||||
# validate against schema
|
||||
with open(schema) as s:
|
||||
effectSchema = json.loads(s.read().decode('utf-8-sig'))
|
||||
effectSchema = json.loads(s.read())
|
||||
Draft3Validator.check_schema(effectSchema)
|
||||
validator = Draft3Validator(effectSchema)
|
||||
baseValidator.validate(effect)
|
||||
|
@@ -11,7 +11,8 @@ for filename in sys.argv[1:]:
|
||||
total += 1
|
||||
msg = " check json %s ... " % filename
|
||||
try:
|
||||
json.loads(f.read().decode('utf-8-sig'))
|
||||
data = f.read()
|
||||
json.loads(data)
|
||||
#print(msg + "ok")
|
||||
except ValueError as e:
|
||||
print(msg + 'invalid ('+str(e)+')')
|
||||
|
@@ -11,8 +11,8 @@ schemaFileName = sys.argv[2]
|
||||
try:
|
||||
with open(schemaFileName) as schemaFile:
|
||||
with open(jsonFileName) as jsonFile:
|
||||
j = json.loads(jsonFile.read().decode('utf-8-sig'))
|
||||
validator = Draft3Validator(json.loads(schemaFile.read().decode('utf-8-sig')))
|
||||
j = json.loads(jsonFile.read())
|
||||
validator = Draft3Validator(json.loads(schemaFile.read()))
|
||||
validator.validate(j)
|
||||
except Exception as e:
|
||||
print('validation error: '+jsonFileName + ' '+schemaFileName+' ('+str(e)+')')
|
||||
|
Reference in New Issue
Block a user