From fbd511e2e22a259498aeba5a94291ade1058bf16 Mon Sep 17 00:00:00 2001 From: Pedro de Medeiros Date: Wed, 14 Dec 2022 01:17:55 -0300 Subject: make map_conf.json optional too --- tools/map.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/map.py b/tools/map.py index 476c1cd..0ce19fb 100755 --- a/tools/map.py +++ b/tools/map.py @@ -148,10 +148,6 @@ def main(): with open(args.conf, "rt") as fd: conf = json.load(fd) - et_names = [d["name"] for d in conf["entities"]] - et_weigths = dict((d["name"], d["w"]) for d in conf["entities"]) - et_bytes = dict((d["name"], d["bytes"]) for d in conf["entities"]) - with open(args.map_json, "rt") as fd: data = json.load(fd) @@ -230,6 +226,9 @@ def main(): file=sys.stderr, ) if len(entities_layer) and entities_layer["visible"]: + et_names = [d["name"] for d in conf["entities"]] + et_weigths = dict((d["name"], d["w"]) for d in conf["entities"]) + et_bytes = dict((d["name"], d["bytes"]) for d in conf["entities"]) map_ents = defaultdict(list) map_ents_w = defaultdict(int) map_ents_bytes = defaultdict(int) -- cgit v1.2.3