mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
abd4b64884
commit
6bf0798a8d
5
maps.py
5
maps.py
|
@ -194,7 +194,10 @@ def _geocoords_from_wego_link(url: str) -> (int, float, float):
|
|||
return zoom, latitude, longitude
|
||||
|
||||
|
||||
def geocoords_from_map_link(url: str, osm_domain: str) -> (int, float, float):
|
||||
def geocoords_from_map_link(url: str,
|
||||
osm_domain: str = 'openstreetmap.org') -> (int,
|
||||
float,
|
||||
float):
|
||||
"""Returns geocoordinates from a map link url
|
||||
"""
|
||||
if osm_domain in url:
|
||||
|
|
3
posts.py
3
posts.py
|
@ -1283,9 +1283,8 @@ def _create_post_place_and_time(event_date: str, end_date: str,
|
|||
if location and not event_uuid:
|
||||
latitude = longitude = None
|
||||
if '://' in location:
|
||||
osm_domain = 'openstreetmap.org'
|
||||
_, latitude, longitude = \
|
||||
geocoords_from_map_link(location, osm_domain)
|
||||
geocoords_from_map_link(location)
|
||||
if latitude and longitude:
|
||||
tags.append({
|
||||
"@context": "https://www.w3.org/ns/activitystreams",
|
||||
|
|
|
@ -2187,9 +2187,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
set_map_preferences_url(base_dir, nickname, domain,
|
||||
location_domain)
|
||||
# remember the coordinates
|
||||
osm_domain = 'openstreetmap.org'
|
||||
map_zoom, map_latitude, map_longitude = \
|
||||
geocoords_from_map_link(location_str, osm_domain)
|
||||
geocoords_from_map_link(location_str)
|
||||
if map_zoom and map_latitude and map_longitude:
|
||||
set_map_preferences_coords(base_dir, nickname, domain,
|
||||
map_latitude, map_longitude,
|
||||
|
|
Loading…
Reference in New Issue