kopia lustrzana https://github.com/sq9atk/sr0wx
commit
7c5a065108
|
@ -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
|
||||
|
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
13
sr0wx.py
13
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, ]
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue