Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
2515236f
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,发现更多精彩内容 >>
提交
2515236f
编写于
8月 24, 2020
作者:
S
Shinwell Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean up pylint warning of oa_upgradable.py
上级
2aacfdfe
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
18 deletion
+26
-18
advisors/oa_upgradable.py
advisors/oa_upgradable.py
+26
-18
未找到文件。
advisors/oa_upgradable.py
100644 → 100755
浏览文件 @
2515236f
...
...
@@ -2,16 +2,13 @@
"""
This is a script to check upgradable information against upstream
"""
from
pyrpm.spec
import
Spec
,
replace_macros
import
yaml
import
json
import
datetime
import
sys
import
os
import
sys
import
argparse
import
urllib.error
from
pyrpm.spec
import
Spec
,
replace_macros
import
yaml
import
gitee
import
check_upstream
...
...
@@ -22,7 +19,8 @@ def _get_rec_excpt():
"""
Get except case of version recommend
"""
y_file
=
open
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"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
...
...
@@ -31,10 +29,10 @@ def _filter_except(excpts, sources):
"""
Filter except case in sources
"""
for
e
in
excpts
:
sources
=
[
s
for
s
in
sources
if
e
not
in
s
]
for
e
xp
in
excpts
:
sources
=
[
s
for
s
in
sources
if
e
xp
not
in
s
]
return
sources
def
get_ver_tags
(
gt
,
repo
,
cwd_path
=
None
):
"""
...
...
@@ -44,7 +42,8 @@ def get_ver_tags(gt, repo, cwd_path=None):
try
:
repo_yaml
=
open
(
os
.
path
.
join
(
cwd_path
,
repo
+
".yaml"
)).
read
()
except
FileNotFoundError
:
print
(
"WARNING: {pkg}.yaml can't be found in local path: {path}."
.
format
(
pkg
=
repo
,
path
=
cwd_path
))
print
(
"WARNING: {pkg}.yaml can't be found in local path: {path}."
.
format
(
pkg
=
repo
,
path
=
cwd_path
))
repo_yaml
=
gt
.
get_yaml
(
repo
)
else
:
repo_yaml
=
gt
.
get_yaml
(
repo
)
...
...
@@ -84,18 +83,21 @@ def get_ver_tags(gt, repo, cwd_path=None):
excpt_list
=
_get_rec_excpt
()
if
repo
in
excpt_list
:
tags
=
_filter_except
(
excpt_list
[
repo
],
tags
)
tags
=
_filter_except
(
excpt_list
[
repo
],
tags
)
return
tags
if
__name__
==
"__main__"
:
def
main
():
"""
Main entrance of the functionality
"""
parameters
=
argparse
.
ArgumentParser
()
parameters
.
add_argument
(
"-p"
,
"--push"
,
action
=
"store_true"
,
help
=
"Push the version bump as an issue to src-openeuler repository"
)
help
=
"Push the version bump as an issue to src-openeuler repository"
)
parameters
.
add_argument
(
"-d"
,
"--default"
,
type
=
str
,
default
=
os
.
getcwd
(),
help
=
"The fallback place to look for YAML information"
)
help
=
"The fallback place to look for YAML information"
)
parameters
.
add_argument
(
"repo"
,
type
=
str
,
help
=
"Repository to be checked for upstream version info"
)
help
=
"Repository to be checked for upstream version info"
)
args
=
parameters
.
parse_args
()
...
...
@@ -140,4 +142,10 @@ Please consider upgrading.
Yours openEuler Advisor.
If you think this is not proper issue, Please visit https://gitee.com/openeuler/openEuler-Advisor.
Issues and feedbacks are welcome."""
.
format
(
repo
=
args
.
repo
,
ver
=
ver_rec
.
latest_version
,
cur_ver
=
cur_version
))
Issues and feedbacks are welcome."""
.
format
(
repo
=
args
.
repo
,
ver
=
ver_rec
.
latest_version
,
cur_ver
=
cur_version
))
if
__name__
==
"__main__"
:
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录