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

20 lines
421 B
Python
Executable File

#!/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()