mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-04 07:14:21 +02:00
polybar-weather: try harder to wait to be online
This commit is contained in:
parent
481b258fe0
commit
6b0c7b4c1d
1 changed files with 15 additions and 14 deletions
|
@ -133,8 +133,10 @@ if __name__ == "__main__":
|
|||
|
||||
try:
|
||||
# Get location
|
||||
while True:
|
||||
try:
|
||||
location, city = get_location()
|
||||
break
|
||||
except requests.exceptions.ConnectionError:
|
||||
# Wait to be online
|
||||
logger.info("not online, waiting")
|
||||
|
@ -146,7 +148,6 @@ if __name__ == "__main__":
|
|||
if process.returncode != 0:
|
||||
logger.warning("not online, exiting")
|
||||
sys.exit(1)
|
||||
location, city = get_location()
|
||||
|
||||
# Grab current weather and daily forecast
|
||||
weather = get_weather(options.owm_api_key, *location)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue