Exemple #1
0
    def start_process(self):
        if self.repl is not None:
            self.repl.child.terminate()

        if not self.cmd:
            if os.name == 'nt':
                self.cmd = 'cmd'
                self.repl = cmd()
            elif pexpect.which('bash'):
                self.cmd = 'bash'
                self.repl = bash()
            elif pexpect.which('sh'):
                self.cmd = 'sh'
                self.repl = bash(command='sh')
            else:
                msg = "The command was not found or was not executable: sh"
                raise Exception(msg)
Exemple #2
0
    def start_process(self):
        if self.repl is not None:
            self.repl.child.terminate()

        if not self.cmd:
            if os.name == 'nt':
                self.cmd = 'cmd'
                self.repl = cmd()
            elif pexpect.which('bash'):
                self.cmd = 'bash'
                self.repl = bash()
            elif pexpect.which('sh'):
                self.cmd = 'sh'
                self.repl = bash(command='sh')
            else:
                msg = "The command was not found or was not executable: sh"
                raise Exception(msg)
Exemple #3
0
    def start_process(self):
        if not self.repl is None:
            self.repl.child.terminate()

        if not self.cmd:
            try:
                pexpect.which('bash')
            except Exception as e:  # pragma: no cover

                if os.name == 'nt':
                    self.cmd = 'cmd'
                else:
                    raise (e)
            else:
                self.cmd = 'bash'

        if self.cmd == 'cmd':
            self.repl = cmd()
        else:
            self.repl = bash()
    def start_process(self):
        if not self.repl is None:
            self.repl.child.terminate()

        if not self.cmd:
            try:
                pexpect.which('bash')
            except Exception as e:  # pragma: no cover

                if os.name == 'nt':
                    self.cmd = 'cmd'
                else:
                    raise(e)
            else:
                self.cmd = 'bash'

        if self.cmd == 'cmd':
            self.repl = cmd()
        else:
            self.repl = bash()