altrepo.parser.news: fix the locale

parent d4ab07bd
...@@ -32,7 +32,7 @@ class NewsInfo: ...@@ -32,7 +32,7 @@ class NewsInfo:
html = await self.client.get(f"{base_url}date.html", "koi8-r") html = await self.client.get(f"{base_url}date.html", "koi8-r")
soup = BeautifulSoup(html, "html.parser") soup = BeautifulSoup(html, "html.parser")
sisyphus_id = -1 sisyphus_id = 0
result = {"sisyphus": None, "bugs": None, "p11": None} result = {"sisyphus": None, "bugs": None, "p11": None}
for li in soup.find_all("li"): for li in soup.find_all("li"):
...@@ -54,8 +54,9 @@ class NewsInfo: ...@@ -54,8 +54,9 @@ class NewsInfo:
sisyphus_id = msg_id sisyphus_id = msg_id
elif f"Sisyphus-{today_str} bugs" in text: elif f"Sisyphus-{today_str} bugs" in text:
result["bugs"] = url result["bugs"] = url
elif "p11/branch packages" in text and msg_id > sisyphus_id: elif "p11/branch packages" in text and sisyphus_id:
result["p11"] = url if msg_id > sisyphus_id:
result["p11"] = url
if result["sisyphus"] is None: if result["sisyphus"] is None:
result["p11"] = None result["p11"] = None
......
...@@ -29,10 +29,8 @@ async def statistics_handler(m: Message, user: User | None, branch: str | None = ...@@ -29,10 +29,8 @@ async def statistics_handler(m: Message, user: User | None, branch: str | None =
statistics_data = (await altrepo.api.packageset.repository_statistics(branch)).branches[0] statistics_data = (await altrepo.api.packageset.repository_statistics(branch)).branches[0]
locale.setlocale(locale.LC_TIME, 'ru_RU.UTF-8')
statistics_date = (datetime.fromisoformat( statistics_date = (datetime.fromisoformat(
statistics_data.date_update)).strftime("%-d %B %Y г.") statistics_data.date_update)).strftime("%F")
if "_" in statistics_data.branch: if "_" in statistics_data.branch:
branch, arch = statistics_data.branch.split("_") branch, arch = statistics_data.branch.split("_")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment