2020-04-26 03:08:45 +02:00
|
|
|
#!/usr/bin/env python3
|
2017-03-17 17:31:09 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from glob import glob
|
|
|
|
import json
|
2021-06-21 20:18:15 +02:00
|
|
|
from typing import Dict
|
2017-03-17 17:31:09 +01:00
|
|
|
|
2021-06-21 20:18:15 +02:00
|
|
|
all_uuids: Dict[str, str] = {}
|
2017-03-17 17:31:09 +01:00
|
|
|
for definition in glob('./objects/*/definition.json'):
|
|
|
|
with open(definition, 'r') as f:
|
|
|
|
d = json.load(f)
|
|
|
|
uuid = d['uuid']
|
|
|
|
name = d['name']
|
|
|
|
if all_uuids.get(uuid):
|
|
|
|
raise Exception('Same uuid for {} and {} ({})'.format(name, all_uuids.get(uuid), uuid))
|
|
|
|
all_uuids[uuid] = name
|