pep8
This commit is contained in:
parent
b2bb47b0a2
commit
71c030a82e
@ -27,15 +27,16 @@ class Weather(IntervalModule):
|
|||||||
|
|
||||||
units = "metric"
|
units = "metric"
|
||||||
format = "{current_temp}"
|
format = "{current_temp}"
|
||||||
colorize = None
|
colorize = False
|
||||||
color_icons = {"Fair": (u"\u2600", "#FFCC00"),
|
color_icons = {
|
||||||
"Cloudy": (u"\u2601", "#F8F8FF"),
|
"Fair": (u"\u2600", "#FFCC00"),
|
||||||
"Partly Cloudy": (u"\u2601", "#F8F8FF"), # \u26c5 is not in many fonts
|
"Cloudy": (u"\u2601", "#F8F8FF"),
|
||||||
"Rainy": (u"\u2614", "#CBD2C0"),
|
"Partly Cloudy": (u"\u2601", "#F8F8FF"), # \u26c5 is not in many fonts
|
||||||
"Sunny": (u"\u263C", "#FFFF00"),
|
"Rainy": (u"\u2614", "#CBD2C0"),
|
||||||
"Snow": (u"\u2603", "#FFFFFF"),
|
"Sunny": (u"\u263C", "#FFFF00"),
|
||||||
"default": ("", None),
|
"Snow": (u"\u2603", "#FFFFFF"),
|
||||||
}
|
"default": ("", None),
|
||||||
|
}
|
||||||
|
|
||||||
@require(internet)
|
@require(internet)
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -48,12 +49,12 @@ class Weather(IntervalModule):
|
|||||||
current_temp = "{t}°{d} ".format(t=temperature, d=units["temperature"])
|
current_temp = "{t}°{d} ".format(t=temperature, d=units["temperature"])
|
||||||
|
|
||||||
if self.colorize:
|
if self.colorize:
|
||||||
icon, color = self.color_icons.get(conditions["text"],
|
icon, color = self.color_icons.get(conditions["text"],
|
||||||
self.color_icons["default"])
|
self.color_icons["default"])
|
||||||
current_temp = "{t}°{d} {i}".format(t=temperature,
|
current_temp = "{t}°{d} {i}".format(t=temperature,
|
||||||
d=units["temperature"],
|
d=units["temperature"],
|
||||||
i=icon)
|
i=icon)
|
||||||
color = color
|
color = color
|
||||||
|
|
||||||
self.output = {
|
self.output = {
|
||||||
"full_text": self.format.format(current_temp=current_temp, humidity=humidity),
|
"full_text": self.format.format(current_temp=current_temp, humidity=humidity),
|
||||||
|
Loading…
Reference in New Issue
Block a user