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
262d2b5e
Verified
Commit
262d2b5e
authored
Dec 16, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
watch: show packages updated but not published yet
parent
7a9e8d8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
20 deletions
+37
-20
watch.py
src/services/watch.py
+37
-20
No files found.
src/services/watch.py
View file @
262d2b5e
from
telegrinder.tools.formatting
import
HTMLFormatter
from
config
import
tg_api
from
config
import
TASK_URL
from
altrepo
import
altrepo
...
...
@@ -15,27 +16,25 @@ async def watch(
maintainer
:
str
|
None
=
None
,
acl
:
str
|
None
=
None
)
->
None
:
chat_id
=
chat_id
or
user
.
user_id
if
chat_id
is
None
:
if
user
is
None
:
return
chat_id
=
user
.
user_id
if
maintainer
:
maintainer
=
maintainer
.
lower
()
_maintainer
=
DB
.
maintainer
.
get
(
maintainer
)
if
not
_maintainer
:
await
tg_api
.
send_message
(
chat_id
=
chat_id
,
text
=
f
"Сопровождающий не найден."
)
if
not
DB
.
maintainer
.
get
(
maintainer
):
await
tg_api
.
send_message
(
chat_id
,
"Сопровождающий не найден."
)
return
elif
user
:
maintainer
=
user
.
maintainer
.
nickname
else
:
if
user
:
maintainer
=
user
.
maintainer
.
nickname
else
:
return
return
acl
=
acl
or
"by-acl"
watch_data
=
await
altrepo
.
parser
.
packages
.
watch_by_maintainer
(
maintainer
,
acl
)
if
not
len
(
watch_data
)
:
if
not
watch_data
:
await
tg_api
.
send_message
(
chat_id
=
chat_id
,
text
=
f
"Нет устаревших пакетов."
...
...
@@ -51,15 +50,33 @@ async def watch(
packages
[
name
]
=
package
packages
=
list
(
packages
.
values
())
for
i
,
package
in
enumerate
(
packages
):
if
i
==
30
:
break
watch_message
+=
(
for
package
in
packages
[:
30
]:
crossed
=
False
updated_in_task_message
=
""
for
status
in
[
"DONE"
,
"EPERM"
]:
try
:
data
=
await
altrepo
.
api
.
task
.
progress
.
find_tasks
(
input
=
[
package
.
pkg_name
,
"sisyphus"
,
package
.
new_version
,
status
]
)
task_id
=
data
.
tasks
[
0
]
.
task_id
updated_in_task_message
=
(
f
" (<a href='{TASK_URL}{task_id}'>{task_id}/{status}</a>)"
)
crossed
=
True
break
except
:
crossed
=
False
continue
prefix
=
"<s>"
if
crossed
else
""
suffix
=
"</s>"
if
crossed
else
""
watch_message
+=
HTMLFormatter
(
f
"{prefix}"
f
"{package.pkg_name}: {package.old_version} -> "
+
HTMLFormatter
(
f
"<a href='{package.url.replace("
.
git
/
", "
/
")}'>{package.new_version}</a>"
)
+
"
\n
"
f
"<a href='{package.url.replace("
.
git
/
", "
/
")}'>{package.new_version}</a>"
f
"{suffix}"
f
"{updated_in_task_message}
\n
"
)
markup
=
None
...
...
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