From 62acd8f45fbf7a280a6a7bcc486f859c2f87158e Mon Sep 17 00:00:00 2001
From: Markus Willman <mpewil@utu.fi>
Date: Sun, 11 Mar 2018 17:59:36 +0200
Subject: [PATCH] update translations one more time - reverse exception
 priority in locator.py

---
 server/locator.py                       | 10 +++---
 translations/en/LC_MESSAGES/messages.po | 38 ++++++++++++----------
 translations/fi/LC_MESSAGES/messages.po | 42 +++++++++++++++----------
 3 files changed, 52 insertions(+), 38 deletions(-)

diff --git a/server/locator.py b/server/locator.py
index b3caf92..e343cd5 100644
--- a/server/locator.py
+++ b/server/locator.py
@@ -57,15 +57,15 @@ class PollingThreadReader(object):
 		while self._running:
 			apiResponse = None
 
-			# FIXME: better exception handling
+			# TODO: better exception handling
 			try:
-				apiResponse = requests.get(self.endpoint, headers = self.requestHeaders).content
-			except (ConnectionError, HTTPError, Timeout):
+				apiResponse = requests.get(self.endpoint, headers = self.requestHeaders, timeout = (3.05, 2)).content
+			except Timeout:
 				self._stale = True
-				time.sleep(self.pollTime)
 				continue
-			except RequestException:
+			except (ConnectionError, HTTPError, RequestException):
 				self._stale = True
+				time.sleep(self.pollTime)
 				continue
 
 			with self._lock:
diff --git a/translations/en/LC_MESSAGES/messages.po b/translations/en/LC_MESSAGES/messages.po
index 7f7d832..9c9848e 100644
--- a/translations/en/LC_MESSAGES/messages.po
+++ b/translations/en/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2018-03-08 06:11+0200\n"
+"POT-Creation-Date: 2018-03-11 17:37+0200\n"
 "PO-Revision-Date: 2018-02-10 01:33+0200\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language: en\n"
@@ -56,44 +56,54 @@ msgstr ""
 msgid "Give Feedback"
 msgstr ""
 
-#: templates/map.html:18
+#: templates/map.html:19
 msgid "Live Bus Traffic Nearby"
 msgstr ""
 
-#: templates/map.html:28 templates/timetables.html:19
+#: templates/map.html:29 templates/timetables.html:19
 #: templates/timetables.html:54
 msgid "Line"
 msgstr ""
 
-#: templates/map.html:28 templates/timetables.html:19
+#: templates/map.html:29 templates/timetables.html:19
 #: templates/timetables.html:55
 msgid "Destination"
 msgstr ""
 
-#: templates/map.html:29 templates/timetables.html:20
+#: templates/map.html:30 templates/timetables.html:20
 msgid "Time"
 msgstr ""
 
-#: templates/map.html:30 templates/timetables.html:21
+#: templates/map.html:31 templates/timetables.html:21
 msgid "ETA"
 msgstr ""
 
-#: templates/map.html:57
+#: templates/map.html:49 templates/timetables.html:39
+msgid "Information last updated: "
+msgstr ""
+
+#: templates/map.html:55
+msgid ""
+"The location service is currently not active, the map may show outdated "
+"information."
+msgstr ""
+
+#: templates/map.html:73
 msgid ""
 "Location information is updated with a 10-30 second delay. Due to network"
 " conditions, latency or lost location updates buses may at times appear "
 "to move in an unrealistic way."
 msgstr ""
 
-#: templates/map.html:414
+#: templates/map.html:448
 msgid "Next Stop"
 msgstr ""
 
-#: templates/map.html:415
+#: templates/map.html:449
 msgid "Aimed Arrival"
 msgstr ""
 
-#: templates/map.html:416
+#: templates/map.html:450
 msgid "Expected Arrival"
 msgstr ""
 
@@ -101,10 +111,6 @@ msgstr ""
 msgid "Busses Arriving Soon"
 msgstr ""
 
-#: templates/timetables.html:39
-msgid "Information last updated: "
-msgstr ""
-
 #: templates/timetables.html:46
 msgid "Today's Schedule"
 msgstr ""
@@ -251,11 +257,11 @@ msgstr ""
 msgid "Swedish"
 msgstr ""
 
-#: templates/internal/macros.html:50 templates/internal/macros.html:52
+#: templates/internal/macros.html:52 templates/internal/macros.html:54
 msgid "Previous"
 msgstr ""
 
-#: templates/internal/macros.html:56 templates/internal/macros.html:58
+#: templates/internal/macros.html:58 templates/internal/macros.html:60
 msgid "Next"
 msgstr ""
 
diff --git a/translations/fi/LC_MESSAGES/messages.po b/translations/fi/LC_MESSAGES/messages.po
index 69cf7cd..d499077 100644
--- a/translations/fi/LC_MESSAGES/messages.po
+++ b/translations/fi/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2018-03-08 06:11+0200\n"
+"POT-Creation-Date: 2018-03-11 17:37+0200\n"
 "PO-Revision-Date: 2018-02-10 01:35+0200\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language: fi\n"
@@ -56,29 +56,41 @@ msgstr "Föli Äppi"
 msgid "Give Feedback"
 msgstr "Anna palautetta"
 
-#: templates/map.html:18
+#: templates/map.html:19
 msgid "Live Bus Traffic Nearby"
 msgstr "Lähistön reaaliaikainen bussiliikenne"
 
-#: templates/map.html:28 templates/timetables.html:19
+#: templates/map.html:29 templates/timetables.html:19
 #: templates/timetables.html:54
 msgid "Line"
 msgstr "Linja"
 
-#: templates/map.html:28 templates/timetables.html:19
+#: templates/map.html:29 templates/timetables.html:19
 #: templates/timetables.html:55
 msgid "Destination"
 msgstr "Määränpää"
 
-#: templates/map.html:29 templates/timetables.html:20
+#: templates/map.html:30 templates/timetables.html:20
 msgid "Time"
 msgstr "Aika"
 
-#: templates/map.html:30 templates/timetables.html:21
+#: templates/map.html:31 templates/timetables.html:21
 msgid "ETA"
 msgstr "ETA"
 
-#: templates/map.html:57
+#: templates/map.html:49 templates/timetables.html:39
+msgid "Information last updated: "
+msgstr "Tiedot päivitetty viimeksi: "
+
+#: templates/map.html:55
+msgid ""
+"The location service is currently not active, the map may show outdated "
+"information."
+msgstr ""
+"Paikkatioetopalvelu ei ole juuri nyt aktiivinen, kartta saattaa näyttää "
+"vanhentunutta tietoa."
+
+#: templates/map.html:73
 msgid ""
 "Location information is updated with a 10-30 second delay. Due to network"
 " conditions, latency or lost location updates buses may at times appear "
@@ -88,15 +100,15 @@ msgstr ""
 " puutteellisesta paikannuksesta johtuen bussit saattavat paikoitellen "
 "liikkua epärealistisella tavalla"
 
-#: templates/map.html:414
+#: templates/map.html:448
 msgid "Next Stop"
 msgstr "Seuraava pysäkki"
 
-#: templates/map.html:415
+#: templates/map.html:449
 msgid "Aimed Arrival"
 msgstr "Tavoitteellinen saapumisaika"
 
-#: templates/map.html:416
+#: templates/map.html:450
 msgid "Expected Arrival"
 msgstr "Odotettu saapumisaika"
 
@@ -104,10 +116,6 @@ msgstr "Odotettu saapumisaika"
 msgid "Busses Arriving Soon"
 msgstr "Pian saapuvat bussit"
 
-#: templates/timetables.html:39
-msgid "Information last updated: "
-msgstr "Tiedot päivitetty viimeksi: "
-
 #: templates/timetables.html:46
 msgid "Today's Schedule"
 msgstr "Päivän aikataulu"
@@ -256,7 +264,7 @@ msgstr ""
 
 #: templates/internal/base.html:159
 msgid "About"
-msgstr ""
+msgstr "Info"
 
 #: templates/internal/base.html:170
 msgid "English"
@@ -270,11 +278,11 @@ msgstr "Suomi"
 msgid "Swedish"
 msgstr "Ruotsi"
 
-#: templates/internal/macros.html:50 templates/internal/macros.html:52
+#: templates/internal/macros.html:52 templates/internal/macros.html:54
 msgid "Previous"
 msgstr "Edellinen"
 
-#: templates/internal/macros.html:56 templates/internal/macros.html:58
+#: templates/internal/macros.html:58 templates/internal/macros.html:60
 msgid "Next"
 msgstr "Seuraava"
 
-- 
GitLab