Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1081)

Unified Diff: mojo/devtools/common/pylib/linux_shell.py

Issue 1128153002: Rename the devtools library: pylib -> devtoolslib. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address offline comments/ devtools_lib -> devtoolslib. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/devtools/common/pylib/http_server.py ('k') | mojo/devtools/common/pylib/shell.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/pylib/linux_shell.py
diff --git a/mojo/devtools/common/pylib/linux_shell.py b/mojo/devtools/common/pylib/linux_shell.py
deleted file mode 100644
index e175828b5d4569a7557108d5369ec951e62d7345..0000000000000000000000000000000000000000
--- a/mojo/devtools/common/pylib/linux_shell.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import subprocess
-
-from pylib.shell import Shell
-
-
-class LinuxShell(Shell):
- """Wrapper around Mojo shell running on Linux.
-
- Args:
- executable_path: path to the shell binary
- command_prefix: optional list of arguments to prepend to the shell command,
- allowing e.g. to run the shell under debugger.
- """
-
- def __init__(self, executable_path, command_prefix=None):
- self.executable_path = executable_path
- self.command_prefix = command_prefix if command_prefix else []
-
- def Run(self, arguments):
- """Runs the shell with given arguments until shell exits, passing the stdout
- mingled with stderr produced by the shell onto the stdout.
-
- Returns:
- Exit code retured by the shell or None if the exit code cannot be
- retrieved.
- """
- command = self.command_prefix + [self.executable_path] + arguments
- return subprocess.call(command, stderr=subprocess.STDOUT)
-
- def RunAndGetOutput(self, arguments):
- """Runs the shell with given arguments until shell exits.
-
- Args:
- arguments: list of arguments for the shell
-
- Returns:
- A tuple of (return_code, output). |return_code| is the exit code returned
- by the shell or None if the exit code cannot be retrieved. |output| is the
- stdout mingled with the stderr produced by the shell.
- """
- command = self.command_prefix + [self.executable_path] + arguments
- p = subprocess.Popen(command, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
- (output, _) = p.communicate()
- return p.returncode, output
« no previous file with comments | « mojo/devtools/common/pylib/http_server.py ('k') | mojo/devtools/common/pylib/shell.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698