Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
799aedec
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
32
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
799aedec
编写于
6月 28, 2020
作者:
Y
Yiru Wang Mac
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change the public method to private and change the method name
上级
14a4da77
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
17 deletion
+17
-17
packageship/packageship/application/apps/package/function/constants.py
...ackageship/application/apps/package/function/constants.py
+1
-0
packageship/packageship/application/apps/package/function/install_depend.py
...eship/application/apps/package/function/install_depend.py
+6
-9
packageship/packageship/application/apps/package/function/searchdb.py
...packageship/application/apps/package/function/searchdb.py
+9
-7
packageship/packageship/application/apps/package/view.py
packageship/packageship/application/apps/package/view.py
+1
-1
未找到文件。
packageship/packageship/application/apps/package/function/constants.py
浏览文件 @
799aedec
...
@@ -53,6 +53,7 @@ class ResponseCode():
...
@@ -53,6 +53,7 @@ class ResponseCode():
PACK_NAME_NOT_FOUND
:
"Sorry! The querying package does not exist in the databases"
,
PACK_NAME_NOT_FOUND
:
"Sorry! The querying package does not exist in the databases"
,
CONNECT_DB_ERROR
:
"Failed to Connect the database! "
CONNECT_DB_ERROR
:
"Failed to Connect the database! "
"Please check the database connection"
,
"Please check the database connection"
,
INPUT_NONE
:
"The input is None, please check the input value."
,
FILE_NOT_FOUND
:
"Database import success file does not exist"
,
FILE_NOT_FOUND
:
"Database import success file does not exist"
,
DELETE_DB_ERROR
:
"Failed to delete database"
,
DELETE_DB_ERROR
:
"Failed to delete database"
,
CONFIGFILE_PATH_EMPTY
:
"Initialization profile does not exist or cannot be found"
,
CONFIGFILE_PATH_EMPTY
:
"Initialization profile does not exist or cannot be found"
,
...
...
packageship/packageship/application/apps/package/function/install_depend.py
浏览文件 @
799aedec
...
@@ -26,7 +26,7 @@ class InstallDepend():
...
@@ -26,7 +26,7 @@ class InstallDepend():
self
.
db_list
=
db_list
self
.
db_list
=
db_list
self
.
search_db
=
SearchDB
(
db_list
)
self
.
search_db
=
SearchDB
(
db_list
)
def
install_depend_result
(
self
,
binary_list
,
history_dicts
=
None
):
def
query_install_depend
(
self
,
binary_list
,
history_dicts
=
None
):
'''
'''
Description: init result dict and determint the loop end point
Description: init result dict and determint the loop end point
:param binary_list: A list of binary rpm package name
:param binary_list: A list of binary rpm package name
...
@@ -46,26 +46,24 @@ class InstallDepend():
...
@@ -46,26 +46,24 @@ class InstallDepend():
if
not
self
.
search_db
.
db_object_dict
:
if
not
self
.
search_db
.
db_object_dict
:
return
ResponseCode
.
DIS_CONNECTION_DB
,
None
return
ResponseCode
.
DIS_CONNECTION_DB
,
None
if
not
binary_list
:
if
not
binary_list
:
response_code
=
ResponseCode
.
INPUT_NONE
,
return
ResponseCode
.
INPUT_NONE
,
None
return
response_code
,
None
for
binary
in
binary_list
:
for
binary
in
binary_list
:
if
binary
:
if
binary
:
self
.
search_list
.
append
(
binary
)
self
.
search_list
.
append
(
binary
)
else
:
else
:
LOGGER
.
logger
.
warning
(
"There is a NONE in input value:"
+
str
(
binary_list
))
LOGGER
.
logger
.
warning
(
"There is a NONE in input value:"
+
str
(
binary_list
))
while
self
.
search_list
:
while
self
.
search_list
:
response_code
=
self
.
query_install
(
history_dicts
)
self
.
__query_single_install_dep
(
history_dicts
)
return
response_code
,
self
.
binary_dict
.
dictionary
if
response_code
!=
\
return
ResponseCode
.
SUCCESS
,
self
.
binary_dict
.
dictionary
ResponseCode
.
DIS_CONNECTION_DB
else
None
def
query_install
(
self
,
history_dicts
):
def
__query_single_install_dep
(
self
,
history_dicts
):
"""
"""
Description: query a package install depend and append to result
Description: query a package install depend and append to result
:param history_dicts
:param history_dicts
:return response_code
:return response_code
changeLog:
changeLog:
"""
"""
res
ponse_code
,
res
ult_list
=
self
.
search_db
.
get_install_depend
(
self
.
search_list
)
result_list
=
self
.
search_db
.
get_install_depend
(
self
.
search_list
)
for
search
in
self
.
search_list
:
for
search
in
self
.
search_list
:
if
search
not
in
self
.
binary_dict
.
dictionary
:
if
search
not
in
self
.
binary_dict
.
dictionary
:
self
.
binary_dict
.
init_key
(
key
=
search
,
parent_node
=
[])
self
.
binary_dict
.
init_key
(
key
=
search
,
parent_node
=
[])
...
@@ -99,7 +97,6 @@ class InstallDepend():
...
@@ -99,7 +97,6 @@ class InstallDepend():
self
.
binary_dict
.
init_key
(
key
=
result
.
depend_name
,
self
.
binary_dict
.
init_key
(
key
=
result
.
depend_name
,
parent_node
=
[[
result
.
search_name
,
'install'
]])
parent_node
=
[[
result
.
search_name
,
'install'
]])
self
.
search_list
.
append
(
result
.
depend_name
)
self
.
search_list
.
append
(
result
.
depend_name
)
return
response_code
class
DictionaryOperations
():
class
DictionaryOperations
():
'''
'''
...
...
packageship/packageship/application/apps/package/function/searchdb.py
浏览文件 @
799aedec
...
@@ -47,16 +47,18 @@ class SearchDB():
...
@@ -47,16 +47,18 @@ class SearchDB():
:return install depend list
:return install depend list
changeLog:
changeLog:
"""
"""
result_list
=
[]
get_list
=
[]
if
not
self
.
db_object_dict
:
if
not
self
.
db_object_dict
:
return
ResponseCode
.
DIS_CONNECTION_DB
,
None
LOGGER
.
logger
.
warning
(
"Unable to connect to the database,
\
check the database configuration"
)
return
result_list
if
None
in
binary_list
:
if
None
in
binary_list
:
binary_list
.
remove
(
None
)
binary_list
.
remove
(
None
)
search_set
=
set
(
binary_list
)
search_set
=
set
(
binary_list
)
result_list
=
[]
get_list
=
[]
if
not
search_set
:
if
not
search_set
:
return
ResponseCode
.
INPUT_NONE
,
None
LOGGER
.
logger
.
warning
(
"The input is None, please check the input value."
)
return
result_list
for
db_name
,
data_base
in
self
.
db_object_dict
.
items
():
for
db_name
,
data_base
in
self
.
db_object_dict
.
items
():
try
:
try
:
name_in
=
literal_column
(
'name'
).
in_
(
search_set
)
name_in
=
literal_column
(
'name'
).
in_
(
search_set
)
...
@@ -88,7 +90,7 @@ class SearchDB():
...
@@ -88,7 +90,7 @@ class SearchDB():
get_list
.
clear
()
get_list
.
clear
()
search_set
.
symmetric_difference_update
(
get_set
)
search_set
.
symmetric_difference_update
(
get_set
)
if
not
search_set
:
if
not
search_set
:
return
ResponseCode
.
SUCCESS
,
result_list
return
result_list
else
:
else
:
continue
continue
except
AttributeError
as
error_msg
:
except
AttributeError
as
error_msg
:
...
@@ -101,7 +103,7 @@ class SearchDB():
...
@@ -101,7 +103,7 @@ class SearchDB():
for
binary_name
in
search_set
:
for
binary_name
in
search_set
:
result_list
.
append
((
return_tuple
(
None
,
None
,
None
,
result_list
.
append
((
return_tuple
(
None
,
None
,
None
,
binary_name
,
None
,
None
),
'NOT FOUND'
))
binary_name
,
None
,
None
),
'NOT FOUND'
))
return
ResponseCode
.
SUCCESS
,
result_list
return
result_list
def
get_src_name
(
self
,
binary_name
):
def
get_src_name
(
self
,
binary_name
):
"""
"""
...
...
packageship/packageship/application/apps/package/view.py
浏览文件 @
799aedec
...
@@ -274,7 +274,7 @@ class InstallDepend(Resource):
...
@@ -274,7 +274,7 @@ class InstallDepend(Resource):
)
)
response_code
,
install_dict
=
\
response_code
,
install_dict
=
\
installdepend
(
db_list
).
install_depend_result
([
pkg_name
])
installdepend
(
db_list
).
query_install_depend
([
pkg_name
])
if
not
install_dict
:
if
not
install_dict
:
return
jsonify
(
return
jsonify
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录