Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
8eb142b7
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
41
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看板
提交
8eb142b7
编写于
8月 08, 2020
作者:
Z
ZhangYifan
提交者:
chenyanpanHW
8月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
!3 命令行工具修改
Merge pull request !3 from ZhangYifan/cli_tool
上级
2845d4d7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
22 deletion
+15
-22
patch-tracking/patch_tracking/cli/patch_tracking_cli.py
patch-tracking/patch_tracking/cli/patch_tracking_cli.py
+15
-22
未找到文件。
patch-tracking/patch_tracking/cli/patch_tracking_cli.py
浏览文件 @
8eb142b7
...
...
@@ -21,10 +21,7 @@ def query_table(args):
if
args
.
table
==
"tracking"
:
url
=
'/'
.
join
([
'https:/'
,
server
,
'tracking'
])
if
args
.
branch
and
args
.
repo
:
params
=
{
'repo'
:
args
.
repo
,
'branch'
:
args
.
branch
}
else
:
params
=
{
'repo'
:
args
.
repo
}
params
=
{
'repo'
:
args
.
repo
,
'branch'
:
args
.
branch
}
try
:
ret
=
requests
.
get
(
url
,
params
=
params
,
verify
=
False
)
if
ret
.
status_code
==
200
and
ret
.
json
()[
'code'
]
==
'2001'
:
...
...
@@ -229,19 +226,15 @@ def delete(args):
print
(
'Tracking delete successfully.'
)
return
print
(
"Tracking delete failed. Error:
%s"
,
ret
)
print
(
"Tracking delete failed. Error:
{}"
.
format
(
ret
.
text
)
)
except
Exception
as
exception
:
print
(
'
Error: Connect server error: %s'
,
str
(
exception
))
print
(
'
Connect server error: '
+
str
(
exception
))
def
query
(
args
):
"""
query table data
"""
if
args
.
branch
and
not
args
.
repo
:
print
(
query_usage
)
return
query table data
"""
status
,
ret
=
query_table
(
args
)
if
status
==
"success"
:
df
=
pandas
.
DataFrame
.
from_dict
(
ret
.
json
()[
"data"
],
orient
=
"columns"
)
...
...
@@ -282,16 +275,16 @@ def dir_input_track(dir_path, args):
load tracking from dir
"""
if
os
.
path
.
exists
(
dir_path
)
and
os
.
path
.
isdir
(
dir_path
):
for
root
,
_
,
files
in
os
.
walk
(
dir_path
):
if
not
files
:
print
(
'error: dir path empty'
)
return
for
file
in
files
:
if
os
.
path
.
splitext
(
file
)[
-
1
]
==
".yaml"
:
file_path
=
os
.
path
.
join
(
root
,
file
)
file_input_track
(
file_path
,
args
)
else
:
print
(
'Please input yaml file. Error in {}'
.
format
(
file
))
dir_files
=
os
.
listdir
(
dir_path
)
if
not
dir_
files
:
print
(
'error: dir path empty'
)
return
for
file
in
dir_
files
:
if
os
.
path
.
isfile
(
os
.
path
.
join
(
dir_path
,
file
))
and
os
.
path
.
splitext
(
file
)[
-
1
]
==
".yaml"
:
file_path
=
os
.
path
.
join
(
dir_path
,
file
)
file_input_track
(
file_path
,
args
)
else
:
print
(
'Please input yaml file. Error in {}'
.
format
(
file
))
else
:
print
(
'error: dir path error. Params error in {}'
.
format
(
dir_path
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录