From d7d5e784ffe7ef4a0bafe511498bd4baeba2ae4e Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny <matkoniecz@gmail.com> Date: Wed, 5 Feb 2025 12:55:14 +0100 Subject: [PATCH] handle OSM tag lists being shown, not only ATP ones --- 21_list_import_status.py | 4 ++-- show_data.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/21_list_import_status.py b/21_list_import_status.py index 1c5f943..488b0aa 100644 --- a/21_list_import_status.py +++ b/21_list_import_status.py @@ -236,8 +236,8 @@ def entry_to_presentation_object(checked_key, entry, judgment): {'type': 'link', 'value': {'text': 'OSM object', 'url': entry.osm_link}}, {'type': 'text', 'value': entry.atp_tags.get(atp_key, "")}, {'type': 'text', 'value': entry.osm_match_tags.get(checked_key, "")}, - {'type': 'text', 'value': show_data.tag_list_to_html(entry.atp_tags)}, - {'type': 'text', 'value': show_data.tag_list_to_html(entry.osm_match_tags)}, + {'type': 'text', 'value': show_data.tag_list_to_html(entry.atp_tags, atp_tag_list=True)}, + {'type': 'text', 'value': show_data.tag_list_to_html(entry.osm_match_tags, atp_tag_list=False)}, {'type': 'text', 'value': ", ".join(judgment.get('mismatching_key_list', ""))}, ], 'display_type': row_type diff --git a/show_data.py b/show_data.py index f330ccc..09ec872 100644 --- a/show_data.py +++ b/show_data.py @@ -444,7 +444,7 @@ def get_center(dataset): -def tag_list_to_html(tags): +def tag_list_to_html(tags, atp_tag_list=True): returned = "" normal_tags = "" dropped_tags = "" @@ -461,7 +461,13 @@ def tag_list_to_html(tags): raise returned = normal_tags if dropped_tags != "": - returned += "<br><br>tags present in ATP, very likely not usable directly in OSM<br>" + dropped_tags + if atp_tag_list: + # the same function may also be used for + # listing OSM tags + # these also may have some from ones marked as + # bad/problematic/useless + returned += "<br><br>tags present in ATP, very likely not usable directly in OSM<br>" + returned += dropped_tags return returned