Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Test Xdevice
提交
e3ece672
T
Test Xdevice
项目概览
OpenHarmony
/
Test Xdevice
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
e3ece672
编写于
9月 08, 2021
作者:
O
openharmony_ci
提交者:
Gitee
9月 08, 2021
浏览文件
操作
浏览文件
下载
差异文件
!28 1. 适配getprop修改为getparam 2. 适配hdc_std的修改
Merge pull request !28 from alex_hold/master
上级
91c9a500
6aa218b6
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
4 addition
and
14 deletion
+4
-14
extension/src/xdevice_extension/_core/environment/device.py
extension/src/xdevice_extension/_core/environment/device.py
+3
-3
extension/src/xdevice_extension/_core/environment/device_monitor.py
...src/xdevice_extension/_core/environment/device_monitor.py
+1
-1
extension/src/xdevice_extension/_core/environment/dmlib.py
extension/src/xdevice_extension/_core/environment/dmlib.py
+0
-10
未找到文件。
extension/src/xdevice_extension/_core/environment/device.py
浏览文件 @
e3ece672
...
...
@@ -168,14 +168,14 @@ class Device(IDevice):
def
get_device_type
(
self
):
model
=
self
.
get_property
(
"ro.build.characteristics"
,
abort_on_exception
=
True
)
self
.
label
=
self
.
model_dict
.
get
(
model
,
None
)
self
.
label
=
self
.
model_dict
.
get
(
model
.
lower
()
,
None
)
def
get_property
(
self
,
prop_name
,
retry
=
RETRY_ATTEMPTS
,
abort_on_exception
=
False
):
"""
Hdc command, ddmlib function.
"""
command
=
"getp
rop
%s"
%
prop_name
command
=
"getp
aram
%s"
%
prop_name
stdout
=
self
.
execute_shell_command
(
command
,
timeout
=
5
*
1000
,
output_flag
=
False
,
retry
=
retry
,
abort_on_exception
=
abort_on_exception
).
strip
()
...
...
@@ -366,7 +366,7 @@ class Device(IDevice):
pass
def
get_recover_result
(
self
,
retry
=
RETRY_ATTEMPTS
):
command
=
"getp
rop ro.product.device
"
command
=
"getp
aram ro.product.model
"
stdout
=
self
.
execute_shell_command
(
command
,
timeout
=
5
*
1000
,
output_flag
=
False
,
retry
=
retry
,
abort_on_exception
=
True
).
strip
()
...
...
extension/src/xdevice_extension/_core/environment/device_monitor.py
浏览文件 @
e3ece672
...
...
@@ -86,7 +86,7 @@ class DeviceStateMonitor(object):
while
int
(
time
.
time
()
*
1000
)
-
start_time
<
wait_time
:
try
:
result
=
self
.
device
.
get_recover_result
(
retry
=
0
)
if
result
==
"
1
"
:
if
result
==
"
ohos
"
:
return
True
except
Exception
as
exception
:
self
.
device
.
log
.
error
(
"wait for boot complete exception: %s"
...
...
extension/src/xdevice_extension/_core/environment/dmlib.py
浏览文件 @
e3ece672
...
...
@@ -753,10 +753,6 @@ class HdcHelper:
sock
=
HdcHelper
.
socket
(
host
=
device
.
host
,
port
=
device
.
port
,
timeout
=
DEFAULT_TIMEOUT
)
HdcHelper
.
handle_shake
(
sock
,
device
.
device_sn
)
local_end
=
os
.
path
.
split
(
local
)[
-
1
]
remote_end
=
os
.
path
.
split
(
remote
)[
-
1
]
if
not
local_end
==
remote_end
:
remote
=
os
.
path
.
join
(
remote
,
local_end
)
request
=
HdcHelper
.
form_hdc_request
(
"file send %s %s"
%
(
local
,
remote
))
HdcHelper
.
write
(
sock
,
request
)
...
...
@@ -772,15 +768,9 @@ class HdcHelper:
device
.
log
.
info
(
"%s execute command: hdc file recv %s to %s"
%
(
convert_serial
(
device
.
device_sn
),
remote
,
local
))
if
not
os
.
path
.
exists
(
local
):
raise
HdcError
(
"Local path doesn't exist."
)
sock
=
HdcHelper
.
socket
(
host
=
device
.
host
,
port
=
device
.
port
,
timeout
=
DEFAULT_TIMEOUT
)
HdcHelper
.
handle_shake
(
sock
,
device
.
device_sn
)
local_end
=
os
.
path
.
split
(
local
)[
-
1
]
remote_end
=
os
.
path
.
split
(
remote
)[
-
1
]
if
not
local_end
==
remote_end
:
remote
=
os
.
path
.
join
(
remote
,
local_end
)
request
=
HdcHelper
.
form_hdc_request
(
"file recv %s %s"
%
(
local
,
remote
))
HdcHelper
.
write
(
sock
,
request
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录