dotfiles/.config/polybar/scripts/weather/wthr

20 lines
421 B
Plaintext
Raw Normal View History

2022-10-21 06:15:28 -04:00
#!/usr/bin/env python3
from location import get_location
from weather import get_weather
from formatter import format_weather
import exceptions
def main() -> None:
try:
loc = get_location()
weather = get_weather(loc)
except exceptions.ApiServiceError:
print("%{F#f7768e}API Service ERROR%{F-}")
return
print(format_weather(weather))
if __name__ == '__main__':
main()