Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
58340038
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,发现更多精彩内容 >>
提交
58340038
编写于
2月 16, 2015
作者:
R
Rudá Moura
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #423 from ldoktor/pep8
PEP8 fixes: W503
上级
1d64964a
b00a3534
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
16 addition
and
16 deletion
+16
-16
avocado/core/tree.py
avocado/core/tree.py
+4
-4
avocado/linux/software_manager.py
avocado/linux/software_manager.py
+2
-2
avocado/plugins/remote.py
avocado/plugins/remote.py
+2
-2
avocado/plugins/vm.py
avocado/plugins/vm.py
+2
-2
avocado/utils/astring.py
avocado/utils/astring.py
+2
-2
avocado/utils/debug.py
avocado/utils/debug.py
+2
-2
selftests/all/functional/avocado/multiplex_tests.py
selftests/all/functional/avocado/multiplex_tests.py
+2
-2
未找到文件。
avocado/core/tree.py
浏览文件 @
58340038
...
@@ -214,8 +214,8 @@ class TreeNode(object):
...
@@ -214,8 +214,8 @@ class TreeNode(object):
if
self
.
parent
else
{})
if
self
.
parent
else
{})
for
key
,
value
in
self
.
value
.
iteritems
():
for
key
,
value
in
self
.
value
.
iteritems
():
if
isinstance
(
value
,
list
):
if
isinstance
(
value
,
list
):
if
(
key
in
self
.
_environment
if
(
key
in
self
.
_environment
and
and
isinstance
(
self
.
_environment
[
key
],
list
)):
isinstance
(
self
.
_environment
[
key
],
list
)):
self
.
_environment
[
key
]
=
self
.
_environment
[
key
]
+
value
self
.
_environment
[
key
]
=
self
.
_environment
[
key
]
+
value
else
:
else
:
self
.
_environment
[
key
]
=
value
self
.
_environment
[
key
]
=
value
...
@@ -308,8 +308,8 @@ class TreeNode(object):
...
@@ -308,8 +308,8 @@ class TreeNode(object):
if
not
compact
:
if
not
compact
:
result
.
pop
()
result
.
pop
()
(
low
,
high
,
end
)
=
(
mids
[
0
],
mids
[
-
1
],
len
(
result
))
(
low
,
high
,
end
)
=
(
mids
[
0
],
mids
[
-
1
],
len
(
result
))
prefixes
=
([
pad
]
*
(
low
+
1
)
+
[
_pad
+
'|'
]
*
(
high
-
low
-
1
)
prefixes
=
([
pad
]
*
(
low
+
1
)
+
[
_pad
+
'|'
]
*
(
high
-
low
-
1
)
+
+
[
pad
]
*
(
end
-
high
))
[
pad
]
*
(
end
-
high
))
mid
=
(
low
+
high
)
/
2
mid
=
(
low
+
high
)
/
2
prefixes
[
mid
]
=
char1
+
'-'
*
(
length
-
2
)
+
prefixes
[
mid
][
-
1
]
prefixes
[
mid
]
=
char1
+
'-'
*
(
length
-
2
)
+
prefixes
[
mid
][
-
1
]
result
=
[
p
+
l
for
(
p
,
l
)
in
zip
(
prefixes
,
result
)]
result
=
[
p
+
l
for
(
p
,
l
)
in
zip
(
prefixes
,
result
)]
...
...
avocado/linux/software_manager.py
浏览文件 @
58340038
...
@@ -298,8 +298,8 @@ class DpkgBackend(BaseBackend):
...
@@ -298,8 +298,8 @@ class DpkgBackend(BaseBackend):
n_cmd
=
(
self
.
lowlevel_base_cmd
+
' -f '
+
name
+
n_cmd
=
(
self
.
lowlevel_base_cmd
+
' -f '
+
name
+
' Package 2>/dev/null'
)
' Package 2>/dev/null'
)
name
=
process
.
system_output
(
n_cmd
)
name
=
process
.
system_output
(
n_cmd
)
i_cmd
=
(
self
.
lowlevel_base_cmd
+
"--show -f='${Status}' "
i_cmd
=
(
self
.
lowlevel_base_cmd
+
"--show -f='${Status}' "
+
+
name
+
' 2>/dev/null'
)
name
+
' 2>/dev/null'
)
# Checking if package is installed
# Checking if package is installed
package_status
=
process
.
system_output
(
i_cmd
,
ignore_status
=
True
)
package_status
=
process
.
system_output
(
i_cmd
,
ignore_status
=
True
)
dpkg_not_installed
=
(
package_status
!=
self
.
INSTALLED_OUTPUT
)
dpkg_not_installed
=
(
package_status
!=
self
.
INSTALLED_OUTPUT
)
...
...
avocado/plugins/remote.py
浏览文件 @
58340038
...
@@ -213,8 +213,8 @@ class RunRemote(plugin.Plugin):
...
@@ -213,8 +213,8 @@ class RunRemote(plugin.Plugin):
:return: True when enable_arg enabled and all required args are set
:return: True when enable_arg enabled and all required args are set
:raise sys.exit: When missing required argument.
:raise sys.exit: When missing required argument.
"""
"""
if
(
not
hasattr
(
app_args
,
enable_arg
)
if
(
not
hasattr
(
app_args
,
enable_arg
)
or
or
not
getattr
(
app_args
,
enable_arg
)):
not
getattr
(
app_args
,
enable_arg
)):
return
False
return
False
missing
=
[]
missing
=
[]
for
arg
in
required_args
:
for
arg
in
required_args
:
...
...
avocado/plugins/vm.py
浏览文件 @
58340038
...
@@ -136,8 +136,8 @@ class RunVM(plugin.Plugin):
...
@@ -136,8 +136,8 @@ class RunVM(plugin.Plugin):
:return: True when enable_arg enabled and all required args are set
:return: True when enable_arg enabled and all required args are set
:raise sys.exit: When missing required argument.
:raise sys.exit: When missing required argument.
"""
"""
if
(
not
hasattr
(
app_args
,
enable_arg
)
if
(
not
hasattr
(
app_args
,
enable_arg
)
or
or
not
getattr
(
app_args
,
enable_arg
)):
not
getattr
(
app_args
,
enable_arg
)):
return
False
return
False
missing
=
[]
missing
=
[]
for
arg
in
required_args
:
for
arg
in
required_args
:
...
...
avocado/utils/astring.py
浏览文件 @
58340038
...
@@ -93,8 +93,8 @@ def strip_console_codes(output, custom_codes=None):
...
@@ -93,8 +93,8 @@ def strip_console_codes(output, custom_codes=None):
while
index
<
len
(
output
):
while
index
<
len
(
output
):
tmp_index
=
0
tmp_index
=
0
tmp_word
=
""
tmp_word
=
""
while
(
len
(
re
.
findall
(
"
\x1b
"
,
tmp_word
))
<
2
while
(
len
(
re
.
findall
(
"
\x1b
"
,
tmp_word
))
<
2
and
and
index
+
tmp_index
<
len
(
output
)):
index
+
tmp_index
<
len
(
output
)):
tmp_word
+=
output
[
index
+
tmp_index
]
tmp_word
+=
output
[
index
+
tmp_index
]
tmp_index
+=
1
tmp_index
+=
1
...
...
avocado/utils/debug.py
浏览文件 @
58340038
...
@@ -38,8 +38,8 @@ def measure_duration(func):
...
@@ -38,8 +38,8 @@ def measure_duration(func):
return
func
(
*
args
,
**
kwargs
)
return
func
(
*
args
,
**
kwargs
)
finally
:
finally
:
duration
=
time
.
time
()
-
start
duration
=
time
.
time
()
-
start
__MEASURE_DURATION
[
func
]
=
(
__MEASURE_DURATION
.
get
(
func
,
0
)
__MEASURE_DURATION
[
func
]
=
(
__MEASURE_DURATION
.
get
(
func
,
0
)
+
+
duration
)
duration
)
LOGGER
.
debug
(
"PERF: %s: (%ss, %ss)"
,
func
,
duration
,
LOGGER
.
debug
(
"PERF: %s: (%ss, %ss)"
,
func
,
duration
,
__MEASURE_DURATION
[
func
])
__MEASURE_DURATION
[
func
])
return
wrapper
return
wrapper
selftests/all/functional/avocado/multiplex_tests.py
浏览文件 @
58340038
...
@@ -111,8 +111,8 @@ class MultiplexTests(unittest.TestCase):
...
@@ -111,8 +111,8 @@ class MultiplexTests(unittest.TestCase):
expected_rc
=
0
expected_rc
=
0
output
=
self
.
run_and_check
(
cmd_line
,
expected_rc
)
output
=
self
.
run_and_check
(
cmd_line
,
expected_rc
)
for
msg
in
(
'A'
,
'ASDFASDF'
,
'This is very long
\n
multiline
\n
text.'
):
for
msg
in
(
'A'
,
'ASDFASDF'
,
'This is very long
\n
multiline
\n
text.'
):
msg
=
(
'[stdout] Custom variable: '
msg
=
(
'[stdout] Custom variable: '
+
+
'
\n
[stdout] '
.
join
(
msg
.
splitlines
()))
'
\n
[stdout] '
.
join
(
msg
.
splitlines
()))
self
.
assertIn
(
msg
,
output
,
"Multiplexed variable should produce:"
self
.
assertIn
(
msg
,
output
,
"Multiplexed variable should produce:"
"
\n
%s
\n
which is not present in the output:
\n
%s"
"
\n
%s
\n
which is not present in the output:
\n
%s"
%
(
"
\n
"
.
join
(
msg
.
splitlines
()),
%
(
"
\n
"
.
join
(
msg
.
splitlines
()),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录