コード例 #1
0
ファイル: __init__.py プロジェクト: altai/focus-selenium-test
    def __execute(self, cmd):
        retcode = commands.getstatusoutput(cmd)
        status, text = retcode
        conf.bash_log(cmd, status, text)

#        print "------------------------------------------------------------"
#        print "cmd: %s" % cmd
#        print "sta: %s" % status
#        print "out: %s" % text
        return retcode
コード例 #2
0
    def get_output(self, code_override=None):
        text_output = "before:\n{before}\nafter:\n{after}".format(
            before = self.before if isinstance(self.before, basestring) else pformat(self.before, indent=4),
            after = self.after if isinstance(self.after, basestring) else pformat(self.after, indent=4))

        if code_override is not None:
            conf.bash_log(pformat(self.args), code_override, text_output)
            return code_override, text_output

        if self.isalive():
            conf.bash_log(pformat(self.args), 'Spawned process running: pid={pid}'.format(pid=self.pid), text_output)
            raise pexpect.ExceptionPexpect('Unable to return exit code. Spawned command is still running:\n' + text_output)

        conf.bash_log(pformat(self.args), self.exitstatus, text_output)
        return self.exitstatus, text_output
コード例 #3
0
    def get_output(self, code_override=None):
        text_output = "before:\n{before}\nafter:\n{after}".format(
            before=self.before if isinstance(
                self.before, basestring) else pformat(self.before, indent=4),
            after=self.after if isinstance(
                self.after, basestring) else pformat(self.after, indent=4))

        if code_override is not None:
            conf.bash_log(pformat(self.args), code_override, text_output)
            return code_override, text_output

        if self.isalive():
            conf.bash_log(
                pformat(self.args),
                'Spawned process running: pid={pid}'.format(pid=self.pid),
                text_output)
            raise pexpect.ExceptionPexpect(
                'Unable to return exit code. Spawned command is still running:\n'
                + text_output)

        conf.bash_log(pformat(self.args), self.exitstatus, text_output)
        return self.exitstatus, text_output
コード例 #4
0
 def __execute(self, cmd):
     text, status = pexpect.run(cmd,withexitstatus=True)
     conf.bash_log(cmd, status, text)
     return status, text
コード例 #5
0
 def __execute(self, cmd):
     retcode = commands.getstatusoutput(cmd)
     status, text = retcode
     conf.bash_log(cmd, status, text)
     return retcode
コード例 #6
0
 def __execute(self, cmd):
     text, status = pexpect.run(cmd, withexitstatus=True)
     conf.bash_log(cmd, status, text)
     return status, text
コード例 #7
0
 def __execute(self, cmd):
     retcode = commands.getstatusoutput(cmd)
     status, text = retcode
     conf.bash_log(cmd, status, text)
     return retcode