weathergrabber 0.0.3.post1__py3-none-any.whl → 0.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- weathergrabber/adapter/client/weather_api.py +1 -1
- weathergrabber/adapter/tty/waybar_tty.py +3 -3
- weathergrabber/cli.py +3 -1
- weathergrabber/domain/uv_index.py +2 -2
- weathergrabber/weathergrabber_application.py +1 -1
- {weathergrabber-0.0.3.post1.dist-info → weathergrabber-0.0.5.dist-info}/METADATA +1 -1
- {weathergrabber-0.0.3.post1.dist-info → weathergrabber-0.0.5.dist-info}/RECORD +11 -11
- {weathergrabber-0.0.3.post1.dist-info → weathergrabber-0.0.5.dist-info}/WHEEL +0 -0
- {weathergrabber-0.0.3.post1.dist-info → weathergrabber-0.0.5.dist-info}/entry_points.txt +0 -0
- {weathergrabber-0.0.3.post1.dist-info → weathergrabber-0.0.5.dist-info}/licenses/LICENSE +0 -0
- {weathergrabber-0.0.3.post1.dist-info → weathergrabber-0.0.5.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ class WeatherApi:
|
|
|
14
14
|
if location == None:
|
|
15
15
|
url = f"https://weather.com/{language}/weather/today"
|
|
16
16
|
elif len(location) < 64 :
|
|
17
|
-
raise ValueError("Invalid location")
|
|
17
|
+
raise ValueError("Invalid location id")
|
|
18
18
|
|
|
19
19
|
if language == None:
|
|
20
20
|
raise ValueError("language must be specified")
|
|
@@ -72,7 +72,7 @@ class WaybarTTY:
|
|
|
72
72
|
for h in forecast.hourly_predictions
|
|
73
73
|
]
|
|
74
74
|
daily_predictions = [
|
|
75
|
-
f"{d.title}{'\t' if len(d.title) < 5 else ''}\t{d.high_low.high}/<span size='small'>{d.high_low.low}</span>\t{d.icon.fa_icon if is_fa else d.icon.emoji_icon}\t{rain_icon} {d.precipitation.percentage}"
|
|
75
|
+
f"{d.title}{'\t' if len(d.title) < 5 else ''}\t{d.high_low.high}/<span size='small'>{d.high_low.low}</span>\t{'\t' if len(d.title) < 5 else ''}{d.icon.fa_icon if is_fa else d.icon.emoji_icon}\t{rain_icon} {d.precipitation.percentage}"
|
|
76
76
|
for d in forecast.daily_predictions
|
|
77
77
|
]
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ class WaybarTTY:
|
|
|
83
83
|
"\n"
|
|
84
84
|
f"{summary}\n"
|
|
85
85
|
"\n"
|
|
86
|
-
f"{day_temp_label}
|
|
86
|
+
f"{day_temp_label}{day_temp_value} {night_temp_label}{night_temp_value}\t\t {feelslike_icon} {feelslike}\n"
|
|
87
87
|
"\n"
|
|
88
88
|
f"{sunrise_icon} {sunrise_value} • {sunset_icon} {sunset_value}\n"
|
|
89
89
|
"\n"
|
|
@@ -97,7 +97,7 @@ class WaybarTTY:
|
|
|
97
97
|
"\n"
|
|
98
98
|
f"{'\n'.join(daily_predictions)}\n"
|
|
99
99
|
"\n"
|
|
100
|
-
f"<span size='small' style='italic' weight='light'
|
|
100
|
+
f"<span size='small' style='italic' weight='light'>{forecast.current_conditions.timestamp}</span>"
|
|
101
101
|
)
|
|
102
102
|
|
|
103
103
|
waybar_output = {
|
weathergrabber/cli.py
CHANGED
|
@@ -21,7 +21,9 @@ def main_cli():
|
|
|
21
21
|
|
|
22
22
|
# Check for language and location from environment variables if not provided as arguments
|
|
23
23
|
lang = args.lang if args.lang else os.getenv("LANG","en_US.UTF-8").split(".")[0].replace("_","-")
|
|
24
|
-
location_id = args.location_id
|
|
24
|
+
location_id = args.location_id
|
|
25
|
+
if not args.location_id and not args.location_name:
|
|
26
|
+
location_id = os.getenv('WEATHER_LOCATION_ID')
|
|
25
27
|
|
|
26
28
|
main(
|
|
27
29
|
log_level=args.log,
|
|
@@ -38,6 +38,6 @@ class UVIndex:
|
|
|
38
38
|
|
|
39
39
|
def __str__(self) -> str:
|
|
40
40
|
if self.string_value:
|
|
41
|
-
return f"{self.label}
|
|
41
|
+
return f"{self.label} {self.string_value}"
|
|
42
42
|
elif self.index and self.of:
|
|
43
|
-
return f"{self.label}
|
|
43
|
+
return f"{self.label} {self.index} {self.of}" if self.label else f"{self.index} {self.of}"
|
|
@@ -72,7 +72,7 @@ class WeatherGrabberApplication:
|
|
|
72
72
|
self.logger.info("Keep open mode enabled, the application will refresh every 5 minutes")
|
|
73
73
|
while True:
|
|
74
74
|
self.controller.execute(params)
|
|
75
|
-
sleep(
|
|
75
|
+
sleep(1) # Sleep for 5 minutes
|
|
76
76
|
else:
|
|
77
77
|
self.controller.execute(params)
|
|
78
78
|
self.logger.info("WeatherGrabber Application finished")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
weathergrabber/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
weathergrabber/cli.py,sha256=
|
|
2
|
+
weathergrabber/cli.py,sha256=QzBqR4N70W1bSfrSngQAL79vfY8_h8U8s5-LRzzesKo,1970
|
|
3
3
|
weathergrabber/core.py,sha256=TiZ2utmYKf9lkIXWv8YBfSdiHZXJZXuHS8B-dBDvevw,1138
|
|
4
|
-
weathergrabber/weathergrabber_application.py,sha256=
|
|
5
|
-
weathergrabber/adapter/client/weather_api.py,sha256=
|
|
4
|
+
weathergrabber/weathergrabber_application.py,sha256=2JfZAR94En3rmGrYKWRKxdRXmK_ikhJdgrGotFjtDys,3987
|
|
5
|
+
weathergrabber/adapter/client/weather_api.py,sha256=9S7JmXaAVvvPY60dz6rC3lx7X68BcqyvNzvSVM1-af8,963
|
|
6
6
|
weathergrabber/adapter/client/weather_search_api.py,sha256=1oy7JitHcmwkkhFlD0eIt5A7a4cGbf7LMNi26tR8z5o,1724
|
|
7
7
|
weathergrabber/adapter/tty/console_tty.py,sha256=B5BaAEqpP7aXIxzzBQv47qWcQFRSWo47tQ1Lxa9cbq0,4972
|
|
8
8
|
weathergrabber/adapter/tty/json_tty.py,sha256=ZRZSfVhFYsb8AXD1qjb1GBpaRMxHGNaMXW5VN8AvdaU,647
|
|
9
|
-
weathergrabber/adapter/tty/waybar_tty.py,sha256=
|
|
9
|
+
weathergrabber/adapter/tty/waybar_tty.py,sha256=sKD_86ZCyBRqpmXkRPgNy9ipGYbd1E6SgDFTEV-TZw8,5312
|
|
10
10
|
weathergrabber/domain/air_quality_index.py,sha256=eH1glUdedtbRCZMcw5_zB5ybJQUcyY-EBMxL8vVJ6zA,2791
|
|
11
11
|
weathergrabber/domain/city_location.py,sha256=usXijW59uI1RhgmR9QO6L9ttIkbzwqtwJAsRgaTbYaw,1209
|
|
12
12
|
weathergrabber/domain/color.py,sha256=dkWZnQ2BjXUV8qTfZnmNGng_cqKtKuDdekYw4R2NJ9U,1080
|
|
@@ -25,7 +25,7 @@ weathergrabber/domain/sunrise_sunset.py,sha256=wNTk01NIuLbQ7gN_giAFv4f3FaRx9khul
|
|
|
25
25
|
weathergrabber/domain/temperature_hight_low.py,sha256=PQOJ5uDtfMRBR5yMxXA46xuorJC08jva2C0-WAV5yxs,909
|
|
26
26
|
weathergrabber/domain/timestamp.py,sha256=tbUdTiWUf1mKhVq9SESeFGlu_sZ2FdmQCb1gr7u9I0c,1032
|
|
27
27
|
weathergrabber/domain/today_details.py,sha256=EUlV7xerYw5QhEsBfvO5m6-9Ghm4nPkXJz9zCmSYTbA,2398
|
|
28
|
-
weathergrabber/domain/uv_index.py,sha256=
|
|
28
|
+
weathergrabber/domain/uv_index.py,sha256=lNdk38Jq-A9msuzOLjIKrZIHUc2C9J8V4MA7HU3s1ZM,1420
|
|
29
29
|
weathergrabber/domain/weather_icon_enum.py,sha256=xAyZxEDjIBHzy4WIgcWEw3vhDlL8uVJIL3piG9dNcr0,2309
|
|
30
30
|
weathergrabber/domain/wind.py,sha256=wTDz3X1rYsnw_eNoDi1miwaomxwhiJkY_q6xrdZtLak,789
|
|
31
31
|
weathergrabber/domain/adapter/icon_enum.py,sha256=YxGYS5vBRV2AiAfeuPOdqaQOHixAssiMbOzQnTmdSBg,84
|
|
@@ -63,9 +63,9 @@ weathergrabber/service/extract_today_details_service.py,sha256=QAwF7EzVaL1STGNDy
|
|
|
63
63
|
weathergrabber/service/read_weather_service.py,sha256=7_B8E9IN1KCwOhpuS5PfWazI1sCrDyYrZhkV2R38bhc,649
|
|
64
64
|
weathergrabber/service/search_location_service.py,sha256=tZmVgO45hjwoa4cl5bKPjMBmYlGxJiH_I9Ymb5pwEwU,1422
|
|
65
65
|
weathergrabber/usecase/use_case.py,sha256=wmNmJSiy0t00-KaxQqSryiu0keX0kI4PcLI2hBBHT_0,4460
|
|
66
|
-
weathergrabber-0.0.
|
|
67
|
-
weathergrabber-0.0.
|
|
68
|
-
weathergrabber-0.0.
|
|
69
|
-
weathergrabber-0.0.
|
|
70
|
-
weathergrabber-0.0.
|
|
71
|
-
weathergrabber-0.0.
|
|
66
|
+
weathergrabber-0.0.5.dist-info/licenses/LICENSE,sha256=X5JFljoqN43yFwpMLudQ9rtty4K_FeZfnz3v8Yhw23Q,1067
|
|
67
|
+
weathergrabber-0.0.5.dist-info/METADATA,sha256=JxbSJPXXJ0kNcWteb6kfDdBNEwq-I_gU7yhkiB88z64,5440
|
|
68
|
+
weathergrabber-0.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
69
|
+
weathergrabber-0.0.5.dist-info/entry_points.txt,sha256=m2P9a4mrJDTzuNaiTU438NA60GxCfaw7VKvruWw43N8,63
|
|
70
|
+
weathergrabber-0.0.5.dist-info/top_level.txt,sha256=P3NMDJJYRIvQujf994Vb4gZrobkKWkL2gh3NF_ajQWM,15
|
|
71
|
+
weathergrabber-0.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|