Chromium Code Reviews| Index: build/android/pylib/android_commands.py |
| diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py |
| index 65aab3c3333d6d3e43d1e793f5d15c9dec0f708e..af39437724992186e990da3cb5f0311a9f4193cb 100644 |
| --- a/build/android/pylib/android_commands.py |
| +++ b/build/android/pylib/android_commands.py |
| @@ -466,6 +466,17 @@ class AndroidCommands(object): |
| logging.info('\n>>> '.join(result)) |
| return result |
| + def GetShellCommandStatusAndOutput(self, command, timeout_time=20, |
| + log_result=False): |
| + """See RunShellCommand() above. |
| + |
| + Returns: |
| + The tuple (exit code, list of output lines). |
| + """ |
| + lines = self.RunShellCommand( |
| + command + '; echo $?', timeout_time, log_result) |
| + return (int(lines[-1]), lines[:len(lines) - 2]) |
|
bulach
2012/11/15 02:08:19
nit: lines[:-1], cute isn't it? :)
Philippe
2012/11/15 09:56:20
Indeed :)
|
| + |
| def KillAll(self, process): |
| """Android version of killall, connected via adb. |