Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
queenkjuul committed Nov 22, 2024
1 parent 1606304 commit bfe2edb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/util/weather_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ForecastData:

@dataclass
class Precipitation:
type: str # should be in PRECIPITATION_TYPES
type: PrecipitationTypes
# /** in mm */
volume: Optional[float] = None
# /** % */
Expand Down
14 changes: 7 additions & 7 deletions src/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def __init__(self, initial_monitor=0, low_res=False):
big_box = Gtk.Box(Gtk.Orientation.HORIZONTAL)
self.add(big_box)
big_box.show()
self.icon_size = ICON_SIZE

# icon
self.icon_size = ICON_SIZE
self.condition_icon = Gtk.Image()
self.condition_icon.set_size_request(self.icon_size, self.icon_size)
big_box.pack_start(self.condition_icon, False, False, 6)
Expand Down Expand Up @@ -90,12 +90,12 @@ def get_location(self):
return LocationData(lat, lon)

def update_weather(self):
message_font = Pango.FontDescription.from_string(settings.get_message_font())
desc_font = Pango.FontDescription.from_string(settings.get_message_font())
weather_font = Pango.FontDescription.from_string(settings.get_weather_font())

if self.low_res:
msg_size = message_font.get_size() * 0.66
message_font.set_size(int(msg_size))
desc_size = desc_font.get_size() * 0.66
desc_font.set_size(int(desc_size))

weather_data = self.weather_provider.GetWeather(self.location)

Expand All @@ -107,15 +107,15 @@ def update_weather(self):
else weather_data.temp_c()
)
temp_string = str(round(temp))
default_message = (
desc_message = (
weather_data.condition.description.title()
+ in_str
+ weather_data.location.city.capitalize()
)

markup = '<b><span font_desc="%s" foreground="#CCCCCC">%s</span></b>\n ' % (
message_font.to_string(),
default_message,
desc_font.to_string(),
desc_message,
)

self.temp_label.set_markup(
Expand Down

0 comments on commit bfe2edb

Please sign in to comment.