示例#1
0
    beginTime = time.strftime("%Y%m%d_%H%M%S", time.localtime())
    scriptRoot = os.path.split(os.path.realpath(__file__))[0]
    resultPath = scriptRoot

    try:
        resultPath = os.path.join(scriptRoot, beginTime)
        print("resultPath=" + resultPath)
        os.mkdir(resultPath)
    except Exception, e:
        resultPath = scriptRoot
        print(e)

    # print "beginTime=",beginTime," scriptRoot="+scriptRoot," resultRoot=",resultPath

    devices = getDeviceList()
    print("===" * 5 + " device list " + "===" * 5)
    print(os.linesep.join(['->'.join(device) for device in devices]))
    print("===" * 14)

    permissionThread = []

    threads = []
    local_port = 5555
    collectDeviceId = devices[0][0]
    runtime = 2
    setScreenAlwaysOn()

    # 重定向终端输出至文件
    # file=open("123.txt","w")
    # sys.stdout=file
示例#2
0
 def _attachDefaultDevice(self):
     devices = getDeviceList()
     if not devices:
         raise Exception("no device be found")
     else:
         self._deviceId = devices[0][0]