mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	switch to simplejson
This commit is contained in:
		| @@ -4,7 +4,7 @@ | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
| sudo apt-get update | sudo apt-get update | ||||||
| sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev | sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev python-simplejson | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| **ATTENTION Win10LinuxSubsystem** we do not (/we can't) support using hyperion in linux subsystem of MS Windows 10, albeit some users tested it with success. Keep in mind to disable | **ATTENTION Win10LinuxSubsystem** we do not (/we can't) support using hyperion in linux subsystem of MS Windows 10, albeit some users tested it with success. Keep in mind to disable | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| #!/usr/bin/env python | #!/usr/bin/env python | ||||||
| import json, sys, glob | import simplejson, sys, glob | ||||||
| from os import path | from os import path | ||||||
| from jsonschema import Draft3Validator | from jsonschema import Draft3Validator | ||||||
|  |  | ||||||
| @@ -12,14 +12,14 @@ retval  = 0 | |||||||
| total   = 0 | total   = 0 | ||||||
| errors  = 0 | errors  = 0 | ||||||
| with open("libsrc/effectengine/EffectDefinition.schema.json") as baseSchemaFile: | with open("libsrc/effectengine/EffectDefinition.schema.json") as baseSchemaFile: | ||||||
| 	baseSchema = json.load(baseSchemaFile) | 	baseSchema = simplejson.load(baseSchemaFile) | ||||||
| 	baseValidator = Draft3Validator(baseSchema) | 	baseValidator = Draft3Validator(baseSchema) | ||||||
| 	for filename in glob.glob(jsonFiles+'/*.json'): | 	for filename in glob.glob(jsonFiles+'/*.json'): | ||||||
| 		with open(filename) as f: | 		with open(filename) as f: | ||||||
| 			total += 1 | 			total += 1 | ||||||
| 			msg = "   check effect %s ... " % filename | 			msg = "   check effect %s ... " % filename | ||||||
| 			try: | 			try: | ||||||
| 				effect = json.load(f) | 				effect = simplejson.load(f) | ||||||
| 				script = path.basename(effect['script']) | 				script = path.basename(effect['script']) | ||||||
| 				if not path.exists(jsonFiles+'/'+script): | 				if not path.exists(jsonFiles+'/'+script): | ||||||
| 					raise ValueError('script file: '+script+' not found.') | 					raise ValueError('script file: '+script+' not found.') | ||||||
| @@ -31,7 +31,7 @@ with open("libsrc/effectengine/EffectDefinition.schema.json") as baseSchemaFile: | |||||||
| 				 | 				 | ||||||
| 				# validate against schema | 				# validate against schema | ||||||
| 				with open(schema) as s: | 				with open(schema) as s: | ||||||
| 					effectSchema = json.load(s) | 					effectSchema = simplejson.load(s) | ||||||
| 					Draft3Validator.check_schema(effectSchema) | 					Draft3Validator.check_schema(effectSchema) | ||||||
| 					validator = Draft3Validator(effectSchema) | 					validator = Draft3Validator(effectSchema) | ||||||
| 					baseValidator.validate(effect) | 					baseValidator.validate(effect) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user