+4
-1
@@ -10,6 +10,9 @@ from generator.model import SCHEMA_VERSION, validate_document
|
||||
|
||||
def load_json(path: Path) -> dict:
|
||||
document = json.loads(path.read_text(encoding='utf-8'))
|
||||
return validate_json(document, path)
|
||||
|
||||
def validate_json(document: dict, path: Path) -> dict:
|
||||
if 'music' in document:
|
||||
from generator.engraving import ENGINE_NAME, ENGINE_VERSION, PAGE_HEIGHT, PAGE_WIDTH, check_page
|
||||
presentation = document.get('presentation', {})
|
||||
@@ -122,8 +125,8 @@ def count_json_files(root: Path) -> int:
|
||||
def validate_generated_tree(root: Path) -> None:
|
||||
audio_cache = {}
|
||||
for path in root.rglob('*.json'):
|
||||
load_json(path)
|
||||
document = json.loads(path.read_text(encoding='utf-8'))
|
||||
validate_json(document, path)
|
||||
if 'playback' in document:
|
||||
from generator.playback import validate_assets
|
||||
validate_assets(document['playback'], root, audio_cache)
|
||||
|
||||
Reference in New Issue
Block a user