Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
c679f530
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c679f530
编写于
5月 11, 2015
作者:
R
Rudá Moura
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #589 from clebergnu/plugins-improve-list-view-v2
Plugins improve list view [v2]
上级
5e1eb794
b6bc2dae
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
26 deletion
+34
-26
avocado/core/job.py
avocado/core/job.py
+2
-2
avocado/core/plugins/builtin.py
avocado/core/plugins/builtin.py
+5
-4
avocado/core/plugins/htmlresult.py
avocado/core/plugins/htmlresult.py
+1
-10
avocado/core/plugins/manager.py
avocado/core/plugins/manager.py
+0
-1
avocado/core/plugins/plugin_list.py
avocado/core/plugins/plugin_list.py
+26
-9
未找到文件。
avocado/core/job.py
浏览文件 @
c679f530
...
...
@@ -45,10 +45,10 @@ from avocado.settings import settings
try
:
from
avocado.core.plugins
import
htmlresult
HTML_REPORT_SUPPORT
=
True
except
ImportError
:
HTML_REPORT_SUPPORT
=
False
else
:
HTML_REPORT_SUPPORT
=
htmlresult
.
HTML_REPORT_CAPABLE
_NEW_ISSUE_LINK
=
'https://github.com/avocado-framework/avocado/issues/new'
...
...
avocado/core/plugins/builtin.py
浏览文件 @
c679f530
...
...
@@ -36,6 +36,8 @@ Exclude = ['avocado.core.plugins.__init__',
Builtins
=
[
x
for
x
in
Modules
if
x
not
in
Exclude
]
ErrorsLoading
=
[]
def
load_builtins
():
"""
...
...
@@ -47,11 +49,10 @@ def load_builtins():
for
module
in
Builtins
:
try
:
plugin_mod
=
import_module
(
module
)
except
ImportError
as
err
:
log
.
error
(
"Could not import module plugin '%s': %s"
,
module
,
err
)
continue
except
Exception
as
err
:
log
.
error
(
"Module plugin '%s' with error: %s"
,
module
,
err
)
name
=
str
(
module
)
reason
=
'%s %s'
%
(
str
(
err
.
__class__
.
__name__
),
err
)
ErrorsLoading
.
append
((
name
,
reason
))
continue
for
name
in
plugin_mod
.
__dict__
:
obj
=
getattr
(
plugin_mod
,
name
)
...
...
avocado/core/plugins/htmlresult.py
浏览文件 @
c679f530
...
...
@@ -20,13 +20,7 @@ import shutil
import
sys
import
time
import
subprocess
try
:
import
pystache
except
ImportError
:
HTML_REPORT_CAPABLE
=
False
else
:
HTML_REPORT_CAPABLE
=
True
import
pystache
from
avocado
import
runtime
from
avocado.core
import
exit_codes
...
...
@@ -282,9 +276,6 @@ class HTML(plugin.Plugin):
enabled
=
True
def
configure
(
self
,
parser
):
if
HTML_REPORT_CAPABLE
is
False
:
self
.
enabled
=
False
return
self
.
parser
=
parser
self
.
parser
.
runner
.
output
.
add_argument
(
'--html'
,
type
=
str
,
...
...
avocado/core/plugins/manager.py
浏览文件 @
c679f530
...
...
@@ -35,7 +35,6 @@ class PluginManager(object):
def
__init__
(
self
):
self
.
plugins
=
[]
self
.
disabled_plugins
=
[]
def
add_plugin
(
self
,
plugin
):
self
.
plugins
.
append
(
plugin
)
...
...
avocado/core/plugins/plugin_list.py
浏览文件 @
c679f530
...
...
@@ -12,9 +12,10 @@
# Copyright: Red Hat Inc. 2013-2014
# Author: Ruda Moura <rmoura@redhat.com>
from
avocado.core
import
output
from
avocado.core.plugins
import
plugin
from
avocado.core.plugins.builtin
import
ErrorsLoading
from
avocado.core.plugins.manager
import
get_plugin_manager
from
avocado.core
import
output
class
PluginList
(
plugin
.
Plugin
):
...
...
@@ -40,18 +41,34 @@ class PluginList(plugin.Plugin):
view
=
output
.
View
(
app_args
=
args
,
use_paginator
=
args
.
paginator
==
'on'
)
pm
=
get_plugin_manager
()
view
.
notify
(
event
=
'message'
,
msg
=
'Plugins loaded:'
)
enabled
=
[
p
for
p
in
pm
.
plugins
if
p
.
enabled
]
disabled
=
[
p
for
p
in
pm
.
plugins
if
not
p
.
enabled
]
blength
=
0
for
plug
in
pm
.
plugins
:
clength
=
len
(
plug
.
name
)
if
clength
>
blength
:
blength
=
clength
for
load_error
in
ErrorsLoading
:
clength
=
len
(
load_error
[
0
])
if
clength
>
blength
:
blength
=
clength
format_str
=
" %-"
+
str
(
blength
+
1
)
+
"s %s"
if
enabled
:
view
.
notify
(
event
=
'message'
,
msg
=
output
.
term_support
.
healthy_str
(
"Plugins enabled:"
))
for
plug
in
sorted
(
enabled
):
view
.
notify
(
event
=
'minor'
,
msg
=
format_str
%
(
plug
.
name
,
plug
.
description
))
if
disabled
:
view
.
notify
(
event
=
'message'
,
msg
=
output
.
term_support
.
fail_header_str
(
'Plugins disabled:'
))
for
plug
in
sorted
(
disabled
):
view
.
notify
(
event
=
'minor'
,
msg
=
format_str
%
(
plug
.
name
,
"Disabled during plugin configuration"
))
if
ErrorsLoading
:
view
.
notify
(
event
=
'message'
,
msg
=
output
.
term_support
.
fail_header_str
(
'Unloadable plugin modules:'
))
for
load_error
in
sorted
(
ErrorsLoading
):
view
.
notify
(
event
=
'minor'
,
msg
=
format_str
%
(
load_error
[
0
],
load_error
[
1
]))
format_str
=
" %-"
+
str
(
blength
)
+
"s %s %s"
for
plug
in
sorted
(
pm
.
plugins
):
if
plug
.
enabled
:
status
=
"(Enabled)"
else
:
status
=
"(Disabled)"
view
.
notify
(
event
=
'minor'
,
msg
=
format_str
%
(
plug
.
name
,
plug
.
description
,
status
))
view
.
cleanup
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录