Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
89d4978b
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
89d4978b
编写于
8月 28, 2014
作者:
L
Lucas Meneghel Rodrigues
提交者:
Lucas Meneghel Rodrigues
8月 28, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #171 from lmr/trivial-fixes-sprint12
Trivial fixes sprint12
上级
e9fdef62
75974f42
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
55 addition
and
27 deletion
+55
-27
Makefile
Makefile
+1
-1
avocado/core/output.py
avocado/core/output.py
+28
-4
avocado/core/tree.py
avocado/core/tree.py
+3
-7
avocado/job.py
avocado/job.py
+0
-1
avocado/plugins/multiplexer.py
avocado/plugins/multiplexer.py
+9
-5
tests/synctest.py.data/synctest.yaml
tests/synctest.py.data/synctest.yaml
+14
-9
未找到文件。
Makefile
浏览文件 @
89d4978b
...
...
@@ -45,5 +45,5 @@ build-rpm-all: source
clean
:
$(PYTHON)
setup.py clean
$(MAKE)
-f
$(CURDIR)
/debian/rules clean
||
true
rm
-rf
build/ MANIFEST BUILD BUILDROOT SPECS RPMS SRPMS
rm
-rf
build/ MANIFEST BUILD BUILDROOT SPECS RPMS SRPMS
SOURCES
find
.
-name
'*.pyc'
-delete
avocado/core/output.py
浏览文件 @
89d4978b
...
...
@@ -45,17 +45,41 @@ class ProgressStreamHandler(logging.StreamHandler):
self
.
handleError
(
record
)
class
Paginator
(
object
):
"""
Paginator that uses less to display contents on the terminal.
Contains cleanup handling for when user presses 'q' (to quit less).
"""
def
__init__
(
self
):
less_cmd
=
process
.
find_command
(
'less'
)
self
.
pipe
=
os
.
popen
(
'%s -FRSX'
%
less_cmd
,
'w'
)
def
__del__
(
self
):
try
:
self
.
pipe
.
close
()
except
IOError
:
pass
def
write
(
self
,
msg
):
try
:
self
.
pipe
.
write
(
msg
)
except
IOError
:
pass
def
get_paginator
():
"""
Get a p
ipe
. If we can't do that, return stdout.
Get a p
aginator
. If we can't do that, return stdout.
The paginator is 'less'. The paginator is a useful feature inspired in
programs such as git, since it lets you scroll up and down large buffers
of text, increasing the program's usability.
"""
try
:
less_cmd
=
process
.
find_command
(
'less'
)
return
os
.
popen
(
'%s -FRSX'
%
less_cmd
,
'w'
)
return
Paginator
()
except
process
.
CmdNotFoundError
:
return
sys
.
stdout
...
...
@@ -238,7 +262,7 @@ class OutputManager(object):
else
:
self
.
log_partial
(
self
.
THROBBER_MOVES
[
self
.
throbber_pos
],
True
)
if
self
.
throbber_pos
==
(
len
(
self
.
THROBBER_MOVES
)
-
1
):
if
self
.
throbber_pos
==
(
len
(
self
.
THROBBER_MOVES
)
-
1
):
self
.
throbber_pos
=
0
else
:
self
.
throbber_pos
+=
1
...
...
avocado/core/tree.py
浏览文件 @
89d4978b
...
...
@@ -113,7 +113,7 @@ class TreeNode(object):
def
get_environment
(
self
):
def
update_or_extend
(
target
,
source
):
for
k
,
v
in
source
.
items
():
for
k
,
_
in
source
.
items
():
if
target
.
has_key
(
k
)
and
isinstance
(
target
[
k
],
list
):
target
[
k
].
extend
(
source
[
k
])
else
:
...
...
@@ -148,8 +148,8 @@ class TreeNode(object):
return
list
(
self
.
iter_leaves
())
def
get_ascii
(
self
,
show_internal
=
True
,
compact
=
False
,
attributes
=
None
):
(
lines
,
mid
)
=
self
.
_ascii_art
(
show_internal
=
show_internal
,
compact
=
compact
,
attributes
=
attributes
)
(
lines
,
_
)
=
self
.
_ascii_art
(
show_internal
=
show_internal
,
compact
=
compact
,
attributes
=
attributes
)
return
'
\n
'
+
'
\n
'
.
join
(
lines
)
def
_ascii_art
(
self
,
char1
=
'-'
,
show_internal
=
True
,
compact
=
False
,
attributes
=
None
):
...
...
@@ -218,10 +218,6 @@ def create_from_ordered_data(data, tree=None, root=None, name='/root'):
if
isinstance
(
data
,
dict
):
for
key
,
value
in
data
.
items
():
if
isinstance
(
value
,
dict
):
leaf
=
True
for
k
,
v
in
value
.
items
():
if
isinstance
(
v
,
dict
):
leaf
=
False
node
=
TreeNode
(
key
)
tree
.
add_child
(
node
)
create_from_ordered_data
(
value
,
node
,
root
)
...
...
avocado/job.py
浏览文件 @
89d4978b
...
...
@@ -414,7 +414,6 @@ class Job(object):
params_list
=
[]
if
urls
is
not
None
:
for
url
in
urls
:
test_module
=
os
.
path
.
basename
(
url
).
split
(
'.'
)[
0
]
try
:
variants
=
multiplexer
.
create_variants_from_yaml
(
open
(
multiplex_file
))
except
SyntaxError
:
...
...
avocado/plugins/multiplexer.py
浏览文件 @
89d4978b
...
...
@@ -68,15 +68,19 @@ class Multiplexer(plugin.Plugin):
data
=
tree
.
read_ordered_yaml
(
open
(
multiplex_file
))
t
=
tree
.
create_from_ordered_data
(
data
)
pipe
.
write
(
t
.
get_ascii
())
sys
.
exit
(
0
)
sys
.
exit
(
error_codes
.
numeric_status
[
'AVOCADO_ALL_OK'
]
)
variants
=
multiplexer
.
create_variants_from_yaml
(
open
(
multiplex_file
))
pipe
.
write
(
bcolors
.
header_str
(
'Variants generated:'
))
pipe
.
write
(
'
\n
'
)
for
(
index
,
dct
)
in
enumerate
(
variants
):
pipe
.
write
(
'
Variant %s: %s
\n
'
%
(
index
+
1
,
[
str
(
x
)
for
x
in
dct
]))
for
(
index
,
tpl
)
in
enumerate
(
variants
):
pipe
.
write
(
'
Variant %s: %s
\n
'
%
(
index
+
1
,
[
str
(
x
)
for
x
in
tpl
]))
if
args
.
contents
:
for
key
in
sorted
(
dct
.
keys
()):
pipe
.
write
(
' %s = %s
\n
'
%
(
key
,
dct
.
get
(
key
)))
env
=
{}
for
node
in
tpl
:
env
.
update
(
node
.
environment
)
for
k
in
sorted
(
env
.
keys
()):
pipe
.
write
(
' %s: %s
\n
'
%
(
k
,
env
[
k
]))
sys
.
exit
(
error_codes
.
numeric_status
[
'AVOCADO_ALL_OK'
])
tests/synctest.py.data/synctest.yaml
浏览文件 @
89d4978b
sync_tarball
:
synctest.tar.bz2
short
:
sync_loop
:
10
sync_length
:
100
medium
:
sync_loop
:
50
sync_length
:
500
long
:
sync_loop
:
100
sync_length
:
1000
loop
:
short
:
sync_loop
:
10
medium
:
sync_loop
:
50
long
:
sync_loop
:
100
length
:
short
:
sync_length
:
100
medium
:
sync_length
:
500
long
:
sync_length
:
1000
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录