Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
4ee24ba5
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,发现更多精彩内容 >>
提交
4ee24ba5
编写于
7月 25, 2020
作者:
L
Leo Fang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve get_yaml() in gitee.py and bugfix for oa_upgradable.py
Signed-off-by:
N
Leo Fang
<
leofang_94@163.com
>
上级
2781a7b1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
16 deletion
+12
-16
advisors/gitee.py
advisors/gitee.py
+2
-2
advisors/oa_upgradable.py
advisors/oa_upgradable.py
+10
-14
未找到文件。
advisors/gitee.py
浏览文件 @
4ee24ba5
...
...
@@ -131,7 +131,7 @@ Yours openEuler-Advisor.
def
get_yaml
(
self
,
pkg
,
br
=
"master"
):
"""
g
et upstream yaml metadata for specific package
G
et upstream yaml metadata for specific package
"""
yamlurl
=
self
.
advisor_url_template
.
format
(
package
=
pkg
)
try
:
...
...
@@ -145,7 +145,7 @@ Yours openEuler-Advisor.
except
urllib
.
error
.
HTTPError
:
resp
=
"Not found"
if
re
.
match
(
"Not found"
,
resp
):
print
(
"Cann
ot find upstream metadata"
)
print
(
"Cann
't find yaml metadata for {package} from upstream-info."
.
format
(
package
=
pkg
)
)
return
False
else
:
return
resp
...
...
advisors/oa_upgradable.py
浏览文件 @
4ee24ba5
...
...
@@ -22,30 +22,26 @@ def _get_rec_excpt():
"""
Get except case of version recommend
"""
y_file
=
open
(
os
.
getcwd
()
+
"/helper/ver_rec_excpt.yaml"
)
y_file
=
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"helper/ver_rec_excpt.yaml"
)
)
excpt
=
yaml
.
load
(
y_file
,
Loader
=
yaml
.
Loader
)
return
excpt
def
get_ver_tags
(
gt
,
repo
,
d_path
=
None
):
def
get_ver_tags
(
gt
,
repo
,
cwd_path
=
None
):
"""
Get version tags of given package
"""
repo_yaml
=
""
if
d_path
:
if
cw
d_path
:
try
:
repo_yaml
=
open
(
os
.
path
.
join
(
d_path
,
repo
+
".yaml"
)).
read
()
repo_yaml
=
open
(
os
.
path
.
join
(
cw
d_path
,
repo
+
".yaml"
)).
read
()
except
FileNotFoundError
:
print
(
"Failed to get YAML info from default path."
)
if
not
repo_yaml
:
try
:
print
(
"Cann't find yaml metadata for {pkg} from current working directory."
.
format
(
pkg
=
repo
))
repo_yaml
=
gt
.
get_yaml
(
repo
)
except
urllib
.
error
.
HTTPError
:
print
(
"Failed to get YAML info for {pkg}"
.
format
(
pkg
=
repo
))
return
None
pkg_info
=
yaml
.
load
(
repo_yaml
,
Loader
=
yaml
.
Loader
)
if
repo_yaml
:
pkg_info
=
yaml
.
load
(
repo_yaml
,
Loader
=
yaml
.
Loader
)
else
:
return
None
vc_type
=
pkg_info
[
"version_control"
]
if
vc_type
==
"hg"
:
...
...
@@ -65,7 +61,7 @@ def get_ver_tags(gt, repo, d_path=None):
else
:
print
(
"Unsupport version control method {vc}"
.
format
(
vc
=
vc_type
))
return
None
excpt_list
=
_get_rec_excpt
()
if
repo
in
excpt_list
:
for
excpt
in
excpt_list
[
repo
]:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录