some things work
This commit is contained in:
Binary file not shown.
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user