From 2ccda3706d88619a0681b215faf79ee800dfa0fe Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 25 Aug 2022 11:08:54 +0100 Subject: [PATCH 1/2] Reactions --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1fdd27af2..939bc4ecc 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Key features: * Supports common web browsers and [shell browsers](https://lynx.invisible-island.net). * Will not drain your mobile or laptop battery. * Customisable themes. It doesn't have to look bland. + * Emoji reactions. * Geospatial hashtags. * Does not require much RAM, either on server or client. * Suitable for installation on single board computers. From 965208495a4a3a770118ca25302bfb4d4fbf2db5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 26 Aug 2022 12:31:05 +0100 Subject: [PATCH 2/2] Tidying --- maps.py | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/maps.py b/maps.py index 4cc104c7d..c3fc78c28 100644 --- a/maps.py +++ b/maps.py @@ -466,6 +466,35 @@ def add_tag_map_links(tag_maps_dir: str, tag_name: str, print('EX: error writing tag map ' + tag_map_filename) +def _gpx_location(latitude: float, longitude: float, post_id: str) -> str: + """Returns a gpx waypoint + """ + map_str = '\n' + map_str += ' ' + post_id + '\n' + map_str += ' \n' + map_str += '\n' + return map_str + + +def _kml_location(place_ctr: int, + latitude: float, longitude: float, post_id: str) -> str: + """Returns a kml placemark + """ + map_str = '\n' + map_str += ' ' + str(place_ctr) + '\n' + map_str += ' ' + \ + post_id + '\n]]>\n' + map_str += ' \n' + map_str += ' \n' + map_str += ' ' + str(longitude) + ',' + \ + str(latitude) + ',0\n' + map_str += ' \n' + map_str += '\n' + return map_str + + def _hashtag_map_to_format(base_dir: str, tag_name: str, start_hours_since_epoch: int, end_hours_since_epoch: int, @@ -525,23 +554,10 @@ def _hashtag_map_to_format(base_dir: str, tag_name: str, continue place_ctr += 1 if map_format == 'gpx': - map_str += '\n' - map_str += ' ' + post_id + '\n' - map_str += ' \n' - map_str += '\n' + map_str += _gpx_location(latitude, longitude, post_id) else: - map_str += '\n' - map_str += ' ' + str(place_ctr) + '\n' - map_str += ' ' + \ - post_id + '\n]]>\n' - map_str += ' \n' - map_str += ' \n' - map_str += ' ' + str(longitude) + ',' + \ - str(latitude) + ',0\n' - map_str += ' \n' - map_str += '\n' + map_str += \ + _kml_location(place_ctr, latitude, longitude, post_id) if map_format == 'gpx': map_str += ''