SalaniLeo / Forecast

⛅ Weather app for Linux made in LibAdwaita
http://forecast.salanileo.dev/
GNU General Public License v3.0
30 stars 9 forks source link

Forecast fails with errors when 12 hour time selected in preferences #39

Closed rdh76 closed 1 week ago

rdh76 commented 2 weeks ago

Excellent app. Information presented very clearly. I have one issue and one enhancement.

  1. Can you add Dew Point to the Conditions details? Thank you.
  2. When I select 12 hour time, the following errors are thrown. The app only works for 24 hour time. I am running ubuntu 24.04

Exception in thread Thread-1 (fill_weather): Traceback (most recent call last): File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/usr/lib/python3.11/threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "/app/lib/python3.11/site-packages/Forecast/page.py", line 109, in fill_weather box.append(city_page(app, city)) ^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/Forecast/page.py", line 52, in init hourly_forecast_box = components.hourly_forecast(meteo, hourly) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/Forecast/page.py", line 365, in hourly_forecast time = int(converters.convert_time(meteo["timezone_offset"])[:2]) + i ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '6:'

SalaniLeo commented 2 weeks ago

Hey! Thanks for sharing the error, can you please also share the location (or is it for anywhere)? Because I already knew about some errors with 12 hour time, but I can't replicate it in any way...

SalaniLeo commented 2 weeks ago

It should be solved in #40, idk why cities in the us didn't work but for the rest of the world did, everything should work now. It was some bad code I wrote for the conversion :P.