renderbug-cpp/verify-configs.py

32 lines
907 B
Python

Import("env")
import fnmatch
import os
import json
def verify_json(source, target, env):
for root, dirnames, files in os.walk("data"):
for file in files:
if file.endswith(".json"):
print("Validating " + root + '/' + file + '...')
json.load(open(root + '/' + file, 'r'))
usedTasks = set()
for root, dirnames, files in os.walk("data/profiles/"):
for file in files:
if file.endswith(".json"):
data = json.load(open(root + '/' + file, 'r'))
for task in data['tasks']:
usedTasks.add(task)
for sceneName in data['scenes']:
for task in data['scenes'][sceneName]:
usedTasks.add(task)
print("Used tasks:")
for task in sorted(usedTasks):
print("- " + task)
env.AddPreAction("buildfs", verify_json)