Compare commits
2
Commits
0.10.7
...
32956af5f0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32956af5f0 | ||
|
|
57112793e7 |
@@ -29,6 +29,7 @@ def cloudness_icon(sky: Sky, date: datetime.datetime, period: str) -> list[str]:
|
|||||||
Precipitation.RAIN: "thunderstorm",
|
Precipitation.RAIN: "thunderstorm",
|
||||||
Precipitation.HEAVY_RAIN: "thunderstorm",
|
Precipitation.HEAVY_RAIN: "thunderstorm",
|
||||||
Precipitation.SHOWER: "thunderstorm",
|
Precipitation.SHOWER: "thunderstorm",
|
||||||
|
Precipitation.SMALL_SNOW: "storm-showers",
|
||||||
Precipitation.SNOW: "storm-showers",
|
Precipitation.SNOW: "storm-showers",
|
||||||
Precipitation.HEAVY_SNOW: "storm-showers",
|
Precipitation.HEAVY_SNOW: "storm-showers",
|
||||||
}[sky.precipitation]
|
}[sky.precipitation]
|
||||||
@@ -47,6 +48,7 @@ def cloudness_icon(sky: Sky, date: datetime.datetime, period: str) -> list[str]:
|
|||||||
Precipitation.RAIN: "rain-mix",
|
Precipitation.RAIN: "rain-mix",
|
||||||
Precipitation.HEAVY_RAIN: "rain",
|
Precipitation.HEAVY_RAIN: "rain",
|
||||||
Precipitation.SHOWER: "rain",
|
Precipitation.SHOWER: "rain",
|
||||||
|
Precipitation.SMALL_SNOW: "snow",
|
||||||
Precipitation.SNOW: "snow",
|
Precipitation.SNOW: "snow",
|
||||||
Precipitation.HEAVY_SNOW: "snow",
|
Precipitation.HEAVY_SNOW: "snow",
|
||||||
Precipitation.HAIL: "hail",
|
Precipitation.HAIL: "hail",
|
||||||
|
|||||||
@@ -86,6 +86,10 @@ class PrecipitationParser(TableValueParser[tuple[Precipitation, float]]):
|
|||||||
"Явления погоды отсутствуют": Precipitation.NO,
|
"Явления погоды отсутствуют": Precipitation.NO,
|
||||||
"Cлабый дождь": Precipitation.SMALL_RAIN,
|
"Cлабый дождь": Precipitation.SMALL_RAIN,
|
||||||
"Умеренный дождь": Precipitation.RAIN,
|
"Умеренный дождь": Precipitation.RAIN,
|
||||||
|
"Cлабый дождь со снегом": Precipitation.SMALL_SNOW,
|
||||||
|
"Слабый снег с дождём": Precipitation.SMALL_SNOW,
|
||||||
|
"Cлабый снег": Precipitation.SMALL_SNOW,
|
||||||
|
"Снег": Precipitation.SNOW,
|
||||||
}
|
}
|
||||||
|
|
||||||
def extract(self, data: Tag) -> tuple[Precipitation, float]:
|
def extract(self, data: Tag) -> tuple[Precipitation, float]:
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class TemperatureParser(TableValueParser[list[int]]):
|
|||||||
model_key = "temperature"
|
model_key = "temperature"
|
||||||
|
|
||||||
def extract(self, data: Tag) -> list[int]:
|
def extract(self, data: Tag) -> list[int]:
|
||||||
return [int(data.text.strip().rstrip("°"))]
|
return [int(data.text.strip().rstrip("°").replace("−", "-"))]
|
||||||
|
|
||||||
|
|
||||||
class SkyParser(TableValueParser[Sky]):
|
class SkyParser(TableValueParser[Sky]):
|
||||||
@@ -79,6 +79,8 @@ class SkyParser(TableValueParser[Sky]):
|
|||||||
"небольшой дождь": Precipitation.SMALL_RAIN,
|
"небольшой дождь": Precipitation.SMALL_RAIN,
|
||||||
"дождь": Precipitation.RAIN,
|
"дождь": Precipitation.RAIN,
|
||||||
"ливень": Precipitation.SHOWER,
|
"ливень": Precipitation.SHOWER,
|
||||||
|
"дождь со снегом": Precipitation.SNOW,
|
||||||
|
"снег": Precipitation.SNOW,
|
||||||
}
|
}
|
||||||
|
|
||||||
def extract(self, data: Tag) -> Sky:
|
def extract(self, data: Tag) -> Sky:
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class Precipitation(StrEnum):
|
|||||||
RAIN = auto()
|
RAIN = auto()
|
||||||
HEAVY_RAIN = auto()
|
HEAVY_RAIN = auto()
|
||||||
SHOWER = auto()
|
SHOWER = auto()
|
||||||
|
SMALL_SNOW = auto()
|
||||||
SNOW = auto()
|
SNOW = auto()
|
||||||
HEAVY_SNOW = auto()
|
HEAVY_SNOW = auto()
|
||||||
HAIL = auto()
|
HAIL = auto()
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "gallery"
|
name = "gallery"
|
||||||
description = ""
|
description = ""
|
||||||
version = "0.10.7"
|
version = "0.10.8"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [{ name = "shmyga", email = "shmyga.z@gmail.com" }]
|
authors = [{ name = "shmyga", email = "shmyga.z@gmail.com" }]
|
||||||
requires-python = ">=3.14,<4.0"
|
requires-python = ">=3.14,<4.0"
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "gallery",
|
"name": "gallery",
|
||||||
"version": "0.10.7",
|
"version": "0.10.8",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "gallery",
|
"name": "gallery",
|
||||||
"version": "0.10.7",
|
"version": "0.10.8",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@popperjs/core": "^2.11.8",
|
"@popperjs/core": "^2.11.8",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gallery",
|
"name": "gallery",
|
||||||
"version": "0.10.7",
|
"version": "0.10.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --mode production",
|
"build": "webpack --mode production",
|
||||||
|
|||||||
Reference in New Issue
Block a user