diff options
author | Pedro de Medeiros <pedro.medeiros@gmail.com> | 2022-12-14 01:17:55 -0300 |
---|---|---|
committer | Pedro de Medeiros <pedro.medeiros@gmail.com> | 2022-12-14 01:17:55 -0300 |
commit | fbd511e2e22a259498aeba5a94291ade1058bf16 (patch) | |
tree | 454f1fffecc487e20e78f427fd334fe0b723bdf3 | |
parent | 65c29a4abf4dd6d9b3dabf19a8a08a312485900b (diff) | |
download | ubox-msx-lib-fbd511e2e22a259498aeba5a94291ade1058bf16.tar.gz ubox-msx-lib-fbd511e2e22a259498aeba5a94291ade1058bf16.zip |
make map_conf.json optional too
-rwxr-xr-x | tools/map.py | 7 |
1 files 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) |