Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
altlinux-packages-bot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Unitsaev
altlinux-packages-bot
Commits
4a0e3e85
Verified
Commit
4a0e3e85
authored
Jul 19, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mews.packages: fix bug and add support for outputting the total number of packages
parent
863d422d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
models.py
src/altrepo/parser/models.py
+1
-0
packages.py
src/altrepo/parser/news/packages.py
+6
-1
packages.py
src/services/news/packages.py
+3
-2
No files found.
src/altrepo/parser/models.py
View file @
4a0e3e85
...
...
@@ -40,6 +40,7 @@ class PackageElementModel(BaseModel):
class
PackagesModel
(
BaseModel
):
url
:
str
total
:
int
added
:
List
[
PackageElementModel
]
|
None
=
None
removed
:
List
[
RemovedPackageElementModel
]
|
None
=
None
updated
:
List
[
PackageElementModel
]
|
None
=
None
src/altrepo/parser/news/packages.py
View file @
4a0e3e85
...
...
@@ -66,7 +66,7 @@ async def packages_parser(html: str, url: str):
continue
match
=
re
.
match
(
r"^(\S+)\s+-\s+(.*)"
,
line
)
if
match
:
if
match
and
not
line
.
startswith
(
"- "
)
:
if
current_package
and
current_section
:
sections
[
current_section
]
.
append
(
current_package
)
...
...
@@ -88,6 +88,11 @@ async def packages_parser(html: str, url: str):
current_package
[
"maintainer_nick"
]
=
match
.
group
(
2
)
.
strip
()
seen_changelog
=
True
continue
match
=
re
.
search
(
r'^Total (\d+) source packages\.$'
,
line
)
if
match
:
sections
[
"total"
]
=
int
(
match
.
group
(
1
))
if
current_package
and
current_section
:
sections
[
current_section
]
.
append
(
current_package
)
...
...
src/services/news/packages.py
View file @
4a0e3e85
...
...
@@ -19,12 +19,12 @@ async def format_packages(packages: PackagesModel, translate: bool | None = None
updated_messages
=
[]
if
packages
.
added
:
added_message
+=
"Добавлены:
\n
"
added_message
+=
f
"Добавлены: {len(packages.added)}
\n
"
for
package
in
packages
.
added
:
added_message
+=
await
_format_package
(
package
,
translate
)
if
packages
.
removed
:
removed_message
+=
"Удалены:
\n
"
removed_message
+=
f
"Удалены: {len(packages.removed)}
\n
"
for
package
in
packages
.
removed
:
removed_message
+=
await
_format_removed_package
(
package
)
removed_message
+=
"
\n
"
...
...
@@ -33,6 +33,7 @@ async def format_packages(packages: PackagesModel, translate: bool | None = None
updated_messages
=
await
_format_updated_packages
(
packages
,
translate
)
info_message
=
(
f
"Всего исходных пакетов: {packages.total}
\n\n
"
"Источник: "
+
HTMLFormatter
(
link
(
packages
.
url
,
text
=
"sisyphus-cybertalk"
))
+
"
\n\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment