Flake8 Linting

master
Tim 2020-02-16 17:55:32 +11:00
parent 06df5037fe
commit 925c38feb4
1 changed files with 31 additions and 12 deletions

View File

@ -246,7 +246,8 @@ class PiDisplay(PiWeather):
exit()
self.display.UpdateImg("WeatherIcon", self.which_icon(str(self.lookup["weather_code"])+".png"))
self.display.UpdateText("LineOne", self.lookup["weather_type"], fontPath='/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf')
self.display.UpdateText("LineOne", self.lookup["weather_type"],
fontPath='/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf')
self.display.UpdateText("LineFive", "{}".format(self.get_fact()))
if self.config["forecast"]["enabled"]:
@ -264,27 +265,45 @@ class PiDisplay(PiWeather):
self.display.UpdateText(
"ForecastSix", self.get_day(self.lookup["forecast"][6]["date"]))
self.display.UpdateImg("ForecastIconOne", self.which_icon(str(self.lookup["forecast"][1]["icon_descriptor"])+'.png'))
self.display.UpdateImg("ForecastIconTwo", self.which_icon(str(self.lookup["forecast"][2]["icon_descriptor"])+'.png'))
self.display.UpdateImg("ForecastIconThree", self.which_icon(str(self.lookup["forecast"][3]["icon_descriptor"])+'.png'))
self.display.UpdateImg("ForecastIconFour", self.which_icon(str(self.lookup["forecast"][4]["icon_descriptor"])+'.png'))
self.display.UpdateImg("ForecastIconFive", self.which_icon(str(self.lookup["forecast"][5]["icon_descriptor"])+'.png'))
self.display.UpdateImg("ForecastIconSix", self.which_icon(str(self.lookup["forecast"][6]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconOne",
self.which_icon(str(self.lookup["forecast"][1]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconTwo",
self.which_icon(str(self.lookup["forecast"][2]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconThree",
self.which_icon(str(self.lookup["forecast"][3]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconFour",
self.which_icon(str(self.lookup["forecast"][4]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconFive",
self.which_icon(str(self.lookup["forecast"][5]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconSix",
self.which_icon(str(self.lookup["forecast"][6]["icon_descriptor"])+'.png'))
else:
self.display.UpdateText(
"ForecastOne", "Today: "+self.lookup["forecast"][0]["short_text"])
self.display.UpdateText(
"ForecastTwo", "Tomorrow: "+self.lookup["forecast"][1]["short_text"])
self.display.UpdateImg("ForecastIconOne", self.which_icon(str(self.lookup["forecast"][1]["icon_descriptor"])+'.png'))
self.display.UpdateImg("ForecastIconTwo", self.which_icon(str(self.lookup["forecast"][2]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconOne",
self.which_icon(str(self.lookup["forecast"][1]["icon_descriptor"])+'.png'))
self.display.UpdateImg(
"ForecastIconTwo",
self.which_icon(str(self.lookup["forecast"][2]["icon_descriptor"])+'.png'))
for stat in self.order:
if stat == "temperature":
self.display.UpdateText("LineTwo", "Now Temp: "+self.lookup[stat],
fontPath='/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf')
self.display.UpdateText(
"LineThree", "Low: {} -> High: {}".format(self.lookup["forecast"][0]["temp_min"], self.lookup["forecast"][0]["temp_max"]),
"LineTwo", "Now Temp: "+self.lookup[stat],
fontPath='/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf')
self.display.UpdateText(
"LineThree", "Low: {} -> High: {}".format(
self.lookup["forecast"][0]["temp_min"], self.lookup["forecast"][0]["temp_max"]),
fontPath='/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf')
elif stat == "chance":
if self.lookup[stat] == "None%":