kopia lustrzana https://github.com/sq9atk/sr0wx
Poprawka wyświetlania komunikatów w konsoli
rodzic
9bc0cdfd1e
commit
c3284ef070
|
@ -44,9 +44,9 @@ class PropagationSq9atk(SR0WXModule):
|
||||||
webFile.retrieve(url, "propagacja.png")
|
webFile.retrieve(url, "propagacja.png")
|
||||||
return Image.open("propagacja.png",'r')
|
return Image.open("propagacja.png",'r')
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
print "Timed out!"
|
print "Timed out!\n"
|
||||||
except:
|
except:
|
||||||
print "Data download error!"
|
print "Data download error!\n"
|
||||||
return
|
return
|
||||||
|
|
||||||
def collectBandConditionsFromImage(self, image, dayTime):
|
def collectBandConditionsFromImage(self, image, dayTime):
|
||||||
|
@ -84,24 +84,24 @@ class PropagationSq9atk(SR0WXModule):
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
image = self.downloadImage(self.__service_url)
|
image = self.downloadImage(self.__service_url)
|
||||||
|
|
||||||
self.__logger.info("::: Przetwarzam dane...\n")
|
message = '';
|
||||||
|
if image:
|
||||||
|
self.__logger.info("::: Przetwarzam dane...\n")
|
||||||
|
|
||||||
day = self.collectBandConditionsFromImage(image, 'day')
|
day = self.collectBandConditionsFromImage(image, 'day')
|
||||||
night = self.collectBandConditionsFromImage(image, 'night')
|
night = self.collectBandConditionsFromImage(image, 'night')
|
||||||
|
|
||||||
if len(day) and len(night):
|
if len(day) and len(night):
|
||||||
message = " ".join([
|
message = " ".join([
|
||||||
" _ informacje_o_propagacji ",
|
" _ informacje_o_propagacji ",
|
||||||
" _ dzien _ ",
|
" _ dzien _ ",
|
||||||
" _ pasma _ ",
|
" _ pasma _ ",
|
||||||
" _ " .join( day ),
|
" _ " .join( day ),
|
||||||
" _ noc _ ",
|
" _ noc _ ",
|
||||||
" _ pasma _ ",
|
" _ pasma _ ",
|
||||||
" _ " .join( night ),
|
" _ " .join( night ),
|
||||||
" _ "
|
" _ "
|
||||||
])
|
])
|
||||||
else:
|
|
||||||
message = ''
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"message": message,
|
"message": message,
|
||||||
|
|
Ładowanie…
Reference in New Issue