Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
1d539f9a
D
Dak
项目概览
喜羊羊3508
/
Dak
8 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
1d539f9a
编写于
3月 18, 2023
作者:
A
Ansgar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cruft.py: add some type annotations
上级
80343838
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
9 deletion
+9
-9
daklib/cruft.py
daklib/cruft.py
+9
-9
未找到文件。
daklib/cruft.py
浏览文件 @
1d539f9a
...
...
@@ -27,7 +27,7 @@ from sqlalchemy import func
from
sqlalchemy.orm
import
object_session
,
aliased
def
newer_version
(
lowersuite_name
,
highersuite_name
,
session
,
include_equal
=
False
)
:
def
newer_version
(
lowersuite_name
:
str
,
highersuite_name
:
str
,
session
,
include_equal
=
False
)
->
list
[
tuple
[
str
,
str
,
str
]]
:
'''
Finds newer versions in lowersuite_name than in highersuite_name. Returns a
list of tuples (source, higherversion, lowerversion) where higherversion is
...
...
@@ -132,7 +132,7 @@ def newer_version(lowersuite_name, highersuite_name, session, include_equal=Fals
return
list
def
get_package_names
(
suite
):
def
get_package_names
(
suite
:
Suite
):
'''
Returns a query that selects all distinct package names from suite ordered
by package name.
...
...
@@ -149,7 +149,7 @@ class NamedSource:
suite.
'''
def
__init__
(
self
,
suite
,
source
):
def
__init__
(
self
,
suite
:
Suite
,
source
:
str
):
self
.
source
=
source
query
=
suite
.
sources
.
filter_by
(
source
=
source
).
\
order_by
(
DBSource
.
version
)
...
...
@@ -171,7 +171,7 @@ class DejavuBinary:
built from multiple source packages.
'''
def
__init__
(
self
,
suite
,
package
):
def
__init__
(
self
,
suite
:
Suite
,
package
:
str
):
self
.
package
=
package
session
=
object_session
(
suite
)
# We need a subquery to make sure that both binary and source packages
...
...
@@ -184,7 +184,7 @@ class DejavuBinary:
for
source
,
in
src_query
:
self
.
sources
.
append
(
str
(
NamedSource
(
suite
,
source
)))
def
has_multiple_sources
(
self
):
def
has_multiple_sources
(
self
)
->
bool
:
'Has the package been built by multiple sources?'
return
len
(
self
.
sources
)
>
1
...
...
@@ -192,7 +192,7 @@ class DejavuBinary:
return
"%s built by: %s"
%
(
self
.
package
,
", "
.
join
(
self
.
sources
))
def
report_multiple_source
(
suite
)
:
def
report_multiple_source
(
suite
:
Suite
)
->
None
:
'''
Reports binary packages built from multiple source package with different
names.
...
...
@@ -208,7 +208,7 @@ def report_multiple_source(suite):
print
()
def
query_without_source
(
suite_id
,
session
):
def
query_without_source
(
suite_id
:
int
,
session
):
"""searches for arch: all packages from suite that do no longer
reference a source package in the same suite
...
...
@@ -230,7 +230,7 @@ def query_without_source(suite_id, session):
return
session
.
execute
(
query
,
{
'suite_id'
:
suite_id
})
def
queryNBS
(
suite_id
,
session
):
def
queryNBS
(
suite_id
:
int
,
session
):
"""This one is really complex. It searches arch != all packages that
are no longer built from current source packages in suite.
...
...
@@ -305,7 +305,7 @@ with
return
session
.
execute
(
query
,
{
'suite_id'
:
suite_id
})
def
queryNBS_metadata
(
suite_id
,
session
):
def
queryNBS_metadata
(
suite_id
:
int
,
session
):
"""searches for NBS packages based on metadata extraction of the
newest source for a given suite"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录