aboutsummaryrefslogtreecommitdiff
path: root/tools/map.py
diff options
context:
space:
mode:
authorJuan J. Martínez <jjm@usebox.net>2022-12-14 08:04:52 +0000
committerJuan J. Martínez <jjm@usebox.net>2022-12-14 08:04:52 +0000
commit4cd89b82ffbf3c1b83fb2a2221fc33f04f98118a (patch)
tree454f1fffecc487e20e78f427fd334fe0b723bdf3 /tools/map.py
parent65c29a4abf4dd6d9b3dabf19a8a08a312485900b (diff)
parentfbd511e2e22a259498aeba5a94291ade1058bf16 (diff)
downloadubox-msx-lib-4cd89b82ffbf3c1b83fb2a2221fc33f04f98118a.tar.gz
ubox-msx-lib-4cd89b82ffbf3c1b83fb2a2221fc33f04f98118a.zip
Merge branch 'map.py' into 'main'
ignore map_conf.json if layer not found See merge request reidrac/ubox-msx-lib!35
Diffstat (limited to 'tools/map.py')
-rwxr-xr-xtools/map.py7
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)