1
0
Fork 0

better handle atpisms

This commit is contained in:
Mateusz Konieczny 2025-01-15 16:53:30 +01:00
parent a4da79bb16
commit f7a43c539f
2 changed files with 19 additions and 9 deletions

View file

@ -612,13 +612,18 @@ def link_status_requests_missing_from_cache():
def opening_hours_key():
return "opening_hours_in_atp_format"
def atpism_links():
returned = [
'website_may_be_broken', # marked by my qa
def keys_with_value_link():
returned = ["website", 'website_may_be_broken', "operator:website", 'website:en', 'website:fr', 'website:de', 'website:kr', 'website:cn', 'website:menu', 'website:orders', 'website:orders:en', 'website:orders:ar', 'reservation:website',
'contact:webcam', # should not be contact...
'contact:tripadvisor', 'contact:yelp',
'source:website', 'brand:website', # probably should be eliminated - TODO
]
# these may have some use in OSM but I would not advocate really increasing their use
"operator:website", 'website:en', 'website:fr', 'website:de', 'website:kr', 'website:cn',
'website:menu', 'website:orders', 'website:orders:en', 'website:orders:ar', 'reservation:website',
'contact:tripadvisor', 'contact:yelp',
'contact:webcam', # should not be contact...
'source:website', 'brand:website', # probably should be eliminated - TODO
]
for code in language_tag_knowledge.all_iso_639_1_language_codes():
if "website:" + code not in returned:
returned.append("website:" + code)
@ -627,9 +632,9 @@ def keys_with_value_link():
if "website:menu:" + code not in returned:
returned.append("website:menu:" + code)
return returned
# TODO: should website:en be even kept at all?
# TODO what about website:orders
# TODO website:fr
def keys_with_value_link():
return ["website"] + atpism_links()
def keys_with_possible_link():
@ -734,6 +739,7 @@ def atp_tags_very_likely_not_usable_for_osm_import(tags):
'brand:hi', 'brand:pa', 'brand:pnb', 'brand:ko', 'brand:sr-Latn',
'brand:hy', 'brand:tr', 'brand:uk'
]
returned += atpism_links()
if tags.get("addr:country") not in ['US']:
returned.append("addr:state")
return returned

View file

@ -10,3 +10,7 @@ class ConfigTests(unittest.TestCase):
# it was missing as it was using country code list, not language code list
# so jp was present and ja missing
self.assertTrue("website:ja" in config.keys_with_value_link())
self.assertTrue("website:ja" in config.atp_tags_very_likely_not_usable_for_osm_import({}))
def test_charge_as_not_reccommeded_for_import(self):
self.assertTrue("charge" in config.atp_tags_very_likely_not_usable_for_osm_import({}))