| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import subprocess | 5 import subprocess |
| 6 | 6 |
| 7 from pylib.shell import Shell | 7 from devtoolslib.shell import Shell |
| 8 | 8 |
| 9 | 9 |
| 10 class LinuxShell(Shell): | 10 class LinuxShell(Shell): |
| 11 """Wrapper around Mojo shell running on Linux. | 11 """Wrapper around Mojo shell running on Linux. |
| 12 | 12 |
| 13 Args: | 13 Args: |
| 14 executable_path: path to the shell binary | 14 executable_path: path to the shell binary |
| 15 command_prefix: optional list of arguments to prepend to the shell command, | 15 command_prefix: optional list of arguments to prepend to the shell command, |
| 16 allowing e.g. to run the shell under debugger. | 16 allowing e.g. to run the shell under debugger. |
| 17 """ | 17 """ |
| (...skipping 22 matching lines...) Expand all Loading... |
| 40 Returns: | 40 Returns: |
| 41 A tuple of (return_code, output). |return_code| is the exit code returned | 41 A tuple of (return_code, output). |return_code| is the exit code returned |
| 42 by the shell or None if the exit code cannot be retrieved. |output| is the | 42 by the shell or None if the exit code cannot be retrieved. |output| is the |
| 43 stdout mingled with the stderr produced by the shell. | 43 stdout mingled with the stderr produced by the shell. |
| 44 """ | 44 """ |
| 45 command = self.command_prefix + [self.executable_path] + arguments | 45 command = self.command_prefix + [self.executable_path] + arguments |
| 46 p = subprocess.Popen(command, stdout=subprocess.PIPE, | 46 p = subprocess.Popen(command, stdout=subprocess.PIPE, |
| 47 stderr=subprocess.STDOUT) | 47 stderr=subprocess.STDOUT) |
| 48 (output, _) = p.communicate() | 48 (output, _) = p.communicate() |
| 49 return p.returncode, output | 49 return p.returncode, output |
| OLD | NEW |