• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- coding: utf-8 -*-
2# Copyright (c) 2023 Huawei Device Co., Ltd.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14import os
15import platform
16import time
17
18# 系统分隔符
19SYS_SEQ = os.sep
20# 系统平台
21SYS_PLATFORM = platform.system()
22
23PATH = os.path.dirname(os.path.realpath(__file__)) + SYS_SEQ
24# 脚本的执行日志
25LOG_FILE = PATH + SYS_SEQ + "native_sa.log"
26# 设备上生成的token info 文件名
27TOKEN_INFO_NAME = 'token_info_'+ str(time.time_ns()) +'_{}.txt'
28# 设备上生成文件存放位置
29TOKEN_INFO_URL = '/data/{}'.format(TOKEN_INFO_NAME)
30# 设备上文件生成命令
31GENERATING_TOKEN_INFO_COMMAND = 'hdc -t {} shell atm dump -t > {}'
32# 下载token info 文件存放路径
33DOWNLOAD_TOKEN_INFO_URL = PATH + TOKEN_INFO_NAME
34# 文件下载命令
35DOWNLOAD_TOKEN_INFO_COMMAND = 'hdc -t {} file recv {} {}'
36# 删除设备上的文件命令
37CLEAR_TOKEN_INFO_FILE = 'hdc -t {} shell rm -rf {}'
38