diff --git a/config.py b/config.py index 34a1a08..b677190 100755 --- a/config.py +++ b/config.py @@ -64,6 +64,7 @@ import pl_google.pl_google as pl_google lang = "pl_google" pygame_bug = 0 +data_sources_error_msg = ['_','zrodlo_danych_niedostepne'] hello_msg = ['_','tu_eksperymentalna_automatyczna_stacja_pogodowa','sr0wx'] goodbye_msg = ['_','tu_sr0wx'] read_sources_msg = False diff --git a/pl_google/zrodlo_danych_niedostepne.ogg b/pl_google/zrodlo_danych_niedostepne.ogg new file mode 100644 index 0000000..359d7b8 Binary files /dev/null and b/pl_google/zrodlo_danych_niedostepne.ogg differ diff --git a/pl_google_male/zrodlo_danych_niedostepne.ogg b/pl_google_male/zrodlo_danych_niedostepne.ogg new file mode 100644 index 0000000..079ee25 Binary files /dev/null and b/pl_google_male/zrodlo_danych_niedostepne.ogg differ diff --git a/sr0wx.py b/sr0wx.py index a486b7f..6ba4e27 100644 --- a/sr0wx.py +++ b/sr0wx.py @@ -77,6 +77,7 @@ import pygame import sys import logging, logging.handlers import numpy +import urllib2 # ``os``, ``sys`` and ``time`` doesn't need further explanation, these are # syandard Python packages. @@ -160,6 +161,18 @@ if len(args) > 0: else: modules = config.modules +try: + dane = urllib2.urlopen('http://google.pl', None, 30); +except urllib2.URLError, e: + modules = [] + message += " ".join(config.data_sources_error_msg) + logger.info(COLOR_FAIL + "Brak połączenia z internetem" + COLOR_ENDC + "\n") +except socket.timeout: + modules = [] + message += " ".join(config.data_sources_error_msg) + logger.info(COLOR_FAIL + "Brak połączenia z internetem" + COLOR_ENDC + "\n") + + lang = my_import('.'.join((config.lang, config.lang))) sources = [lang.source, ]