diff --git a/server/locator.py b/server/locator.py index b3caf92f299395e9c044fba34b3f8325478d4d57..e343cd57eb2d3a0333ffc1af0663157185b382c8 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 7f7d832ab77b64b23f158e1f1fb46beac1630161..9c9848ee23e1113c91ac9809dcc4dd3a87d5bb4e 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 69cf7cd5e92b9d6410e2f1a77fb1a59d063ff296..d49907724b10138c57a60a3afa112968b37866f9 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"