Beispiel #1
0
                                          args=(test[0],test[1],test[2],test[3],testcount,seed,ch_state)))
            [tr.start() for tr in thread_list]
            [tr.join() for tr in thread_list]
            i+=1

            if i<int(self.ui.cb_count.currentText()) and self.ui.chb_latest.checkState()==2:
                if self.check_new_tcbuild(test[2]) != None:
                    build_number = self.check_new_tcbuild(test[2])
                    run_test_list=[]
                    print "\n New build number was found and applied!"
                    self.install_main(build_number)

    def run_all_test(self):
        window.setHidden(True)
        self.install_main()
        self.start_test()
        window.setHidden(False)
        print("All test were finished!")
        self.ui.statusbar.showMessage('All test were finished!')


if __name__=='__main__':
    #thread.start_new(get_device_id, ())
    get_device_id()
    app = QtGui.QApplication(sys.argv)
    app.setWindowIcon(QtGui.QIcon("main.png"))
    myClipBoard = QtGui.QApplication.clipboard()
    window = Main()
    window.show()
    sys.exit(app.exec_())
    time.sleep(4)
    [thread.start_new_thread(del_package,(device_id, package.rstrip()))for package in apk_name_list[1::3]]
    time.sleep(4)
    [thread.start_new_thread(del_package,(device_id, package.rstrip()))for package in apk_name_list[2::3]]
    time.sleep(4)
    print('Deleted from '+device_id)

def adb_install(dir_name,device_id,application_files=None):
    global apk
    time.sleep(30)
    thread_list = []
    apk.clear()
    print('Wait for apk install ..')
    if application_files == None:
        path = glob.glob(dir_name+'\\*.apk')
        if path == []:
            path = glob.glob(dir_name+'\\*\\*.apk')
    else:
        path = [dir_name+os.sep+app for app in application_files]
    for p in path:
        apk[os.path.basename(p)] = {'path':p.replace('/','\\')}
    for a in apk.keys():
        thread_list.append(Thread(target=install, args=(device_id,a)))
    [tr.start() for tr in thread_list]
    [tr.join() for tr in thread_list[::2]]
    [tr.join() for tr in thread_list[1::2]]
    print('Installed for '+device_id)

if __name__ == '__main__':
    get_device_id()# from get_device_id.py