def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): return shell_command_ext(cmd, timeout, boutput, stdout_file, stderr_file)
def launch_app(self, wgt_name): blauched = False if self._wrt: timecnt = 0 cmdline = WRT_STOP_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmdline) cmdline = WRT_START_STR % (self.deviceid, wgt_name) while timecnt < 3: exit_code, ret_out, ret_err = shell_command_ext(cmdline, 30) if exit_code == "0": blauched = True break timecnt += 1 time.sleep(3) elif self._xwalk: cmd = APP_QUERY_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmd) for line in ret: cmd = APP_KILL_STR % (self.deviceid, line.strip('\r\n')) exit_code, ret = shell_command(cmd) cmdline = XWALK_START_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmdline) time.sleep(3) blauched = True else: cmdline = APP_NONBLOCK_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmdline) time.sleep(3) cmd = APP_QUERY_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmd) if ret and len(ret): blauched = True return blauched
def launch_app(self, wgt_name): blauched = False if self._wrt: timecnt = 0 cmdline = WRT_STOP_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmdline) cmdline = WRT_START_STR % (self.deviceid, wgt_name) while timecnt < 3: exit_code, ret_out, ret_err = shell_command_ext(cmdline, 30) if exit_code == "0": blauched = True break timecnt += 1 time.sleep(3) elif self._xwalk: cmd = APP_QUERY_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmd) for line in ret: cmd = APP_KILL_STR % (self.deviceid, line.strip('\r\n')) exit_code, ret = shell_command(cmd) cmdline = XWALK_START_STR % (self.deviceid, TIZEN_USER, self.port, XWALK_MAIN, wgt_name) exit_code, ret = shell_command(cmdline) time.sleep(3) blauched = True else: cmdline = APP_NONBLOCK_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmdline) time.sleep(3) cmd = APP_QUERY_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmd) if ret and len(ret): blauched = True return blauched
def shell_cmd_host(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): cmd = cmd.replace("$deviceid", self.deviceid) return shell_command_ext(cmd, timeout, boutput, stdout_file, stderr_file)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): if cmd.startswith('app_user@'): cmd = cmd[9:] return shell_command_ext(cmd, timeout, boutput, stdout_file, stderr_file)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None, callbk=None): cmdline = "adb -s %s shell '%s; echo returncode=$?'" % ( self.deviceid, cmd) return shell_command_ext(cmdline, timeout, boutput, stdout_file, stderr_file, callbk)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): usr = TIZEN_USER + '_user@' if cmd.startswith(usr): cmd = cmd[9:] return shell_command_ext(cmd, timeout, boutput, stdout_file, stderr_file)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): if cmd.startswith('app_user@'): cmdline = SDB_COMMAND_APP % (self.deviceid, cmd[9:]) else: cmdline = SDB_COMMAND_RTN % (self.deviceid, cmd) return shell_command_ext(cmdline, timeout, boutput, stdout_file, stderr_file)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): if cmd.startswith('app_user@'): cmdline = SSH_COMMAND_APP % (self.deviceid, cmd[9:]) else: cmdline = SSH_COMMAND_RTN % (self.deviceid, cmd) return shell_command_ext(cmdline, timeout, boutput, stdout_file, stderr_file)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): usr = DEEPIN_USER + '_user@' if cmp(DEEPIN_USER, 'app') !=0: cmd = cmd[cmd.index('@') - 5 :] cmd = DEEPIN_USER + cmd if cmd.startswith(usr): cmd = cmd[cmd.index('@') + 1 :] return shell_command_ext(cmd, timeout, boutput, stdout_file, stderr_file)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): #if cmd.startswith('app_user@'): usr = TIZEN_USER + '_user@' if cmd.startswith(usr): cmdline = SDB_COMMAND_APP % (self.deviceid,TIZEN_USER, self.port, cmd[9:]) else: cmdline = SDB_COMMAND_RTN % (self.deviceid, cmd) #print 'debug cmd', cmdline return shell_command_ext(cmdline, timeout, boutput, stdout_file, stderr_file)
def shell_cmd_ext(self, cmd="", timeout=None, boutput=False, stdout_file=None, stderr_file=None): #if cmd.startswith('app_user@'): usr = TIZEN_USER + '_user@' if cmd.find("_user@") > 0: cmd = cmd[cmd.index('@') - 5 :] cmd = TIZEN_USER + cmd if cmd.startswith(usr): cmdline = SSH_COMMAND_APP % (self.deviceid, TIZEN_USER, self.port,TIZEN_USER, cmd[cmd.index('@') + 1 :]) else: cmdline = SSH_COMMAND_RTN % (self.deviceid, cmd) return shell_command_ext(cmdline, timeout, boutput, stdout_file, stderr_file)
def launch_app(self, wgt_name, extension=None): cmd = EXPORT_DEEPIN %(DEEPIN_USER) shell_command(cmd) blauched = False if self._wrt: timecnt = 0 cmdline = WRT_STOP_STR % (wgt_name) exit_code, ret = shell_command(cmdline) cmdline = WRT_START_STR % (wgt_name) while timecnt < 3: exit_code, ret_out, ret_err = shell_command_ext(cmdline, 30) if exit_code == "0": blauched = True break timecnt += 1 time.sleep(3) elif self._xwalk: cmd = APP_QUERY_STR % (wgt_name) exit_code, ret = shell_command(cmd) for line in ret: cmd = APP_KILL_STR % (line.strip('\r\n')) exit_code, ret = shell_command(cmd) execute_file = commands.getoutput("which %s" % wgt_name) real_file = REALPATH(execute_file) parent_dir = DIRNAME(real_file) manifest_file = JOIN(parent_dir, "www/manifest.json") cmdline = "xwalk %s &" % manifest_file if os.environ.has_key("DEEPIN_CODEC_LIB"): cmdline = "xwalk %s --proprietary-codec-lib-path=%s &" % (manifest_file, os.environ["DEEPIN_CODEC_LIB"]) exit_code, ret = shell_command(cmdline) time.sleep(3) blauched = True else: cmdline = APP_NONBLOCK_STR % (wgt_name) exit_code, ret = shell_command(cmdline) time.sleep(3) cmd = APP_QUERY_STR % (wgt_name) exit_code, ret = shell_command(cmd) if ret and len(ret): blauched = True return blauched