python-weather 2.0.2__tar.gz → 2.0.3__tar.gz
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.
- {python_weather-2.0.2/python_weather.egg-info → python_weather-2.0.3}/PKG-INFO +1 -1
- {python_weather-2.0.2 → python_weather-2.0.3}/pyproject.toml +1 -1
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather/__init__.py +1 -1
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather/client.py +5 -8
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather/constants.py +1 -1
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather/enums.py +1 -1
- {python_weather-2.0.2 → python_weather-2.0.3/python_weather.egg-info}/PKG-INFO +1 -1
- {python_weather-2.0.2 → python_weather-2.0.3}/LICENSE +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/MANIFEST.in +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/README.md +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather/base.py +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather/errors.py +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather/forecast.py +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather.egg-info/SOURCES.txt +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather.egg-info/dependency_links.txt +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather.egg-info/requires.txt +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/python_weather.egg-info/top_level.txt +0 -0
- {python_weather-2.0.2 → python_weather-2.0.3}/setup.cfg +0 -0
|
@@ -79,23 +79,20 @@ class Client(CustomizableBase):
|
|
|
79
79
|
locale = self._CustomizableBase__locale
|
|
80
80
|
|
|
81
81
|
subdomain = f'{locale.value}.' if locale != Locale.ENGLISH else ''
|
|
82
|
-
delay = 0
|
|
82
|
+
delay = 0.5
|
|
83
83
|
|
|
84
84
|
while True:
|
|
85
|
-
if delay != 0:
|
|
86
|
-
await sleep(delay)
|
|
87
|
-
delay *= 2
|
|
88
|
-
|
|
89
85
|
async with self.__session.get(
|
|
90
86
|
f'https://{subdomain}wttr.in/{quote_plus(location)}?format=j1'
|
|
91
87
|
) as resp:
|
|
92
88
|
try:
|
|
93
89
|
return Forecast(await resp.json(), unit, locale)
|
|
94
90
|
except Exception as e:
|
|
95
|
-
if delay ==
|
|
91
|
+
if delay == 2:
|
|
96
92
|
raise e # okay, that's too much requests - just raise the error
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
|
|
94
|
+
await sleep(delay)
|
|
95
|
+
delay *= 2
|
|
99
96
|
|
|
100
97
|
async def close(self):
|
|
101
98
|
"""Closes the :class:`Client` object. Nothing will happen if it's already closed."""
|
|
@@ -35,5 +35,5 @@ class _Unit:
|
|
|
35
35
|
METRIC = _Unit('C', 'Kmph', '', 'MM', '', 1)
|
|
36
36
|
IMPERIAL = _Unit('F', 'Miles', 'Inches', 'Inches', 'Miles', 2.54)
|
|
37
37
|
|
|
38
|
-
WIND_DIRECTION_EMOJIS =
|
|
38
|
+
WIND_DIRECTION_EMOJIS = ('↓', '↙', '←', '↖', '↑', '↗', '→', '↘')
|
|
39
39
|
LATLON_REGEX = compile(r'^Lat (\-?[\d\.]+) and Lon (\-?[\d\.]+)$')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|