中兴机顶盒工具ZTESTB_V1.1.0_T7.01


中兴机顶盒工具 ZTESTB_V1.1.0_T7.01,适用于大多数中兴机顶盒配置、读取LOG、打开ADB
资源截图
代码片段和文件信息
#!/usr/bin/env python

# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os
import sys

version = sys.version_info[:2]
if version != (2 7):
  sys.stderr.write(‘Systrace does not support Python %d.%d. ‘
                   ‘Please use Python 2.7.
‘ % version)
  sys.exit(1)

systrace_dir = os.path.abspath(
    os.path.join(os.path.dirname(__file__) ‘catapult‘ ‘systrace‘))
sys.path.insert(0 systrace_dir)

def RemoveAllStalePycFiles(base_dir):
  “““Scan directories for old .pyc files without a .py file and delete them.“““
  for dirname _ filenames in os.walk(base_dir):
    if ‘.git‘ in dirname:
      continue
    for filename in filenames:
      root ext = os.path.splitext(filename)
      if ext != ‘.pyc‘:
        continue

      pyc_path = os.path.join(dirname filename)
      py_path = os.path.join(dirname root + ‘.py‘)

      try:
        if not os.path.exists(py_path):
          os.remove(pyc_path)
      except OSError:
        # Wrap OS calls in try/except in case another process touched this file.
        pass

    try:
      os.removedirs(dirname)
    except OSError:
      # Wrap OS calls in try/except in case another process touched this dir.
      pass

if __name__ == ‘__main__‘:
  RemoveAllStalePycFiles(os.path.dirname(__file__))
  from systrace import run_systrace
  sys.exit(run_systrace.main())

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)