some things work

This commit is contained in:
2023-01-26 14:58:41 +01:00
parent be83cbd988
commit 966db6e5ad
24 changed files with 242 additions and 68 deletions

View File

@@ -1,12 +1,13 @@
import os
import yaml
import uuid
# create an empty dictionary to store the demand tags
demand_tags = {} # demand tags with demands
world_tags = {} # available resources tags with resources available
commoditys = {} # commoditys by name
productions = {} # list of production rules by commodity name
productions_id_map={}
productions_uses = {} # list of productions that are a key commodity
data={}
def search_yaml_files(directory = "db"):
@@ -34,9 +35,11 @@ def search_yaml_files(directory = "db"):
commoditys[comm['name']] = comm
elif data['kind'] == "production":
for comm in data['spec']:
comm["id"]=uuid.uuid4()
if comm['name'] not in productions:
productions[comm['name']]=[]
productions[comm['name']].append(comm)
productions_id_map[comm["id"]]=comm
for comp in comm["prod"]:
k=list(comp.keys())[0]
if k not in productions_uses: