Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python3-module-altrepo
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
python3-module-altrepo
Commits
8574c6eb
Verified
Commit
8574c6eb
authored
Apr 03, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: add StrEnum types for method parameters
parent
e28c926f
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
221 additions
and
133 deletions
+221
-133
README.md
README.md
+15
-12
methods.py
altrepo/api/methods.py
+104
-103
types.py
altrepo/api/types.py
+76
-0
acl_and_groups.py
examples/acl_and_groups.py
+2
-1
api_packages.py
examples/api_packages.py
+3
-4
api_tasks.py
examples/api_tasks.py
+2
-3
appstream.py
examples/appstream.py
+2
-1
backport_helper.py
examples/backport_helper.py
+2
-1
branch_compare.py
examples/branch_compare.py
+2
-1
errata_updates.py
examples/errata_updates.py
+2
-1
images.py
examples/images.py
+2
-1
maintainer_dashboard.py
examples/maintainer_dashboard.py
+3
-2
package_dependencies.py
examples/package_dependencies.py
+2
-1
package_files.py
examples/package_files.py
+2
-1
security_audit.py
examples/security_audit.py
+2
-1
No files found.
README.md
View file @
8574c6eb
...
@@ -24,12 +24,13 @@ pip3 install altrepo
...
@@ -24,12 +24,13 @@ pip3 install altrepo
```
python
```
python
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
client
=
ALTRepo
()
client
=
ALTRepo
()
await
client
.
init
()
await
client
.
init
()
result
=
await
client
.
api
.
package
.
package_info
(
"
vim"
,
branch
=
"sisyphus"
)
result
=
await
client
.
api
.
package
.
package_info
(
"
firefox"
,
branch
=
Branch
.
sisyphus
)
pkg
=
result
.
packages
[
0
]
pkg
=
result
.
packages
[
0
]
print
(
f
"{pkg.name} {pkg.version}-{pkg.release}"
)
print
(
f
"{pkg.name} {pkg.version}-{pkg.release}"
)
...
@@ -45,15 +46,17 @@ asyncio.run(main())
...
@@ -45,15 +46,17 @@ asyncio.run(main())
Получение подробной информации о пакете и поиск по имени:
Получение подробной информации о пакете и поиск по имени:
```
python
```
python
from
altrepo.api.types
import
Branch
# Информация о конкретном пакете
# Информация о конкретном пакете
result
=
await
client
.
api
.
package
.
package_info
(
"firefox"
,
branch
=
"sisyphus"
)
result
=
await
client
.
api
.
package
.
package_info
(
"firefox"
,
branch
=
Branch
.
sisyphus
)
pkg
=
result
.
packages
[
0
]
pkg
=
result
.
packages
[
0
]
print
(
f
"{pkg.name} {pkg.version}-{pkg.release} ({pkg.summary})"
)
print
(
f
"{pkg.name} {pkg.version}-{pkg.release} ({pkg.summary})"
)
# Поиск пакетов по подстроке в имени
# Поиск пакетов по подстроке в имени
result
=
await
client
.
api
.
package
.
package_search
(
"python3-module"
,
branch
=
"sisyphus"
)
found
=
await
client
.
api
.
site
.
find_packages
(
"python3-module-alt"
,
branch
=
Branch
.
sisyphus
)
for
pkg
in
result
.
packages
[:
10
]:
for
pkg
in
found
.
packages
[:
10
]:
print
(
f
" {pkg.name}
: {pkg.summary}
"
)
print
(
f
" {pkg.name}"
)
```
```
### Задачи и мейнтейнеры
### Задачи и мейнтейнеры
...
@@ -61,18 +64,20 @@ for pkg in result.packages[:10]:
...
@@ -61,18 +64,20 @@ for pkg in result.packages[:10]:
Поиск задач по мейнтейнеру или по имени пакета:
Поиск задач по мейнтейнеру или по имени пакета:
```
python
```
python
from
altrepo.api.types
import
Branch
# Задачи мейнтейнера
# Задачи мейнтейнера
result
=
await
client
.
api
.
task
.
find_tasks
(
result
=
await
client
.
api
.
task
.
progress
.
find_tasks
(
input
=
[
"fiersik"
],
branch
=
"sisyphus"
,
by_package
=
False
input
=
[
"fiersik"
],
branch
=
Branch
.
sisyphus
,
by_package
=
False
)
)
for
task
in
result
.
tasks
[:
5
]:
for
task
in
result
.
tasks
[:
5
]:
print
(
f
" #{task.task_id} [{task.
state}] {task.
owner}"
)
print
(
f
" #{task.task_id} [{task.
task_state}] {task.task_
owner}"
)
# Баги мейнтейнера из Bugzilla
# Баги мейнтейнера из Bugzilla
bugs
=
await
client
.
api
.
bug
.
bugzilla_by_maintainer
(
"fiersik"
)
bugs
=
await
client
.
api
.
bug
.
bugzilla_by_maintainer
(
"fiersik"
)
if
bugs
:
if
bugs
:
for
bug
in
bugs
.
bugs
[:
5
]:
for
bug
in
bugs
.
bugs
[:
5
]:
print
(
f
" #{bug.
bug_
id} {bug.status}: {bug.summary}"
)
print
(
f
" #{bug.id} {bug.status}: {bug.summary}"
)
```
```
### Отслеживание устаревших пакетов
### Отслеживание устаревших пакетов
...
@@ -85,8 +90,7 @@ watch = await client.parser.packages.watch_by_maintainer("fiersik", "by-acl")
...
@@ -85,8 +90,7 @@ watch = await client.parser.packages.watch_by_maintainer("fiersik", "by-acl")
for
pkg
in
watch
[:
5
]:
for
pkg
in
watch
[:
5
]:
print
(
f
" {pkg.pkg_name}: {pkg.old_version} -> {pkg.new_version}"
)
print
(
f
" {pkg.pkg_name}: {pkg.old_version} -> {pkg.new_version}"
)
# Полный список устаревших пакетов по всему репозиторию
# Полный список устаревших пакетов
# Каждая запись содержит имя мейнтейнера (или группы с префиксом @)
total
=
await
client
.
parser
.
packages
.
watch_total
()
total
=
await
client
.
parser
.
packages
.
watch_total
()
print
(
f
"Всего устаревших пакетов: {len(total)}"
)
print
(
f
"Всего устаревших пакетов: {len(total)}"
)
```
```
...
@@ -160,7 +164,6 @@ for pkg in ftbfs[:5]:
...
@@ -160,7 +164,6 @@ for pkg in ftbfs[:5]:
from
altrepo
import
ALTRepo
,
ALTRepoConfig
from
altrepo
import
ALTRepo
,
ALTRepoConfig
config
=
ALTRepoConfig
(
config
=
ALTRepoConfig
(
api_base_url
=
"https://rdb.altlinux.org/api"
,
appstream_dir
=
"/tmp/appstream"
,
appstream_dir
=
"/tmp/appstream"
,
appstream_branches
=
[
"sisyphus"
,
"p11"
,
"p10"
],
appstream_branches
=
[
"sisyphus"
,
"p11"
,
"p10"
],
)
)
...
...
altrepo/api/methods.py
View file @
8574c6eb
...
@@ -2,10 +2,11 @@ import aiohttp
...
@@ -2,10 +2,11 @@ import aiohttp
from
urllib.parse
import
urlencode
from
urllib.parse
import
urlencode
from
warnings
import
deprecated
from
warnings
import
deprecated
from
typing
import
List
,
Literal
from
typing
import
List
from
.
import
models
from
.
import
models
from
.
import
errors
from
.
import
errors
from
.
import
types
class
BaseAPI
:
class
BaseAPI
:
...
@@ -103,7 +104,7 @@ class TaskProcessInfo:
...
@@ -103,7 +104,7 @@ class TaskProcessInfo:
self
,
self
,
input
:
list
[
str
],
input
:
list
[
str
],
owner
:
str
|
None
=
None
,
owner
:
str
|
None
=
None
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
state
:
list
[
str
]
|
None
=
None
,
state
:
list
[
str
]
|
None
=
None
,
tasks_limit
:
int
=
100
,
tasks_limit
:
int
=
100
,
by_package
:
bool
=
False
,
by_package
:
bool
=
False
,
...
@@ -138,7 +139,7 @@ class TaskProcessInfo:
...
@@ -138,7 +139,7 @@ class TaskProcessInfo:
async
def
find_tasks_lookup
(
async
def
find_tasks_lookup
(
self
,
self
,
input
:
list
[
str
],
input
:
list
[
str
],
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
tasks_limit
:
int
=
10
,
tasks_limit
:
int
=
10
,
)
->
models
.
FindTasksModel
:
)
->
models
.
FindTasksModel
:
params
=
{
params
=
{
...
@@ -154,7 +155,7 @@ class TaskProcessInfo:
...
@@ -154,7 +155,7 @@ class TaskProcessInfo:
return
models
.
FindTasksModel
(
**
data
)
return
models
.
FindTasksModel
(
**
data
)
async
def
last_tasks
(
async
def
last_tasks
(
self
,
branch
:
str
|
None
=
None
,
tasks_limit
:
int
=
10
self
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
tasks_limit
:
int
=
10
)
->
models
.
TasksListModel
:
)
->
models
.
TasksListModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -218,7 +219,7 @@ class TaskInfo:
...
@@ -218,7 +219,7 @@ class TaskInfo:
async
def
needs_approval
(
async
def
needs_approval
(
self
,
self
,
acl_group
:
Literal
[
"maint"
,
"tester"
]
,
acl_group
:
types
.
ApprovalGroup
,
branches
:
list
[
str
]
|
None
=
None
,
branches
:
list
[
str
]
|
None
=
None
,
before
:
str
|
None
=
None
,
before
:
str
|
None
=
None
,
)
->
models
.
NeedsApprovalModel
:
)
->
models
.
NeedsApprovalModel
:
...
@@ -244,7 +245,7 @@ class TaskInfo:
...
@@ -244,7 +245,7 @@ class TaskInfo:
async
def
task_history
(
async
def
task_history
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
start_task
:
int
=
0
,
start_task
:
int
=
0
,
end_task
:
int
=
0
,
end_task
:
int
=
0
,
start_date
:
str
|
None
=
None
,
start_date
:
str
|
None
=
None
,
...
@@ -298,7 +299,7 @@ class TaskInfo:
...
@@ -298,7 +299,7 @@ class TaskInfo:
self
,
self
,
task_id
:
int
,
task_id
:
int
,
depth
:
int
=
1
,
depth
:
int
=
1
,
dptype
:
Literal
[
"both"
,
"source"
,
"binary"
]
=
"both"
,
dptype
:
types
.
DependencyType
=
"both"
,
archs
:
list
[
str
]
|
None
=
None
,
archs
:
list
[
str
]
|
None
=
None
,
leaf
:
str
|
None
=
None
,
leaf
:
str
|
None
=
None
,
finite_package
:
bool
=
False
,
finite_package
:
bool
=
False
,
...
@@ -339,7 +340,7 @@ class PackageInfo:
...
@@ -339,7 +340,7 @@ class PackageInfo:
release
:
str
|
None
=
None
,
release
:
str
|
None
=
None
,
arch
:
str
|
None
=
None
,
arch
:
str
|
None
=
None
,
source
:
bool
|
None
=
None
,
source
:
bool
|
None
=
None
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
disttag
:
str
|
None
=
None
,
disttag
:
str
|
None
=
None
,
sha1
:
str
|
None
=
None
,
sha1
:
str
|
None
=
None
,
packager
:
str
|
None
=
None
,
packager
:
str
|
None
=
None
,
...
@@ -367,7 +368,7 @@ class PackageInfo:
...
@@ -367,7 +368,7 @@ class PackageInfo:
return
models
.
PackageInfoModel
(
**
data
)
return
models
.
PackageInfoModel
(
**
data
)
async
def
packages_by_file_names
(
async
def
packages_by_file_names
(
self
,
files
:
List
[
str
],
branch
:
str
,
arch
:
str
|
None
=
None
self
,
files
:
List
[
str
],
branch
:
types
.
Branch
|
str
,
arch
:
str
|
None
=
None
)
->
models
.
PackageByFileNameModel
:
)
->
models
.
PackageByFileNameModel
:
payload
=
models
.
PackagesByFileNamesJsonModel
(
payload
=
models
.
PackagesByFileNamesJsonModel
(
files
=
files
,
branch
=
branch
,
arch
=
arch
files
=
files
,
branch
=
branch
,
arch
=
arch
...
@@ -380,7 +381,7 @@ class PackageInfo:
...
@@ -380,7 +381,7 @@ class PackageInfo:
async
def
build_dependency_set
(
async
def
build_dependency_set
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
packages
:
list
[
str
],
packages
:
list
[
str
],
arch
:
str
=
"x86_64"
,
arch
:
str
=
"x86_64"
,
)
->
models
.
BuildDependencySetModel
:
)
->
models
.
BuildDependencySetModel
:
...
@@ -405,7 +406,7 @@ class PackageInfo:
...
@@ -405,7 +406,7 @@ class PackageInfo:
return
models
.
PackageFindPackagesetModel
(
**
data
)
return
models
.
PackageFindPackagesetModel
(
**
data
)
async
def
maintainer_score
(
async
def
maintainer_score
(
self
,
branch
:
str
,
name
:
str
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
)
->
models
.
MaintainerScoreModel
:
)
->
models
.
MaintainerScoreModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/package/maintainer_score"
,
{
"branch"
:
branch
,
"name"
:
name
}
"/package/maintainer_score"
,
{
"branch"
:
branch
,
"name"
:
name
}
...
@@ -415,7 +416,7 @@ class PackageInfo:
...
@@ -415,7 +416,7 @@ class PackageInfo:
async
def
misconflict
(
async
def
misconflict
(
self
,
self
,
packages
:
list
[
str
],
packages
:
list
[
str
],
branch
:
str
,
branch
:
types
.
Branch
|
str
,
archs
:
list
[
str
]
|
None
=
None
,
archs
:
list
[
str
]
|
None
=
None
,
)
->
models
.
PackageMisconflictPackagesModel
:
)
->
models
.
PackageMisconflictPackagesModel
:
params
=
{
params
=
{
...
@@ -431,7 +432,7 @@ class PackageInfo:
...
@@ -431,7 +432,7 @@ class PackageInfo:
return
models
.
PackageMisconflictPackagesModel
(
**
data
)
return
models
.
PackageMisconflictPackagesModel
(
**
data
)
async
def
package_by_file_md5
(
async
def
package_by_file_md5
(
self
,
branch
:
str
,
md5
:
str
,
arch
:
str
=
"x86_64"
self
,
branch
:
types
.
Branch
|
str
,
md5
:
str
,
arch
:
str
=
"x86_64"
)
->
models
.
PackageByFileNameModel
:
)
->
models
.
PackageByFileNameModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/package/package_by_file_md5"
,
{
"branch"
:
branch
,
"md5"
:
md5
,
"arch"
:
arch
}
"/package/package_by_file_md5"
,
{
"branch"
:
branch
,
"md5"
:
md5
,
"arch"
:
arch
}
...
@@ -439,7 +440,7 @@ class PackageInfo:
...
@@ -439,7 +440,7 @@ class PackageInfo:
return
models
.
PackageByFileNameModel
(
**
data
)
return
models
.
PackageByFileNameModel
(
**
data
)
async
def
package_by_file_name
(
async
def
package_by_file_name
(
self
,
file
:
str
,
branch
:
str
,
arch
:
str
=
"x86_64"
self
,
file
:
str
,
branch
:
types
.
Branch
|
str
,
arch
:
str
=
"x86_64"
)
->
models
.
PackageByFileNameModel
:
)
->
models
.
PackageByFileNameModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/package/package_by_file_name"
,
"/package/package_by_file_name"
,
...
@@ -453,12 +454,12 @@ class PackageInfo:
...
@@ -453,12 +454,12 @@ class PackageInfo:
async
def
repocop
(
async
def
repocop
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
package_name
:
str
,
package_name
:
str
,
package_version
:
str
|
None
=
None
,
package_version
:
str
|
None
=
None
,
package_release
:
str
|
None
=
None
,
package_release
:
str
|
None
=
None
,
bin_package_arch
:
str
|
None
=
None
,
bin_package_arch
:
str
|
None
=
None
,
package_type
:
Literal
[
"source"
,
"binary"
]
=
"source"
,
package_type
:
types
.
PackageType
=
"source"
,
)
->
models
.
RepocopJsonGetListModel
:
)
->
models
.
RepocopJsonGetListModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -483,7 +484,7 @@ class PackageInfo:
...
@@ -483,7 +484,7 @@ class PackageInfo:
return
models
.
PackageSpecfileModel
(
**
data
)
return
models
.
PackageSpecfileModel
(
**
data
)
async
def
specfile_by_name
(
async
def
specfile_by_name
(
self
,
branch
:
str
,
name
:
str
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
)
->
models
.
PackageSpecfileModel
:
)
->
models
.
PackageSpecfileModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/package/specfile_by_name"
,
{
"branch"
:
branch
,
"name"
:
name
}
"/package/specfile_by_name"
,
{
"branch"
:
branch
,
"name"
:
name
}
...
@@ -491,7 +492,7 @@ class PackageInfo:
...
@@ -491,7 +492,7 @@ class PackageInfo:
return
models
.
PackageSpecfileModel
(
**
data
)
return
models
.
PackageSpecfileModel
(
**
data
)
async
def
unpackaged_dirs
(
async
def
unpackaged_dirs
(
self
,
branch
:
str
,
packager
:
str
,
archs
:
list
[
str
]
|
None
=
None
self
,
branch
:
types
.
Branch
|
str
,
packager
:
str
,
archs
:
list
[
str
]
|
None
=
None
)
->
models
.
UnpackagedDirsModel
:
)
->
models
.
UnpackagedDirsModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -508,9 +509,9 @@ class PackageInfo:
...
@@ -508,9 +509,9 @@ class PackageInfo:
async
def
what_depends_src
(
async
def
what_depends_src
(
self
,
self
,
packages
:
list
[
str
],
packages
:
list
[
str
],
branch
:
str
,
branch
:
types
.
Branch
|
str
,
depth
:
int
=
1
,
depth
:
int
=
1
,
dptype
:
Literal
[
"both"
,
"source"
,
"binary"
]
=
"both"
,
dptype
:
types
.
DependencyType
=
"both"
,
archs
:
list
[
str
]
|
None
=
None
,
archs
:
list
[
str
]
|
None
=
None
,
leaf
:
str
|
None
=
None
,
leaf
:
str
|
None
=
None
,
finite_package
:
bool
=
False
,
finite_package
:
bool
=
False
,
...
@@ -549,7 +550,7 @@ class PackagesetInfo:
...
@@ -549,7 +550,7 @@ class PackagesetInfo:
return
models
.
PackageSetActivePackageSetsModel
(
**
data
)
return
models
.
PackageSetActivePackageSetsModel
(
**
data
)
async
def
repository_statistics
(
async
def
repository_statistics
(
self
,
branch
:
str
|
None
=
None
self
,
branch
:
types
.
Branch
|
str
|
None
=
None
)
->
models
.
RepositoryStatisticsModel
:
)
->
models
.
RepositoryStatisticsModel
:
if
branch
:
if
branch
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
...
@@ -560,21 +561,21 @@ class PackagesetInfo:
...
@@ -560,21 +561,21 @@ class PackagesetInfo:
return
models
.
RepositoryStatisticsModel
(
**
data
)
return
models
.
RepositoryStatisticsModel
(
**
data
)
async
def
compare_packagesets
(
async
def
compare_packagesets
(
self
,
pkgset1
:
str
,
pkgset2
:
str
self
,
pkgset1
:
types
.
Branch
|
str
,
pkgset2
:
types
.
Branch
|
str
)
->
models
.
PackagesetCompareModel
:
)
->
models
.
PackagesetCompareModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/packageset/compare_packagesets"
,
{
"pkgset1"
:
pkgset1
,
"pkgset2"
:
pkgset2
}
"/packageset/compare_packagesets"
,
{
"pkgset1"
:
pkgset1
,
"pkgset2"
:
pkgset2
}
)
)
return
models
.
PackagesetCompareModel
(
**
data
)
return
models
.
PackagesetCompareModel
(
**
data
)
async
def
maintainer_scores
(
self
,
branch
:
str
)
->
models
.
MaintainerScoresBatchModel
:
async
def
maintainer_scores
(
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
MaintainerScoresBatchModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/packageset/maintainer_scores"
,
{
"branch"
:
branch
}
"/packageset/maintainer_scores"
,
{
"branch"
:
branch
}
)
)
return
models
.
MaintainerScoresBatchModel
(
**
data
)
return
models
.
MaintainerScoresBatchModel
(
**
data
)
async
def
packages_by_component
(
async
def
packages_by_component
(
self
,
branch
:
str
,
arch
:
str
,
component
:
str
self
,
branch
:
types
.
Branch
|
str
,
arch
:
str
,
component
:
str
)
->
models
.
PackagesByUuidModel
:
)
->
models
.
PackagesByUuidModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/packageset/packages_by_component"
,
"/packageset/packages_by_component"
,
...
@@ -595,8 +596,8 @@ class PackagesetInfo:
...
@@ -595,8 +596,8 @@ class PackagesetInfo:
async
def
repository_packages
(
async
def
repository_packages
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
package_type
:
Literal
[
"all"
,
"source"
,
"binary"
]
=
"all"
,
package_type
:
types
.
PackageTypeAll
=
"all"
,
archs
:
list
[
str
]
|
None
=
None
,
archs
:
list
[
str
]
|
None
=
None
,
include_done_tasks
:
bool
=
False
,
include_done_tasks
:
bool
=
False
,
)
->
models
.
PackagesetPackagesModel
:
)
->
models
.
PackagesetPackagesModel
:
...
@@ -618,7 +619,7 @@ class AclInfo:
...
@@ -618,7 +619,7 @@ class AclInfo:
def
__init__
(
self
,
client
:
BaseAPI
):
def
__init__
(
self
,
client
:
BaseAPI
):
self
.
client
=
client
self
.
client
=
client
async
def
groups
(
self
,
branch
:
str
,
name
:
str
|
None
=
None
)
:
async
def
groups
(
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
|
None
=
None
)
->
models
.
AclGroupsModel
:
data
=
{
"branch"
:
branch
}
data
=
{
"branch"
:
branch
}
if
name
:
if
name
:
data
[
"name"
]
=
name
data
[
"name"
]
=
name
...
@@ -627,7 +628,7 @@ class AclInfo:
...
@@ -627,7 +628,7 @@ class AclInfo:
return
models
.
AclGroupsModel
(
**
data
)
return
models
.
AclGroupsModel
(
**
data
)
async
def
by_packages
(
async
def
by_packages
(
self
,
branch
:
str
,
packages_names
:
list
[
str
]
self
,
branch
:
types
.
Branch
|
str
,
packages_names
:
list
[
str
]
)
->
models
.
AclByPackagesModel
:
)
->
models
.
AclByPackagesModel
:
params
=
{
params
=
{
"branch"
:
branch
,
"branch"
:
branch
,
...
@@ -656,7 +657,7 @@ class BugInfo:
...
@@ -656,7 +657,7 @@ class BugInfo:
self
.
client
=
client
self
.
client
=
client
async
def
bugzilla_by_maintainer
(
async
def
bugzilla_by_maintainer
(
self
,
maintainer_nickname
:
str
,
by_acl
:
str
|
None
=
None
self
,
maintainer_nickname
:
str
,
by_acl
:
types
.
Acl
|
None
=
None
)
->
models
.
BugzillaInfoModel
|
None
:
)
->
models
.
BugzillaInfoModel
|
None
:
try
:
try
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
...
@@ -673,7 +674,7 @@ class BugInfo:
...
@@ -673,7 +674,7 @@ class BugInfo:
async
def
bugzilla_by_package
(
async
def
bugzilla_by_package
(
self
,
self
,
package_name
:
str
,
package_name
:
str
,
package_type
:
Literal
[
"source"
,
"binary"
]
=
"source"
,
package_type
:
types
.
PackageType
=
"source"
,
)
->
models
.
BugzillaInfoModel
:
)
->
models
.
BugzillaInfoModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/bug/bugzilla_by_package"
,
"/bug/bugzilla_by_package"
,
...
@@ -682,7 +683,7 @@ class BugInfo:
...
@@ -682,7 +683,7 @@ class BugInfo:
return
models
.
BugzillaInfoModel
(
**
data
)
return
models
.
BugzillaInfoModel
(
**
data
)
async
def
bugzilla_by_image_edition
(
async
def
bugzilla_by_image_edition
(
self
,
branch
:
str
,
edition
:
str
self
,
branch
:
types
.
Branch
|
str
,
edition
:
str
)
->
models
.
BugzillaInfoModel
:
)
->
models
.
BugzillaInfoModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/bug/bugzilla_by_image_edition"
,
{
"branch"
:
branch
,
"edition"
:
edition
}
"/bug/bugzilla_by_image_edition"
,
{
"branch"
:
branch
,
"edition"
:
edition
}
...
@@ -695,7 +696,7 @@ class FileInfo:
...
@@ -695,7 +696,7 @@ class FileInfo:
self
.
client
=
client
self
.
client
=
client
async
def
packages_by_file
(
async
def
packages_by_file
(
self
,
branch
:
str
,
file_name
:
str
self
,
branch
:
types
.
Branch
|
str
,
file_name
:
str
)
->
models
.
FilePackagesByFileModel
:
)
->
models
.
FilePackagesByFileModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/file/packages_by_file"
,
{
"branch"
:
branch
,
"file_name"
:
file_name
}
"/file/packages_by_file"
,
{
"branch"
:
branch
,
"file_name"
:
file_name
}
...
@@ -703,7 +704,7 @@ class FileInfo:
...
@@ -703,7 +704,7 @@ class FileInfo:
return
models
.
FilePackagesByFileModel
(
**
data
)
return
models
.
FilePackagesByFileModel
(
**
data
)
async
def
search
(
async
def
search
(
self
,
branch
:
str
,
file_name
:
str
,
limit
:
int
|
None
=
None
self
,
branch
:
types
.
Branch
|
str
,
file_name
:
str
,
limit
:
int
|
None
=
None
)
->
models
.
FilesModel
:
)
->
models
.
FilesModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/file/search"
,
"/file/search"
,
...
@@ -716,7 +717,7 @@ class FileInfo:
...
@@ -716,7 +717,7 @@ class FileInfo:
return
models
.
FilesModel
(
**
data
)
return
models
.
FilesModel
(
**
data
)
async
def
fast_lookup
(
async
def
fast_lookup
(
self
,
branch
:
str
,
file_name
:
str
,
limit
:
int
=
10
self
,
branch
:
types
.
Branch
|
str
,
file_name
:
str
,
limit
:
int
=
10
)
->
models
.
FastFileSearchModel
:
)
->
models
.
FastFileSearchModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/file/fast_lookup"
,
"/file/fast_lookup"
,
...
@@ -729,11 +730,11 @@ class SiteInfo:
...
@@ -729,11 +730,11 @@ class SiteInfo:
def
__init__
(
self
,
client
:
BaseAPI
):
def
__init__
(
self
,
client
:
BaseAPI
):
self
.
client
=
client
self
.
client
=
client
async
def
all_maintainers
(
self
,
branch
:
str
)
->
models
.
AllMaintainersModel
:
async
def
all_maintainers
(
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
AllMaintainersModel
:
return
await
self
.
all_maintainers_with_nicknames
(
branch
)
return
await
self
.
all_maintainers_with_nicknames
(
branch
)
async
def
all_maintainers_with_nicknames
(
async
def
all_maintainers_with_nicknames
(
self
,
branch
:
str
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
AllMaintainersModel
:
)
->
models
.
AllMaintainersModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/all_maintainers_with_nicknames"
,
{
"branch"
:
branch
}
"/site/all_maintainers_with_nicknames"
,
{
"branch"
:
branch
}
...
@@ -741,7 +742,7 @@ class SiteInfo:
...
@@ -741,7 +742,7 @@ class SiteInfo:
return
models
.
AllMaintainersModel
(
**
data
)
return
models
.
AllMaintainersModel
(
**
data
)
async
def
find_source_package
(
async
def
find_source_package
(
self
,
branch
:
str
,
name
:
str
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
)
->
models
.
FindSourcePackageInBranch
:
)
->
models
.
FindSourcePackageInBranch
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/find_source_package"
,
{
"branch"
:
branch
,
"name"
:
name
}
"/site/find_source_package"
,
{
"branch"
:
branch
,
"name"
:
name
}
...
@@ -749,7 +750,7 @@ class SiteInfo:
...
@@ -749,7 +750,7 @@ class SiteInfo:
return
models
.
FindSourcePackageInBranch
(
**
data
)
return
models
.
FindSourcePackageInBranch
(
**
data
)
async
def
maintainer_info
(
async
def
maintainer_info
(
self
,
branch
:
str
,
maintainer_nickname
:
str
self
,
branch
:
types
.
Branch
|
str
,
maintainer_nickname
:
str
)
->
models
.
MaintainerInfoModel
:
)
->
models
.
MaintainerInfoModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/maintainer_info"
,
"/site/maintainer_info"
,
...
@@ -759,10 +760,10 @@ class SiteInfo:
...
@@ -759,10 +760,10 @@ class SiteInfo:
async
def
package_info
(
async
def
package_info
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
pkghash
:
int
,
pkghash
:
int
,
changelog_last
:
int
=
3
,
changelog_last
:
int
=
3
,
package_type
:
Literal
[
"source"
,
"binary"
]
=
"source"
,
package_type
:
types
.
PackageType
=
"source"
,
)
->
models
.
SitePackageInfoModel
:
)
->
models
.
SitePackageInfoModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
f
"/site/package_info/{pkghash}"
,
f
"/site/package_info/{pkghash}"
,
...
@@ -775,7 +776,7 @@ class SiteInfo:
...
@@ -775,7 +776,7 @@ class SiteInfo:
return
models
.
SitePackageInfoModel
(
**
data
)
return
models
.
SitePackageInfoModel
(
**
data
)
async
def
pkghash_by_binary_name
(
async
def
pkghash_by_binary_name
(
self
,
branch
:
str
,
name
:
str
,
arch
:
str
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
,
arch
:
str
)
->
models
.
SitePackagesetPackageHashModel
:
)
->
models
.
SitePackagesetPackageHashModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/pkghash_by_binary_name"
,
"/site/pkghash_by_binary_name"
,
...
@@ -784,7 +785,7 @@ class SiteInfo:
...
@@ -784,7 +785,7 @@ class SiteInfo:
return
models
.
SitePackagesetPackageHashModel
(
**
data
)
return
models
.
SitePackagesetPackageHashModel
(
**
data
)
async
def
pkghash_by_name
(
async
def
pkghash_by_name
(
self
,
branch
:
str
,
name
:
str
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
)
->
models
.
SitePackagesetPackageHashModel
:
)
->
models
.
SitePackagesetPackageHashModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/pkghash_by_name"
,
{
"branch"
:
branch
,
"name"
:
name
}
"/site/pkghash_by_name"
,
{
"branch"
:
branch
,
"name"
:
name
}
...
@@ -803,12 +804,12 @@ class SiteInfo:
...
@@ -803,12 +804,12 @@ class SiteInfo:
return
None
return
None
return
models
.
SiteWatchByMaintainerModel
(
**
data
)
return
models
.
SiteWatchByMaintainerModel
(
**
data
)
async
def
all_pkgset_archs
(
self
,
branch
:
str
)
->
models
.
SiteAllArchsModel
:
async
def
all_pkgset_archs
(
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
SiteAllArchsModel
:
data
=
await
self
.
client
.
get
(
"/site/all_pkgset_archs"
,
{
"branch"
:
branch
})
data
=
await
self
.
client
.
get
(
"/site/all_pkgset_archs"
,
{
"branch"
:
branch
})
return
models
.
SiteAllArchsModel
(
**
data
)
return
models
.
SiteAllArchsModel
(
**
data
)
async
def
all_pkgset_archs_with_src_count
(
async
def
all_pkgset_archs_with_src_count
(
self
,
branch
:
str
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
SiteAllArchsModel
:
)
->
models
.
SiteAllArchsModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/all_pkgset_archs_with_src_count"
,
{
"branch"
:
branch
}
"/site/all_pkgset_archs_with_src_count"
,
{
"branch"
:
branch
}
...
@@ -829,9 +830,9 @@ class SiteInfo:
...
@@ -829,9 +830,9 @@ class SiteInfo:
async
def
beehive_errors_by_maintainer
(
async
def
beehive_errors_by_maintainer
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
maintainer_nickname
:
str
,
maintainer_nickname
:
str
,
by_acl
:
str
=
"none"
,
by_acl
:
types
.
Acl
=
"none"
,
)
->
models
.
SiteBeehiveByMaintainerModel
:
)
->
models
.
SiteBeehiveByMaintainerModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/beehive_errors_by_maintainer"
,
"/site/beehive_errors_by_maintainer"
,
...
@@ -844,7 +845,7 @@ class SiteInfo:
...
@@ -844,7 +845,7 @@ class SiteInfo:
return
models
.
SiteBeehiveByMaintainerModel
(
**
data
)
return
models
.
SiteBeehiveByMaintainerModel
(
**
data
)
async
def
binary_package_archs_and_versions
(
async
def
binary_package_archs_and_versions
(
self
,
branch
:
str
,
name
:
str
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
)
->
models
.
SitePackagesBinaryListModel
:
)
->
models
.
SitePackagesBinaryListModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/binary_package_archs_and_versions"
,
{
"branch"
:
branch
,
"name"
:
name
}
"/site/binary_package_archs_and_versions"
,
{
"branch"
:
branch
,
"name"
:
name
}
...
@@ -859,9 +860,9 @@ class SiteInfo:
...
@@ -859,9 +860,9 @@ class SiteInfo:
async
def
deleted_package_info
(
async
def
deleted_package_info
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
name
:
str
,
name
:
str
,
package_type
:
Literal
[
"source"
,
"binary"
]
=
"source"
,
package_type
:
types
.
PackageType
=
"source"
,
arch
:
str
|
None
=
None
,
arch
:
str
|
None
=
None
,
)
->
models
.
SiteDeletedPackageModel
:
)
->
models
.
SiteDeletedPackageModel
:
params
=
{
params
=
{
...
@@ -878,7 +879,7 @@ class SiteInfo:
...
@@ -878,7 +879,7 @@ class SiteInfo:
return
models
.
SiteDeletedPackageModel
(
**
data
)
return
models
.
SiteDeletedPackageModel
(
**
data
)
async
def
fast_packages_search_lookup
(
async
def
fast_packages_search_lookup
(
self
,
name
:
list
[
str
],
branch
:
str
|
None
=
None
self
,
name
:
list
[
str
],
branch
:
types
.
Branch
|
str
|
None
=
None
)
->
models
.
SiteFastPackagesSearchModel
:
)
->
models
.
SiteFastPackagesSearchModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -894,7 +895,7 @@ class SiteInfo:
...
@@ -894,7 +895,7 @@ class SiteInfo:
async
def
find_packages
(
async
def
find_packages
(
self
,
self
,
name
:
list
[
str
],
name
:
list
[
str
],
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
arch
:
list
[
str
]
|
None
=
None
,
arch
:
list
[
str
]
|
None
=
None
,
)
->
models
.
SiteFingPackagesModel
:
)
->
models
.
SiteFingPackagesModel
:
params
=
{
params
=
{
...
@@ -911,7 +912,7 @@ class SiteInfo:
...
@@ -911,7 +912,7 @@ class SiteInfo:
async
def
last_packages
(
async
def
last_packages
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
tasks_limit
:
int
=
10
,
tasks_limit
:
int
=
10
,
task_owner
:
str
|
None
=
None
,
task_owner
:
str
|
None
=
None
,
)
->
models
.
SiteLastPackagesModel
:
)
->
models
.
SiteLastPackagesModel
:
...
@@ -929,7 +930,7 @@ class SiteInfo:
...
@@ -929,7 +930,7 @@ class SiteInfo:
async
def
last_packages_by_branch
(
async
def
last_packages_by_branch
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
packages_limit
:
int
=
10
,
packages_limit
:
int
=
10
,
packager
:
str
|
None
=
None
,
packager
:
str
|
None
=
None
,
)
->
models
.
SiteLastBranchPackagesModel
:
)
->
models
.
SiteLastBranchPackagesModel
:
...
@@ -947,7 +948,7 @@ class SiteInfo:
...
@@ -947,7 +948,7 @@ class SiteInfo:
async
def
last_packages_by_tasks
(
async
def
last_packages_by_tasks
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
tasks_limit
:
int
=
10
,
tasks_limit
:
int
=
10
,
task_owner
:
str
|
None
=
None
,
task_owner
:
str
|
None
=
None
,
)
->
models
.
SiteLastPackagesModel
:
)
->
models
.
SiteLastPackagesModel
:
...
@@ -964,7 +965,7 @@ class SiteInfo:
...
@@ -964,7 +965,7 @@ class SiteInfo:
return
models
.
SiteLastPackagesModel
(
**
data
)
return
models
.
SiteLastPackagesModel
(
**
data
)
async
def
last_packages_with_cve_fixed
(
async
def
last_packages_with_cve_fixed
(
self
,
branch
:
str
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
SiteLastPackagesWithCVEFixesModel
:
)
->
models
.
SiteLastPackagesWithCVEFixesModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/last_packages_with_cve_fixed"
,
{
"branch"
:
branch
}
"/site/last_packages_with_cve_fixed"
,
{
"branch"
:
branch
}
...
@@ -981,9 +982,9 @@ class SiteInfo:
...
@@ -981,9 +982,9 @@ class SiteInfo:
async
def
maintainer_packages
(
async
def
maintainer_packages
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
maintainer_nickname
:
str
,
maintainer_nickname
:
str
,
by_acl
:
str
=
"none"
,
by_acl
:
types
.
Acl
=
"none"
,
)
->
models
.
MaintainerPackagesModel
:
)
->
models
.
MaintainerPackagesModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/maintainer_packages"
,
"/site/maintainer_packages"
,
...
@@ -1004,7 +1005,7 @@ class SiteInfo:
...
@@ -1004,7 +1005,7 @@ class SiteInfo:
return
models
.
SiteChangelogModel
(
**
data
)
return
models
.
SiteChangelogModel
(
**
data
)
async
def
package_downloads
(
async
def
package_downloads
(
self
,
pkghash
:
int
,
branch
:
str
self
,
pkghash
:
int
,
branch
:
types
.
Branch
|
str
)
->
models
.
SitePackagesDownloadsModel
:
)
->
models
.
SitePackagesDownloadsModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
f
"/site/package_downloads/{pkghash}"
,
{
"branch"
:
branch
}
f
"/site/package_downloads/{pkghash}"
,
{
"branch"
:
branch
}
...
@@ -1012,7 +1013,7 @@ class SiteInfo:
...
@@ -1012,7 +1013,7 @@ class SiteInfo:
return
models
.
SitePackagesDownloadsModel
(
**
data
)
return
models
.
SitePackagesDownloadsModel
(
**
data
)
async
def
package_downloads_bin
(
async
def
package_downloads_bin
(
self
,
pkghash
:
int
,
branch
:
str
,
arch
:
str
self
,
pkghash
:
int
,
branch
:
types
.
Branch
|
str
,
arch
:
str
)
->
models
.
SitePackagesDownloadsModel
:
)
->
models
.
SitePackagesDownloadsModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
f
"/site/package_downloads_bin/{pkghash}"
,
{
"branch"
:
branch
,
"arch"
:
arch
}
f
"/site/package_downloads_bin/{pkghash}"
,
{
"branch"
:
branch
,
"arch"
:
arch
}
...
@@ -1020,7 +1021,7 @@ class SiteInfo:
...
@@ -1020,7 +1021,7 @@ class SiteInfo:
return
models
.
SitePackagesDownloadsModel
(
**
data
)
return
models
.
SitePackagesDownloadsModel
(
**
data
)
async
def
package_downloads_src
(
async
def
package_downloads_src
(
self
,
pkghash
:
int
,
branch
:
str
self
,
pkghash
:
int
,
branch
:
types
.
Branch
|
str
)
->
models
.
SitePackagesDownloadsModel
:
)
->
models
.
SitePackagesDownloadsModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
f
"/site/package_downloads_src/{pkghash}"
,
{
"branch"
:
branch
}
f
"/site/package_downloads_src/{pkghash}"
,
{
"branch"
:
branch
}
...
@@ -1038,7 +1039,7 @@ class SiteInfo:
...
@@ -1038,7 +1039,7 @@ class SiteInfo:
return
models
.
BinPackageLogElementModel
(
**
data
)
return
models
.
BinPackageLogElementModel
(
**
data
)
async
def
package_misconflict
(
async
def
package_misconflict
(
self
,
pkghash
:
int
,
branch
:
str
self
,
pkghash
:
int
,
branch
:
types
.
Branch
|
str
)
->
models
.
PackageMisconflictBySrcModel
:
)
->
models
.
PackageMisconflictBySrcModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
f
"/site/package_misconflict/{pkghash}"
,
{
"branch"
:
branch
}
f
"/site/package_misconflict/{pkghash}"
,
{
"branch"
:
branch
}
...
@@ -1046,7 +1047,7 @@ class SiteInfo:
...
@@ -1046,7 +1047,7 @@ class SiteInfo:
return
models
.
PackageMisconflictBySrcModel
(
**
data
)
return
models
.
PackageMisconflictBySrcModel
(
**
data
)
async
def
package_name_from_repology
(
async
def
package_name_from_repology
(
self
,
branch
:
str
,
name
:
str
self
,
branch
:
types
.
Branch
|
str
,
name
:
str
)
->
models
.
PackageNameFromRepologyModel
:
)
->
models
.
PackageNameFromRepologyModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/package_name_from_repology"
,
{
"branch"
:
branch
,
"name"
:
name
}
"/site/package_name_from_repology"
,
{
"branch"
:
branch
,
"name"
:
name
}
...
@@ -1071,7 +1072,7 @@ class SiteInfo:
...
@@ -1071,7 +1072,7 @@ class SiteInfo:
async
def
package_versions
(
async
def
package_versions
(
self
,
self
,
name
:
str
,
name
:
str
,
package_type
:
Literal
[
"source"
,
"binary"
]
=
"source"
,
package_type
:
types
.
PackageType
=
"source"
,
arch
:
str
|
None
=
None
,
arch
:
str
|
None
=
None
,
)
->
models
.
SiteSourcePackagesVersionsModel
:
)
->
models
.
SiteSourcePackagesVersionsModel
:
params
=
{
params
=
{
...
@@ -1087,7 +1088,7 @@ class SiteInfo:
...
@@ -1087,7 +1088,7 @@ class SiteInfo:
return
models
.
SiteSourcePackagesVersionsModel
(
**
data
)
return
models
.
SiteSourcePackagesVersionsModel
(
**
data
)
async
def
package_versions_from_images
(
async
def
package_versions_from_images
(
self
,
name
:
str
,
branch
:
str
,
edition
:
str
,
type
:
str
self
,
name
:
str
,
branch
:
types
.
Branch
|
str
,
edition
:
str
,
type
:
str
)
->
models
.
SiteImagePackageVersionsModel
:
)
->
models
.
SiteImagePackageVersionsModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/package_versions_from_images"
,
"/site/package_versions_from_images"
,
...
@@ -1096,7 +1097,7 @@ class SiteInfo:
...
@@ -1096,7 +1097,7 @@ class SiteInfo:
return
models
.
SiteImagePackageVersionsModel
(
**
data
)
return
models
.
SiteImagePackageVersionsModel
(
**
data
)
async
def
package_versions_from_tasks
(
async
def
package_versions_from_tasks
(
self
,
name
:
str
,
branch
:
str
|
None
=
None
self
,
name
:
str
,
branch
:
types
.
Branch
|
str
|
None
=
None
)
->
models
.
SItePackagesVersionsFromTasksModel
:
)
->
models
.
SItePackagesVersionsFromTasksModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -1116,7 +1117,7 @@ class SiteInfo:
...
@@ -1116,7 +1117,7 @@ class SiteInfo:
return
models
.
SitePackagesetsByHashModel
(
**
data
)
return
models
.
SitePackagesetsByHashModel
(
**
data
)
async
def
pkghash_by_nvr
(
async
def
pkghash_by_nvr
(
self
,
name
:
str
,
branch
:
str
,
version
:
str
,
release
:
str
self
,
name
:
str
,
branch
:
types
.
Branch
|
str
,
version
:
str
,
release
:
str
)
->
models
.
SitePackagesetPackageHashByNameVersionRelease
:
)
->
models
.
SitePackagesetPackageHashByNameVersionRelease
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/pkghash_by_nvr"
,
"/site/pkghash_by_nvr"
,
...
@@ -1126,8 +1127,8 @@ class SiteInfo:
...
@@ -1126,8 +1127,8 @@ class SiteInfo:
async
def
pkgset_categories_count
(
async
def
pkgset_categories_count
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
package_type
:
Literal
[
"all"
,
"source"
,
"binary"
]
=
"source"
,
package_type
:
types
.
PackageTypeAll
=
"source"
,
)
->
models
.
SitePackagesetCategoriesModel
:
)
->
models
.
SitePackagesetCategoriesModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/pkgset_categories_count"
,
"/site/pkgset_categories_count"
,
...
@@ -1141,9 +1142,9 @@ class SiteInfo:
...
@@ -1141,9 +1142,9 @@ class SiteInfo:
async
def
repocop_by_maintainer
(
async
def
repocop_by_maintainer
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
maintainer_nickname
:
str
,
maintainer_nickname
:
str
,
by_acl
:
str
=
"none"
,
by_acl
:
types
.
Acl
=
"none"
,
)
->
models
.
RepocopByMaintainerModel
:
)
->
models
.
RepocopByMaintainerModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/repocop_by_maintainer"
,
"/site/repocop_by_maintainer"
,
...
@@ -1157,8 +1158,8 @@ class SiteInfo:
...
@@ -1157,8 +1158,8 @@ class SiteInfo:
async
def
repository_packages
(
async
def
repository_packages
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
package_type
:
Literal
[
"all"
,
"source"
,
"binary"
]
=
"source"
,
package_type
:
types
.
PackageTypeAll
=
"source"
,
group
:
str
|
None
=
None
,
group
:
str
|
None
=
None
,
buildtime
:
int
=
0
,
buildtime
:
int
=
0
,
)
->
models
.
SitePackagesModel
:
)
->
models
.
SitePackagesModel
:
...
@@ -1182,7 +1183,7 @@ class SiteInfo:
...
@@ -1182,7 +1183,7 @@ class SiteInfo:
return
models
.
SiteSourcePackagesVersionsModel
(
**
data
)
return
models
.
SiteSourcePackagesVersionsModel
(
**
data
)
async
def
tasks_by_maintainer
(
async
def
tasks_by_maintainer
(
self
,
branch
:
str
,
maintainer_nickname
:
str
self
,
branch
:
types
.
Branch
|
str
,
maintainer_nickname
:
str
)
->
models
.
SiteTaskByNameModel
:
)
->
models
.
SiteTaskByNameModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/site/tasks_by_maintainer"
,
"/site/tasks_by_maintainer"
,
...
@@ -1216,7 +1217,7 @@ class AuthInfo:
...
@@ -1216,7 +1217,7 @@ class AuthInfo:
self
,
self
,
nickname
:
str
,
nickname
:
str
,
password
:
str
,
password
:
str
,
auth_provider
:
Literal
[
"ldap"
,
"keycloak"
]
=
"ldap"
,
auth_provider
:
types
.
AuthProvider
=
"ldap"
,
)
->
models
.
AuthResponseModel
:
)
->
models
.
AuthResponseModel
:
data
=
await
self
.
client
.
post
(
data
=
await
self
.
client
.
post
(
"/auth/login"
,
"/auth/login"
,
...
@@ -1245,10 +1246,10 @@ class DependenciesInfo:
...
@@ -1245,10 +1246,10 @@ class DependenciesInfo:
async
def
backport_helper
(
async
def
backport_helper
(
self
,
self
,
from_branch
:
str
,
from_branch
:
types
.
Branch
|
str
,
into_branch
:
str
,
into_branch
:
types
.
Branch
|
str
,
packages_names
:
list
[
str
],
packages_names
:
list
[
str
],
dp_type
:
Literal
[
"both"
,
"source"
,
"binary"
]
=
"both"
,
dp_type
:
types
.
DependencyType
=
"both"
,
archs
:
list
[
str
]
|
None
=
None
,
archs
:
list
[
str
]
|
None
=
None
,
)
->
models
.
BackportHelperModel
:
)
->
models
.
BackportHelperModel
:
params
=
{
params
=
{
...
@@ -1274,7 +1275,7 @@ class DependenciesInfo:
...
@@ -1274,7 +1275,7 @@ class DependenciesInfo:
return
models
.
DependenciesPackageDependenciesModel
(
**
data
)
return
models
.
DependenciesPackageDependenciesModel
(
**
data
)
async
def
fast_lookup
(
async
def
fast_lookup
(
self
,
branch
:
str
,
dp_name
:
str
,
limit
:
int
=
10
self
,
branch
:
types
.
Branch
|
str
,
dp_name
:
str
,
limit
:
int
=
10
)
->
models
.
FastDependencySearchModel
:
)
->
models
.
FastDependencySearchModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/dependencies/fast_lookup"
,
"/dependencies/fast_lookup"
,
...
@@ -1284,9 +1285,9 @@ class DependenciesInfo:
...
@@ -1284,9 +1285,9 @@ class DependenciesInfo:
async
def
packages_by_dependency
(
async
def
packages_by_dependency
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
dp_name
:
str
,
dp_name
:
str
,
dp_type
:
Literal
[
"all"
,
"provide"
,
"require"
,
"conflict"
,
"obsolete"
]
=
"all"
,
dp_type
:
types
.
DependencyKind
=
"all"
,
last_state
:
bool
=
False
,
last_state
:
bool
=
False
,
)
->
models
.
DependenciesPackagesModel
:
)
->
models
.
DependenciesPackagesModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
...
@@ -1301,7 +1302,7 @@ class DependenciesInfo:
...
@@ -1301,7 +1302,7 @@ class DependenciesInfo:
return
models
.
DependenciesPackagesModel
(
**
data
)
return
models
.
DependenciesPackagesModel
(
**
data
)
async
def
source_package_dependencies
(
async
def
source_package_dependencies
(
self
,
pkghash
:
int
,
branch
:
str
,
depth
:
int
=
1
self
,
pkghash
:
int
,
branch
:
types
.
Branch
|
str
,
depth
:
int
=
1
)
->
models
.
DependenciesPackageBuildDependenciesModel
:
)
->
models
.
DependenciesPackageBuildDependenciesModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
f
"/dependencies/source_package_dependencies/{pkghash}"
,
f
"/dependencies/source_package_dependencies/{pkghash}"
,
...
@@ -1312,8 +1313,8 @@ class DependenciesInfo:
...
@@ -1312,8 +1313,8 @@ class DependenciesInfo:
async
def
what_depends_src
(
async
def
what_depends_src
(
self
,
self
,
name
:
str
,
name
:
str
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
dp_type
:
Literal
[
"both"
,
"source"
,
"binary"
]
=
"both"
,
dp_type
:
types
.
DependencyType
=
"both"
,
)
->
models
.
DependsPackageBuildDependencyModel
:
)
->
models
.
DependsPackageBuildDependencyModel
:
data
=
await
self
.
client
.
get
(
data
=
await
self
.
client
.
get
(
"/dependencies/what_depends_src"
,
"/dependencies/what_depends_src"
,
...
@@ -1332,7 +1333,7 @@ class ErrataExportOvalInfo:
...
@@ -1332,7 +1333,7 @@ class ErrataExportOvalInfo:
async
def
info
(
async
def
info
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
package_name
:
str
|
None
=
None
,
package_name
:
str
|
None
=
None
,
one_file
:
bool
=
False
,
one_file
:
bool
=
False
,
)
->
bytes
:
)
->
bytes
:
...
@@ -1361,7 +1362,7 @@ class ErrataInfo:
...
@@ -1361,7 +1362,7 @@ class ErrataInfo:
async
def
advisory
(
async
def
advisory
(
self
,
self
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
input
:
str
|
None
=
None
,
input
:
str
|
None
=
None
,
page
:
int
|
None
=
None
,
page
:
int
|
None
=
None
,
limit
:
int
|
None
=
None
,
limit
:
int
|
None
=
None
,
...
@@ -1396,12 +1397,12 @@ class ErrataInfo:
...
@@ -1396,12 +1397,12 @@ class ErrataInfo:
async
def
find_erratas
(
async
def
find_erratas
(
self
,
self
,
input
:
list
[
str
]
|
None
=
None
,
input
:
list
[
str
]
|
None
=
None
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
type
:
Literal
[
"packages"
,
"repository"
,
"bug"
,
"vuln"
,
"exclusion"
]
type
:
types
.
ErrataType
|
None
=
None
,
|
None
=
None
,
page
:
int
|
None
=
None
,
page
:
int
|
None
=
None
,
limit
:
int
|
None
=
None
,
limit
:
int
|
None
=
None
,
state
:
Literal
[
"all"
,
"active"
,
"discarded"
]
=
"all"
,
state
:
types
.
ErrataState
=
"all"
,
)
->
models
.
ErrataLastChangedModel
:
)
->
models
.
ErrataLastChangedModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -1421,10 +1422,10 @@ class ErrataInfo:
...
@@ -1421,10 +1422,10 @@ class ErrataInfo:
async
def
find_image_erratas
(
async
def
find_image_erratas
(
self
,
self
,
uuid
:
str
,
uuid
:
str
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
component
:
str
|
None
=
None
,
component
:
str
|
None
=
None
,
input
:
list
[
str
]
|
None
=
None
,
input
:
list
[
str
]
|
None
=
None
,
type
:
Literal
[
"packages"
,
"repository"
,
"bug"
,
"vuln"
,
"exclusion"
]
type
:
types
.
ErrataType
|
None
=
None
,
|
None
=
None
,
page
:
int
|
None
=
None
,
page
:
int
|
None
=
None
,
limit
:
int
|
None
=
None
,
limit
:
int
|
None
=
None
,
...
@@ -1463,7 +1464,7 @@ class ErrataInfo:
...
@@ -1463,7 +1464,7 @@ class ErrataInfo:
async
def
search
(
async
def
search
(
self
,
self
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
name
:
str
|
None
=
None
,
name
:
str
|
None
=
None
,
vuln_id
:
str
|
None
=
None
,
vuln_id
:
str
|
None
=
None
,
errata_id
:
str
|
None
=
None
,
errata_id
:
str
|
None
=
None
,
...
@@ -1495,7 +1496,7 @@ class ExportBeehiveInfo:
...
@@ -1495,7 +1496,7 @@ class ExportBeehiveInfo:
self
.
client
=
client
self
.
client
=
client
async
def
ftbfs
(
async
def
ftbfs
(
self
,
branch
:
str
,
arch
:
str
|
None
=
None
self
,
branch
:
types
.
Branch
|
str
,
arch
:
str
|
None
=
None
)
->
models
.
ExportBeehiveFTBFSListModel
:
)
->
models
.
ExportBeehiveFTBFSListModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -1536,7 +1537,7 @@ class ExportInfo:
...
@@ -1536,7 +1537,7 @@ class ExportInfo:
self
.
translation
=
ExportTranslationInfo
(
self
.
client
)
self
.
translation
=
ExportTranslationInfo
(
self
.
client
)
async
def
branch_binary_packages
(
async
def
branch_binary_packages
(
self
,
branch
:
str
,
arch
:
str
|
None
=
None
self
,
branch
:
types
.
Branch
|
str
,
arch
:
str
|
None
=
None
)
->
models
.
PackagesetPackagesExportModel
:
)
->
models
.
PackagesetPackagesExportModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -1554,11 +1555,11 @@ class ExportInfo:
...
@@ -1554,11 +1555,11 @@ class ExportInfo:
data
=
await
self
.
client
.
get
(
"/export/branch_tree"
)
data
=
await
self
.
client
.
get
(
"/export/branch_tree"
)
return
models
.
BranchTreeModel
(
**
data
)
return
models
.
BranchTreeModel
(
**
data
)
async
def
repology
(
self
,
branch
:
str
)
->
models
.
RepologyExportModel
:
async
def
repology
(
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
RepologyExportModel
:
data
=
await
self
.
client
.
get
(
f
"/export/repology/{branch}"
)
data
=
await
self
.
client
.
get
(
f
"/export/repology/{branch}"
)
return
models
.
RepologyExportModel
(
**
data
)
return
models
.
RepologyExportModel
(
**
data
)
async
def
sitemap_packages
(
self
,
branch
:
str
)
->
models
.
SitemapPackagesExportModel
:
async
def
sitemap_packages
(
self
,
branch
:
types
.
Branch
|
str
)
->
models
.
SitemapPackagesExportModel
:
data
=
await
self
.
client
.
get
(
f
"/export/sitemap_packages/{branch}"
)
data
=
await
self
.
client
.
get
(
f
"/export/sitemap_packages/{branch}"
)
return
models
.
SitemapPackagesExportModel
(
**
data
)
return
models
.
SitemapPackagesExportModel
(
**
data
)
...
@@ -1603,7 +1604,7 @@ class ImageInfo:
...
@@ -1603,7 +1604,7 @@ class ImageInfo:
async
def
active_images
(
async
def
active_images
(
self
,
self
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
edition
:
str
|
None
=
None
,
edition
:
str
|
None
=
None
,
version
:
str
|
None
=
None
,
version
:
str
|
None
=
None
,
release
:
str
|
None
=
None
,
release
:
str
|
None
=
None
,
...
@@ -1628,10 +1629,10 @@ class ImageInfo:
...
@@ -1628,10 +1629,10 @@ class ImageInfo:
async
def
find_images_by_package_name
(
async
def
find_images_by_package_name
(
self
,
self
,
pkg_name
:
str
,
pkg_name
:
str
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
edition
:
str
|
None
=
None
,
edition
:
str
|
None
=
None
,
pkg_type
:
Literal
[
"source"
,
"binary"
]
=
"source"
,
pkg_type
:
types
.
PackageType
=
"source"
,
img_show
:
Literal
[
"active"
,
"all"
]
=
"all"
,
img_show
:
types
.
ImageShow
=
"all"
,
)
->
models
.
FindImagesByPackageModel
:
)
->
models
.
FindImagesByPackageModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -1663,7 +1664,7 @@ class ImageInfo:
...
@@ -1663,7 +1664,7 @@ class ImageInfo:
async
def
image_info
(
async
def
image_info
(
self
,
self
,
branch
:
str
|
None
=
None
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
edition
:
str
|
None
=
None
,
edition
:
str
|
None
=
None
,
version
:
str
|
None
=
None
,
version
:
str
|
None
=
None
,
release
:
str
|
None
=
None
,
release
:
str
|
None
=
None
,
...
@@ -1720,7 +1721,7 @@ class ImageInfo:
...
@@ -1720,7 +1721,7 @@ class ImageInfo:
await
self
.
client
.
post
(
"/image/image_status"
,
json
=
payload
)
await
self
.
client
.
post
(
"/image/image_status"
,
json
=
payload
)
async
def
image_tag_status_get
(
async
def
image_tag_status_get
(
self
,
branch
:
str
|
None
=
None
,
edition
:
str
|
None
=
None
self
,
branch
:
types
.
Branch
|
str
|
None
=
None
,
edition
:
str
|
None
=
None
)
->
models
.
ImageTagStatusGetModel
:
)
->
models
.
ImageTagStatusGetModel
:
params
=
{
params
=
{
k
:
v
k
:
v
...
@@ -1742,7 +1743,7 @@ class ImageInfo:
...
@@ -1742,7 +1743,7 @@ class ImageInfo:
async
def
last_packages_by_image
(
async
def
last_packages_by_image
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
uuid
:
str
,
uuid
:
str
,
packages_limit
:
int
|
None
=
None
,
packages_limit
:
int
|
None
=
None
,
component
:
str
|
None
=
None
,
component
:
str
|
None
=
None
,
...
@@ -1762,7 +1763,7 @@ class ImageInfo:
...
@@ -1762,7 +1763,7 @@ class ImageInfo:
async
def
last_packages_image_with_cve_fixed
(
async
def
last_packages_image_with_cve_fixed
(
self
,
self
,
branch
:
str
,
branch
:
types
.
Branch
|
str
,
uuid
:
str
,
uuid
:
str
,
packages_limit
:
int
|
None
=
None
,
packages_limit
:
int
|
None
=
None
,
component
:
str
|
None
=
None
,
component
:
str
|
None
=
None
,
...
...
altrepo/api/types.py
0 → 100644
View file @
8574c6eb
from
enum
import
StrEnum
class
Acl
(
StrEnum
):
none
=
"none"
by_nick
=
"by_nick"
by_nick_leader
=
"by_nick_leader"
by_nick_or_group
=
"by_nick_or_group"
by_nick_leader_and_group
=
"by_nick_leader_and_group"
class
PackageType
(
StrEnum
):
source
=
"source"
binary
=
"binary"
class
PackageTypeAll
(
StrEnum
):
all
=
"all"
source
=
"source"
binary
=
"binary"
class
DependencyType
(
StrEnum
):
both
=
"both"
source
=
"source"
binary
=
"binary"
class
DependencyKind
(
StrEnum
):
all
=
"all"
provide
=
"provide"
require
=
"require"
conflict
=
"conflict"
obsolete
=
"obsolete"
class
ErrataState
(
StrEnum
):
all
=
"all"
active
=
"active"
discarded
=
"discarded"
class
ErrataType
(
StrEnum
):
packages
=
"packages"
repository
=
"repository"
bug
=
"bug"
vuln
=
"vuln"
exclusion
=
"exclusion"
class
ApprovalGroup
(
StrEnum
):
maint
=
"maint"
tester
=
"tester"
class
AuthProvider
(
StrEnum
):
ldap
=
"ldap"
keycloak
=
"keycloak"
class
ImageShow
(
StrEnum
):
active
=
"active"
all
=
"all"
class
Branch
(
StrEnum
):
sisyphus
=
"sisyphus"
sisyphus_e2k
=
"sisyphus_e2k"
sisyphus_riscv64
=
"sisyphus_riscv64"
sisyphus_loongarch64
=
"sisyphus_loongarch64"
p11
=
"p11"
p10
=
"p10"
p10_e2k
=
"p10_e2k"
p9
=
"p9"
c10f2
=
"c10f2"
c9f2
=
"c9f2"
examples/acl_and_groups.py
View file @
8574c6eb
...
@@ -2,13 +2,14 @@
...
@@ -2,13 +2,14 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
client
=
ALTRepo
()
client
=
ALTRepo
()
await
client
.
init
()
await
client
.
init
()
acl
=
await
client
.
api
.
acl
.
by_packages
(
"sisyphus"
,
[
"firefox"
,
"openssh"
])
acl
=
await
client
.
api
.
acl
.
by_packages
(
Branch
.
sisyphus
,
[
"firefox"
,
"openssh"
])
print
(
"ACL пакетов:"
)
print
(
"ACL пакетов:"
)
for
pkg
in
acl
.
packages
:
for
pkg
in
acl
.
packages
:
print
(
f
" {pkg.name}: {', '.join(pkg.members) or '(группа)'}"
)
print
(
f
" {pkg.name}: {', '.join(pkg.members) or '(группа)'}"
)
...
...
examples/api_packages.py
View file @
8574c6eb
...
@@ -2,21 +2,20 @@
...
@@ -2,21 +2,20 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
client
=
ALTRepo
()
client
=
ALTRepo
()
await
client
.
init
()
await
client
.
init
()
# Информация о пакете
result
=
await
client
.
api
.
package
.
package_info
(
"firefox"
,
branch
=
Branch
.
sisyphus
)
result
=
await
client
.
api
.
package
.
package_info
(
"firefox"
,
branch
=
"sisyphus"
)
pkg
=
result
.
packages
[
0
]
pkg
=
result
.
packages
[
0
]
print
(
f
"{pkg.name} {pkg.version}-{pkg.release} (arch={pkg.arch})"
)
print
(
f
"{pkg.name} {pkg.version}-{pkg.release} (arch={pkg.arch})"
)
print
(
f
" Мейнтейнер: {pkg.packager}"
)
print
(
f
" Мейнтейнер: {pkg.packager}"
)
print
(
f
" SHA1: {pkg.sha1}"
)
print
(
f
" SHA1: {pkg.sha1}"
)
# Поиск пакетов в ветке
found
=
await
client
.
api
.
site
.
find_packages
(
"python3-module-alt"
,
branch
=
Branch
.
sisyphus
)
found
=
await
client
.
api
.
site
.
find_packages
(
"python3-module-alt"
,
branch
=
"sisyphus"
)
for
p
in
found
.
packages
[:
5
]:
for
p
in
found
.
packages
[:
5
]:
print
(
f
" {p.name}"
)
print
(
f
" {p.name}"
)
...
...
examples/api_tasks.py
View file @
8574c6eb
...
@@ -2,20 +2,19 @@
...
@@ -2,20 +2,19 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
client
=
ALTRepo
()
client
=
ALTRepo
()
await
client
.
init
()
await
client
.
init
()
# Поиск задач мейнтейнера
result
=
await
client
.
api
.
task
.
progress
.
find_tasks
(
result
=
await
client
.
api
.
task
.
progress
.
find_tasks
(
input
=
[
"fiersik"
],
branch
=
"sisyphus"
,
by_package
=
False
input
=
[
"fiersik"
],
branch
=
Branch
.
sisyphus
,
by_package
=
False
)
)
for
task
in
result
.
tasks
[:
5
]:
for
task
in
result
.
tasks
[:
5
]:
print
(
f
"#{task.task_id} [{task.task_state}] {task.task_owner}"
)
print
(
f
"#{task.task_id} [{task.task_state}] {task.task_owner}"
)
# Информация о конкретной задаче
if
result
.
tasks
:
if
result
.
tasks
:
info
=
await
client
.
api
.
task
.
task_info
(
result
.
tasks
[
0
]
.
task_id
)
info
=
await
client
.
api
.
task
.
task_info
(
result
.
tasks
[
0
]
.
task_id
)
print
(
f
"
\n
Задача #{info.id}: {info.state} ({info.branch})"
)
print
(
f
"
\n
Задача #{info.id}: {info.state} ({info.branch})"
)
...
...
examples/appstream.py
View file @
8574c6eb
...
@@ -2,13 +2,14 @@
...
@@ -2,13 +2,14 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
client
=
ALTRepo
()
client
=
ALTRepo
()
await
client
.
init
()
await
client
.
init
()
branch
=
"sisyphus"
branch
=
Branch
.
sisyphus
await
client
.
appstream
.
data
.
load_by_branch
(
branch
,
"latest"
)
await
client
.
appstream
.
data
.
load_by_branch
(
branch
,
"latest"
)
for
name
in
[
"firefox"
,
"telegram-desktop"
,
"gimp"
,
"vlc"
]:
for
name
in
[
"firefox"
,
"telegram-desktop"
,
"gimp"
,
"vlc"
]:
...
...
examples/backport_helper.py
View file @
8574c6eb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
...
@@ -9,7 +10,7 @@ async def main():
...
@@ -9,7 +10,7 @@ async def main():
await
client
.
init
()
await
client
.
init
()
result
=
await
client
.
api
.
dependencies
.
backport_helper
(
result
=
await
client
.
api
.
dependencies
.
backport_helper
(
"sisyphus"
,
"p11"
,
[
"ocaml"
]
Branch
.
sisyphus
,
Branch
.
p11
,
[
"ocaml"
]
)
)
print
(
f
"Бэкпорт ocaml из sisyphus в p11 ({result.count} пакетов):"
)
print
(
f
"Бэкпорт ocaml из sisyphus в p11 ({result.count} пакетов):"
)
for
level
in
result
.
dependencies
:
for
level
in
result
.
dependencies
:
...
...
examples/branch_compare.py
View file @
8574c6eb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
...
@@ -11,7 +12,7 @@ async def main():
...
@@ -11,7 +12,7 @@ async def main():
pkgsets
=
await
client
.
api
.
packageset
.
active_packagesets
()
pkgsets
=
await
client
.
api
.
packageset
.
active_packagesets
()
print
(
f
"Активные ветки: {', '.join(pkgsets.packagesets)}"
)
print
(
f
"Активные ветки: {', '.join(pkgsets.packagesets)}"
)
diff
=
await
client
.
api
.
packageset
.
compare_packagesets
(
"sisyphus"
,
"p11"
)
diff
=
await
client
.
api
.
packageset
.
compare_packagesets
(
Branch
.
sisyphus
,
Branch
.
p11
)
print
(
f
"
\n
sisyphus vs p11 ({len(diff.packages)} записей):"
)
print
(
f
"
\n
sisyphus vs p11 ({len(diff.packages)} записей):"
)
for
p
in
diff
.
packages
[:
10
]:
for
p
in
diff
.
packages
[:
10
]:
p1
,
p2
=
p
.
package1
,
p
.
package2
p1
,
p2
=
p
.
package1
,
p
.
package2
...
...
examples/errata_updates.py
View file @
8574c6eb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
...
@@ -11,7 +12,7 @@ async def main():
...
@@ -11,7 +12,7 @@ async def main():
branches
=
await
client
.
api
.
errata
.
errata_branches
()
branches
=
await
client
.
api
.
errata
.
errata_branches
()
print
(
f
"Ветки с эрратами: {', '.join(branches.branches)}"
)
print
(
f
"Ветки с эрратами: {', '.join(branches.branches)}"
)
adv
=
await
client
.
api
.
errata
.
advisory
(
branch
=
"p11"
,
limit
=
10
)
adv
=
await
client
.
api
.
errata
.
advisory
(
branch
=
Branch
.
p11
,
limit
=
10
)
if
adv
.
erratas
:
if
adv
.
erratas
:
print
(
f
"
\n
Последние advisory для p11:"
)
print
(
f
"
\n
Последние advisory для p11:"
)
for
e
in
adv
.
erratas
:
for
e
in
adv
.
erratas
:
...
...
examples/images.py
View file @
8574c6eb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
...
@@ -13,7 +14,7 @@ async def main():
...
@@ -13,7 +14,7 @@ async def main():
for
img
in
images
.
images
[:
5
]:
for
img
in
images
.
images
[:
5
]:
print
(
f
" {img.name} ({img.branch}, {img.date})"
)
print
(
f
" {img.name} ({img.branch}, {img.date})"
)
active
=
await
client
.
api
.
image
.
active_images
(
branch
=
"p11"
)
active
=
await
client
.
api
.
image
.
active_images
(
branch
=
Branch
.
p11
)
if
active
.
images
:
if
active
.
images
:
print
(
f
"
\n
Активные образы p11:"
)
print
(
f
"
\n
Активные образы p11:"
)
for
img
in
active
.
images
:
for
img
in
active
.
images
:
...
...
examples/maintainer_dashboard.py
View file @
8574c6eb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
,
Acl
async
def
main
():
async
def
main
():
...
@@ -9,7 +10,7 @@ async def main():
...
@@ -9,7 +10,7 @@ async def main():
await
client
.
init
()
await
client
.
init
()
nickname
=
"fiersik"
nickname
=
"fiersik"
branch
=
"sisyphus"
branch
=
Branch
.
sisyphus
info
=
await
client
.
api
.
site
.
maintainer_info
(
branch
,
nickname
)
info
=
await
client
.
api
.
site
.
maintainer_info
(
branch
,
nickname
)
mi
=
info
.
information
mi
=
info
.
information
...
@@ -20,7 +21,7 @@ async def main():
...
@@ -20,7 +21,7 @@ async def main():
for
pkg
in
pkgs
.
packages
[:
5
]:
for
pkg
in
pkgs
.
packages
[:
5
]:
print
(
f
" {pkg.name} {pkg.version}-{pkg.release}"
)
print
(
f
" {pkg.name} {pkg.version}-{pkg.release}"
)
bugs
=
await
client
.
api
.
bug
.
bugzilla_by_maintainer
(
nickname
)
bugs
=
await
client
.
api
.
bug
.
bugzilla_by_maintainer
(
nickname
,
by_acl
=
Acl
.
by_nick
)
if
bugs
and
bugs
.
bugs
:
if
bugs
and
bugs
.
bugs
:
print
(
f
"
\n
Баги ({len(bugs.bugs)}):"
)
print
(
f
"
\n
Баги ({len(bugs.bugs)}):"
)
for
bug
in
bugs
.
bugs
[:
5
]:
for
bug
in
bugs
.
bugs
[:
5
]:
...
...
examples/package_dependencies.py
View file @
8574c6eb
...
@@ -2,13 +2,14 @@
...
@@ -2,13 +2,14 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
client
=
ALTRepo
()
client
=
ALTRepo
()
await
client
.
init
()
await
client
.
init
()
branch
=
"sisyphus"
branch
=
Branch
.
sisyphus
name
=
"firefox"
name
=
"firefox"
found
=
await
client
.
api
.
site
.
find_packages
(
name
,
branch
=
branch
)
found
=
await
client
.
api
.
site
.
find_packages
(
name
,
branch
=
branch
)
...
...
examples/package_files.py
View file @
8574c6eb
...
@@ -2,13 +2,14 @@
...
@@ -2,13 +2,14 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
client
=
ALTRepo
()
client
=
ALTRepo
()
await
client
.
init
()
await
client
.
init
()
branch
=
"sisyphus"
branch
=
Branch
.
sisyphus
files
=
await
client
.
api
.
file
.
search
(
branch
,
"nginx.conf"
)
files
=
await
client
.
api
.
file
.
search
(
branch
,
"nginx.conf"
)
print
(
f
"Файлы nginx.conf ({len(files.files)}):"
)
print
(
f
"Файлы nginx.conf ({len(files.files)}):"
)
...
...
examples/security_audit.py
View file @
8574c6eb
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
asyncio
import
asyncio
from
altrepo
import
ALTRepo
from
altrepo
import
ALTRepo
from
altrepo.api.types
import
Branch
async
def
main
():
async
def
main
():
...
@@ -13,7 +14,7 @@ async def main():
...
@@ -13,7 +14,7 @@ async def main():
for
pkg
in
fixes
.
packages
[:
5
]:
for
pkg
in
fixes
.
packages
[:
5
]:
print
(
f
" {pkg.name} {pkg.version}-{pkg.release} ({pkg.branch})"
)
print
(
f
" {pkg.name} {pkg.version}-{pkg.release} ({pkg.branch})"
)
erratas
=
await
client
.
api
.
errata
.
search
(
branch
=
"p11"
,
name
=
"openssh"
)
erratas
=
await
client
.
api
.
errata
.
search
(
branch
=
Branch
.
p11
,
name
=
"openssh"
)
if
erratas
.
erratas
:
if
erratas
.
erratas
:
print
(
f
"
\n
Эрраты openssh в p11:"
)
print
(
f
"
\n
Эрраты openssh в p11:"
)
for
e
in
erratas
.
erratas
[:
5
]:
for
e
in
erratas
.
erratas
[:
5
]:
...
...
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