Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Test Xdevice
提交
150170d2
T
Test Xdevice
项目概览
OpenHarmony
/
Test Xdevice
9 个月 前同步成功
通知
6
Star
23
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Test Xdevice
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
150170d2
编写于
9月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!171 合并修改到3.2beta3
Merge pull request !171 from liguangjie/cherry-pick-1663725328
上级
4f97c9ae
8f72623d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
15 deletion
+15
-15
plugins/ohos/src/ohos/environment/dmlib.py
plugins/ohos/src/ohos/environment/dmlib.py
+4
-4
plugins/ohos/src/ohos/managers/manager_device.py
plugins/ohos/src/ohos/managers/manager_device.py
+1
-1
src/xdevice/_core/command/console.py
src/xdevice/_core/command/console.py
+1
-1
src/xdevice/_core/environment/device_monitor.py
src/xdevice/_core/environment/device_monitor.py
+4
-4
src/xdevice/_core/logger.py
src/xdevice/_core/logger.py
+2
-2
src/xdevice/_core/utils.py
src/xdevice/_core/utils.py
+3
-3
未找到文件。
plugins/ohos/src/ohos/environment/dmlib.py
浏览文件 @
150170d2
...
...
@@ -382,7 +382,7 @@ class SyncService:
Return true if the connection opened, false if hdc refuse the
connection. This can happen device is invalid.
"""
LOG
.
debug
(
"Open sync, timeout=%s"
%
int
(
timeout
/
1000
))
LOG
.
debug
(
"Open sync, timeout=%s"
%
int
(
timeout
/
1000
))
self
.
sock
=
HdcHelper
.
socket
(
host
=
self
.
host
,
port
=
self
.
port
,
timeout
=
timeout
)
HdcHelper
.
set_device
(
self
.
device
,
self
.
sock
)
...
...
@@ -813,7 +813,7 @@ class HdcHelper:
with
HdcHelper
.
socket
(
host
=
device
.
host
,
port
=
device
.
port
,
timeout
=
timeout
)
as
sock
:
output_flag
=
kwargs
.
get
(
"output_flag"
,
True
)
timeout_msg
=
" with timeout %ss"
%
str
(
timeout
/
1000
)
timeout_msg
=
" with timeout %ss"
%
str
(
timeout
/
1000
)
message
=
"%s execute command: hdc shell %s%s"
%
\
(
convert_serial
(
device
.
device_sn
),
command
,
timeout_msg
)
...
...
@@ -845,7 +845,7 @@ class HdcHelper:
return
resp
except
socket
.
timeout
as
_
:
device
.
log
.
error
(
"%s shell %s timeout[%sS]"
%
(
convert_serial
(
device
.
device_sn
),
command
,
str
(
timeout
/
1000
)))
convert_serial
(
device
.
device_sn
),
command
,
str
(
timeout
/
1000
)))
raise
ShellCommandUnresponsiveException
()
finally
:
if
receiver
:
...
...
@@ -1005,7 +1005,7 @@ class HdcHelper:
if
timeout
is
not
None
:
sock
.
setblocking
(
False
)
sock
.
settimeout
(
timeout
/
1000
)
sock
.
settimeout
(
timeout
/
1000
)
return
sock
...
...
plugins/ohos/src/ohos/managers/manager_device.py
浏览文件 @
150170d2
...
...
@@ -196,7 +196,7 @@ class ManagerDevice(IDeviceManager):
else
:
device_dict
=
dict
(
zip
(
self
.
global_device_filter
,
list
(
range
(
1
,
len
(
self
.
global_device_filter
)
+
1
))))
list
(
range
(
1
,
len
(
self
.
global_device_filter
)
+
1
))))
for
index
in
range
(
len
(
self
.
devices_list
)):
if
self
.
devices_list
[
index
].
device_sn
not
in
\
self
.
global_device_filter
:
...
...
src/xdevice/_core/command/console.py
浏览文件 @
150170d2
...
...
@@ -456,7 +456,7 @@ class Console(object):
split_list
=
list
(
history_command
.
split
())
if
"--repeat"
in
split_list
:
pos
=
split_list
.
index
(
"--repeat"
)
split_list
=
split_list
[:
pos
]
+
split_list
[
pos
+
2
:]
split_list
=
split_list
[:
pos
]
+
split_list
[
pos
+
2
:]
history_command
=
" "
.
join
(
split_list
)
argument
=
self
.
argument_parser
(
history_command
.
split
())
...
...
src/xdevice/_core/environment/device_monitor.py
浏览文件 @
150170d2
...
...
@@ -80,10 +80,10 @@ class DeviceStateMonitor(object):
def
wait_for_boot_complete
(
self
,
wait_time
):
counter
=
1
start_time
=
int
(
time
.
time
()
*
1000
)
start_time
=
int
(
time
.
time
()
*
1000
)
self
.
device
.
log
.
debug
(
"wait for boot complete, and wait time: %s ms"
%
wait_time
)
while
int
(
time
.
time
()
*
1000
)
-
start_time
<
wait_time
:
while
int
(
time
.
time
()
*
1000
)
-
start_time
<
wait_time
:
try
:
result
=
self
.
device
.
get_recover_result
(
retry
=
0
)
if
self
.
device
.
check_recover_result
(
result
):
...
...
@@ -99,10 +99,10 @@ class DeviceStateMonitor(object):
def
wait_for_device_available
(
self
,
wait_time
=
None
):
if
not
wait_time
:
wait_time
=
self
.
default_available_timeout
start_time
=
int
(
time
.
time
()
*
1000
)
start_time
=
int
(
time
.
time
()
*
1000
)
if
not
self
.
wait_for_device_online
(
wait_time
):
return
False
elapsed_time
=
int
(
time
.
time
()
*
1000
)
-
start_time
elapsed_time
=
int
(
time
.
time
()
*
1000
)
-
start_time
if
not
self
.
wait_for_boot_complete
(
wait_time
-
elapsed_time
):
return
False
return
True
...
...
src/xdevice/_core/logger.py
浏览文件 @
150170d2
...
...
@@ -401,8 +401,8 @@ class EncryptFileHandler(RotatingFileHandler):
stream
=
getattr
(
self
,
"stream"
,
self
.
_open
())
stream
.
write
(
msg
)
self
.
flush
()
except
RecursionError
as
_
:
# pylint:disable=undefined-variable
raise
except
RecursionError
as
error
:
# pylint:disable=undefined-variable
raise
error
def
_encrypt_valid
(
self
):
from
_core.report.encrypt
import
check_pub_key_exist
...
...
src/xdevice/_core/utils.py
浏览文件 @
150170d2
...
...
@@ -491,7 +491,7 @@ def convert_ip(origin_ip):
addr
=
origin_ip
.
strip
().
split
(
"."
)
if
len
(
addr
)
==
4
:
return
"{}.{}.{}.{}"
.
format
(
addr
[
0
],
'*'
*
len
(
addr
[
1
]),
'*'
*
len
(
addr
[
2
]),
addr
[
-
1
])
addr
[
0
],
'*'
*
len
(
addr
[
1
]),
'*'
*
len
(
addr
[
2
]),
addr
[
-
1
])
else
:
return
origin_ip
...
...
@@ -511,9 +511,9 @@ def convert_serial(serial):
return
"remote_{}_{}"
.
format
(
convert_ip
(
serial
.
split
(
"_"
)[
1
]),
convert_port
(
serial
.
split
(
"_"
)[
-
1
]))
else
:
length
=
len
(
serial
)
//
3
length
=
len
(
serial
)
//
3
return
"{}{}{}"
.
format
(
serial
[
0
:
length
],
"*"
*
(
len
(
serial
)
-
length
*
2
),
serial
[
-
length
:])
serial
[
0
:
length
],
"*"
*
(
len
(
serial
)
-
length
*
2
),
serial
[
-
length
:])
def
get_shell_handler
(
request
,
parser_type
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录