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
...
@@ -45,5 +45,5 @@ build-rpm-all: source
clean
:
clean
:
$(PYTHON)
setup.py clean
$(PYTHON)
setup.py clean
$(MAKE)
-f
$(CURDIR)
/debian/rules clean
||
true
$(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
find
.
-name
'*.pyc'
-delete
avocado/core/output.py
浏览文件 @
89d4978b
...
@@ -45,17 +45,41 @@ class ProgressStreamHandler(logging.StreamHandler):
...
@@ -45,17 +45,41 @@ class ProgressStreamHandler(logging.StreamHandler):
self
.
handleError
(
record
)
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
():
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
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
programs such as git, since it lets you scroll up and down large buffers
of text, increasing the program's usability.
of text, increasing the program's usability.
"""
"""
try
:
try
:
less_cmd
=
process
.
find_command
(
'less'
)
return
Paginator
()
return
os
.
popen
(
'%s -FRSX'
%
less_cmd
,
'w'
)
except
process
.
CmdNotFoundError
:
except
process
.
CmdNotFoundError
:
return
sys
.
stdout
return
sys
.
stdout
...
@@ -238,7 +262,7 @@ class OutputManager(object):
...
@@ -238,7 +262,7 @@ class OutputManager(object):
else
:
else
:
self
.
log_partial
(
self
.
THROBBER_MOVES
[
self
.
throbber_pos
],
True
)
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
self
.
throbber_pos
=
0
else
:
else
:
self
.
throbber_pos
+=
1
self
.
throbber_pos
+=
1
...
...
avocado/core/tree.py
浏览文件 @
89d4978b
...
@@ -113,7 +113,7 @@ class TreeNode(object):
...
@@ -113,7 +113,7 @@ class TreeNode(object):
def
get_environment
(
self
):
def
get_environment
(
self
):
def
update_or_extend
(
target
,
source
):
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
):
if
target
.
has_key
(
k
)
and
isinstance
(
target
[
k
],
list
):
target
[
k
].
extend
(
source
[
k
])
target
[
k
].
extend
(
source
[
k
])
else
:
else
:
...
@@ -148,7 +148,7 @@ class TreeNode(object):
...
@@ -148,7 +148,7 @@ class TreeNode(object):
return
list
(
self
.
iter_leaves
())
return
list
(
self
.
iter_leaves
())
def
get_ascii
(
self
,
show_internal
=
True
,
compact
=
False
,
attributes
=
None
):
def
get_ascii
(
self
,
show_internal
=
True
,
compact
=
False
,
attributes
=
None
):
(
lines
,
mid
)
=
self
.
_ascii_art
(
show_internal
=
show_internal
,
(
lines
,
_
)
=
self
.
_ascii_art
(
show_internal
=
show_internal
,
compact
=
compact
,
attributes
=
attributes
)
compact
=
compact
,
attributes
=
attributes
)
return
'
\n
'
+
'
\n
'
.
join
(
lines
)
return
'
\n
'
+
'
\n
'
.
join
(
lines
)
...
@@ -218,10 +218,6 @@ def create_from_ordered_data(data, tree=None, root=None, name='/root'):
...
@@ -218,10 +218,6 @@ def create_from_ordered_data(data, tree=None, root=None, name='/root'):
if
isinstance
(
data
,
dict
):
if
isinstance
(
data
,
dict
):
for
key
,
value
in
data
.
items
():
for
key
,
value
in
data
.
items
():
if
isinstance
(
value
,
dict
):
if
isinstance
(
value
,
dict
):
leaf
=
True
for
k
,
v
in
value
.
items
():
if
isinstance
(
v
,
dict
):
leaf
=
False
node
=
TreeNode
(
key
)
node
=
TreeNode
(
key
)
tree
.
add_child
(
node
)
tree
.
add_child
(
node
)
create_from_ordered_data
(
value
,
node
,
root
)
create_from_ordered_data
(
value
,
node
,
root
)
...
...
avocado/job.py
浏览文件 @
89d4978b
...
@@ -414,7 +414,6 @@ class Job(object):
...
@@ -414,7 +414,6 @@ class Job(object):
params_list
=
[]
params_list
=
[]
if
urls
is
not
None
:
if
urls
is
not
None
:
for
url
in
urls
:
for
url
in
urls
:
test_module
=
os
.
path
.
basename
(
url
).
split
(
'.'
)[
0
]
try
:
try
:
variants
=
multiplexer
.
create_variants_from_yaml
(
open
(
multiplex_file
))
variants
=
multiplexer
.
create_variants_from_yaml
(
open
(
multiplex_file
))
except
SyntaxError
:
except
SyntaxError
:
...
...
avocado/plugins/multiplexer.py
浏览文件 @
89d4978b
...
@@ -68,15 +68,19 @@ class Multiplexer(plugin.Plugin):
...
@@ -68,15 +68,19 @@ class Multiplexer(plugin.Plugin):
data
=
tree
.
read_ordered_yaml
(
open
(
multiplex_file
))
data
=
tree
.
read_ordered_yaml
(
open
(
multiplex_file
))
t
=
tree
.
create_from_ordered_data
(
data
)
t
=
tree
.
create_from_ordered_data
(
data
)
pipe
.
write
(
t
.
get_ascii
())
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
))
variants
=
multiplexer
.
create_variants_from_yaml
(
open
(
multiplex_file
))
pipe
.
write
(
bcolors
.
header_str
(
'Variants generated:'
))
pipe
.
write
(
bcolors
.
header_str
(
'Variants generated:'
))
pipe
.
write
(
'
\n
'
)
pipe
.
write
(
'
\n
'
)
for
(
index
,
dct
)
in
enumerate
(
variants
):
for
(
index
,
tpl
)
in
enumerate
(
variants
):
pipe
.
write
(
'
Variant %s: %s
\n
'
%
(
index
+
1
,
[
str
(
x
)
for
x
in
dct
]))
pipe
.
write
(
'
Variant %s: %s
\n
'
%
(
index
+
1
,
[
str
(
x
)
for
x
in
tpl
]))
if
args
.
contents
:
if
args
.
contents
:
for
key
in
sorted
(
dct
.
keys
()):
env
=
{}
pipe
.
write
(
' %s = %s
\n
'
%
(
key
,
dct
.
get
(
key
)))
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'
])
sys
.
exit
(
error_codes
.
numeric_status
[
'AVOCADO_ALL_OK'
])
tests/synctest.py.data/synctest.yaml
浏览文件 @
89d4978b
sync_tarball
:
synctest.tar.bz2
sync_tarball
:
synctest.tar.bz2
short
:
loop
:
short
:
sync_loop
:
10
sync_loop
:
10
sync_length
:
100
medium
:
medium
:
sync_loop
:
50
sync_loop
:
50
sync_length
:
500
long
:
long
:
sync_loop
:
100
sync_loop
:
100
length
:
short
:
sync_length
:
100
medium
:
sync_length
:
500
long
:
sync_length
:
1000
sync_length
:
1000
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录