fixed proffesional weather
This commit is contained in:
parent
2e8291b5d6
commit
34c8cba062
@ -1959,6 +1959,7 @@ class StockTicker():
|
|||||||
weekday = weekdays[datetime.today().weekday()]
|
weekday = weekdays[datetime.today().weekday()]
|
||||||
|
|
||||||
for i, location in enumerate(locations):
|
for i, location in enumerate(locations):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
img = Image.new('RGB', (1000, 32))
|
img = Image.new('RGB', (1000, 32))
|
||||||
@ -2049,7 +2050,7 @@ class StockTicker():
|
|||||||
w_unit = 'M/H'
|
w_unit = 'M/H'
|
||||||
|
|
||||||
|
|
||||||
wtext_img = self.textImage("{0:.0f}".format(wind_speed) + wind_unit, font)
|
wtext_img = self.textImage("{0:.0f}".format(w_speed) + w_unit, font)
|
||||||
wdir_img = self.textImage(self.degreesToCompass(current_weather['wind_direction']).upper(), font)
|
wdir_img = self.textImage(self.degreesToCompass(current_weather['wind_direction']).upper(), font)
|
||||||
vis_img = Image.open(weather_dir + '/visibility.png')
|
vis_img = Image.open(weather_dir + '/visibility.png')
|
||||||
vtext_img = self.textImage(str(current_weather['visibility']/1000) + 'km', font)
|
vtext_img = self.textImage(str(current_weather['visibility']/1000) + 'km', font)
|
||||||
@ -2066,6 +2067,7 @@ class StockTicker():
|
|||||||
|
|
||||||
image_list.append(img)
|
image_list.append(img)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
||||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||||
self.logf.write(str(e))
|
self.logf.write(str(e))
|
||||||
@ -2766,7 +2768,7 @@ if __name__ == '__main__':
|
|||||||
msg = getInput()
|
msg = getInput()
|
||||||
stock_ticker.process_msg(msg)
|
stock_ticker.process_msg(msg)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
|
||||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||||
log.write(str(e))
|
log.write(str(e))
|
||||||
|
Loading…
Reference in New Issue
Block a user