Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
2f476bb0
D
Dak
项目概览
喜羊羊3508
/
Dak
10 个月 前同步成功
通知
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 搜索 >>
提交
2f476bb0
编写于
10月 26, 2009
作者:
C
Chris Lamb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No need to assign to a local now that @session_wrapper does the cleanup
Signed-off-by:
N
Chris Lamb
<
lamby@debian.org
>
上级
1f7d2e0d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
44 deletion
+14
-44
daklib/dbconn.py
daklib/dbconn.py
+14
-44
未找到文件。
daklib/dbconn.py
浏览文件 @
2f476bb0
...
...
@@ -223,9 +223,7 @@ def get_suites_binary_in(package, session=None):
@return: list of Suite objects for the given package
"""
ret
=
session
.
query
(
Suite
).
join
(
BinAssociation
).
join
(
DBBinary
).
filter_by
(
package
=
package
).
all
()
return
ret
return
session
.
query
(
Suite
).
join
(
BinAssociation
).
join
(
DBBinary
).
filter_by
(
package
=
package
).
all
()
__all__
.
append
(
'get_suites_binary_in'
)
...
...
@@ -308,9 +306,7 @@ def get_binaries_from_source_id(source_id, session=None):
@return: list of DBBinary objects for the given name (may be empty)
"""
ret
=
session
.
query
(
DBBinary
).
filter_by
(
source_id
=
source_id
).
all
()
return
ret
return
session
.
query
(
DBBinary
).
filter_by
(
source_id
=
source_id
).
all
()
__all__
.
append
(
'get_binaries_from_source_id'
)
...
...
@@ -330,9 +326,7 @@ def get_binary_from_name_suite(package, suitename, session=None):
AND su.suite_name=:suitename
ORDER BY b.version DESC"""
ret
=
session
.
execute
(
sql
,
{
'package'
:
package
,
'suitename'
:
suitename
})
return
ret
return
session
.
execute
(
sql
,
{
'package'
:
package
,
'suitename'
:
suitename
})
__all__
.
append
(
'get_binary_from_name_suite'
)
...
...
@@ -349,9 +343,7 @@ def get_binary_components(package, suitename, arch, session=None):
vals
=
{
'package'
:
package
,
'suitename'
:
suitename
,
'arch'
:
arch
}
ret
=
session
.
execute
(
query
,
vals
)
return
ret
return
session
.
execute
(
query
,
vals
)
__all__
.
append
(
'get_binary_components'
)
...
...
@@ -513,9 +505,7 @@ def get_contents(suite, overridetype, section=None, session=None):
contents_q
+=
" ORDER BY fn"
ret
=
session
.
execute
(
contents_q
,
vals
)
return
ret
return
session
.
execute
(
contents_q
,
vals
)
__all__
.
append
(
'get_contents'
)
...
...
@@ -686,9 +676,7 @@ def get_dscfiles(dscfile_id=None, source_id=None, poolfile_id=None, session=None
if
poolfile_id
is
not
None
:
q
=
q
.
filter_by
(
poolfile_id
=
poolfile_id
)
ret
=
q
.
all
()
return
ret
return
q
.
all
()
__all__
.
append
(
'get_dscfiles'
)
...
...
@@ -795,9 +783,7 @@ def get_poolfile_by_name(filename, location_id=None, session=None):
if
location_id
is
not
None
:
q
=
q
.
join
(
Location
).
filter_by
(
location_id
=
location_id
)
ret
=
q
.
all
()
return
ret
return
q
.
all
()
__all__
.
append
(
'get_poolfile_by_name'
)
...
...
@@ -816,9 +802,7 @@ def get_poolfile_like_name(filename, session=None):
# TODO: There must be a way of properly using bind parameters with %FOO%
q
=
session
.
query
(
PoolFile
).
filter
(
PoolFile
.
filename
.
like
(
'%%%s%%'
%
filename
))
ret
=
q
.
all
()
return
ret
return
q
.
all
()
__all__
.
append
(
'get_poolfile_like_name'
)
...
...
@@ -1088,9 +1072,7 @@ def has_new_comment(package, version, session=None):
q
=
q
.
filter_by
(
package
=
package
)
q
=
q
.
filter_by
(
version
=
version
)
ret
=
q
.
count
()
>
0
return
ret
return
bool
(
q
.
count
()
>
0
)
__all__
.
append
(
'has_new_comment'
)
...
...
@@ -1122,9 +1104,7 @@ def get_new_comments(package=None, version=None, comment_id=None, session=None):
if
version
is
not
None
:
q
=
q
.
filter_by
(
version
=
version
)
if
comment_id
is
not
None
:
q
=
q
.
filter_by
(
comment_id
=
comment_id
)
ret
=
q
.
all
()
return
ret
return
q
.
all
()
__all__
.
append
(
'get_new_comments'
)
...
...
@@ -1182,9 +1162,7 @@ def get_override(package, suite=None, component=None, overridetype=None, session
if
not
isinstance
(
overridetype
,
list
):
overridetype
=
[
overridetype
]
q
=
q
.
join
(
OverrideType
).
filter
(
OverrideType
.
overridetype
.
in_
(
overridetype
))
ret
=
q
.
all
()
return
ret
return
q
.
all
()
__all__
.
append
(
'get_override'
)
...
...
@@ -1223,8 +1201,6 @@ def get_override_type(override_type, session=None):
except
NoResultFound
:
return
None
return
ret
__all__
.
append
(
'get_override_type'
)
################################################################################
...
...
@@ -1737,9 +1713,7 @@ def get_suites_source_in(source, session=None):
@return: list of Suite objects for the given source
"""
ret
=
session
.
query
(
Suite
).
join
(
SrcAssociation
).
join
(
DBSource
).
filter_by
(
source
=
source
).
all
()
return
ret
return
session
.
query
(
Suite
).
join
(
SrcAssociation
).
join
(
DBSource
).
filter_by
(
source
=
source
).
all
()
__all__
.
append
(
'get_suites_source_in'
)
...
...
@@ -1774,9 +1748,7 @@ def get_sources_from_name(source, version=None, dm_upload_allowed=None, session=
if
dm_upload_allowed
is
not
None
:
q
=
q
.
filter_by
(
dm_upload_allowed
=
dm_upload_allowed
)
ret
=
q
.
all
()
return
ret
return
q
.
all
()
__all__
.
append
(
'get_sources_from_name'
)
...
...
@@ -1987,9 +1959,7 @@ def get_suite_architectures(suite, skipsrc=False, skipall=False, session=None):
q
=
q
.
order_by
(
'arch_string'
)
ret
=
q
.
all
()
return
ret
return
q
.
all
()
__all__
.
append
(
'get_suite_architectures'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录