Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe368da

Browse files
committed
fix(weather): hide widget when API key or location is missing
1 parent0777216 commitbe368da

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎src/core/widgets/yasb/weather.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def __init__(
4343
self._api_key=api_keyifapi_key!='env'elseos.getenv('YASB_WEATHER_API_KEY')
4444
ifnotself._api_keyornotself._location:
4545
logging.error("API key or location is missing. Please provide a valid API key and location.")
46+
self.hide()
4647
return
4748
self.api_url=f"http://api.weatherapi.com/v1/forecast.json?key={self._api_key}&q={urllib.parse.quote(self._location)}&days=3&aqi=no&alerts=yes"
4849
self._units=units

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp