| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS 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 """Common python commands used by various build scripts.""" | 5 """Common python commands used by various build scripts.""" |
| 6 | 6 |
| 7 import inspect | 7 import inspect |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import signal | 10 import signal |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 message: The message to be emitted. | 147 message: The message to be emitted. |
| 148 """ | 148 """ |
| 149 print >> sys.stderr, ( | 149 print >> sys.stderr, ( |
| 150 Color(_STDOUT_IS_TTY).Color(Color.YELLOW, '\nWARNING: ' + message)) | 150 Color(_STDOUT_IS_TTY).Color(Color.YELLOW, '\nWARNING: ' + message)) |
| 151 | 151 |
| 152 | 152 |
| 153 # This command is deprecated in favor of operation.Info() | 153 # This command is deprecated in favor of operation.Info() |
| 154 # It is left here for the moment so people are aware what happened. | 154 # It is left here for the moment so people are aware what happened. |
| 155 # The reason is that this is not aware of the terminal output restrictions such | 155 # The reason is that this is not aware of the terminal output restrictions such |
| 156 # as verbose, quiet and subprocess output. You should not be calling this. | 156 # as verbose, quiet and subprocess output. You should not be calling this. |
| 157 # def Info(message): | 157 def Info(message): |
| 158 # """Emits a blue informational message and continues execution. | 158 """Emits a blue informational message and continues execution. |
| 159 # | 159 |
| 160 # Args: | 160 Args: |
| 161 # message: The message to be emitted. | 161 message: The message to be emitted. |
| 162 # """ | 162 """ |
| 163 # print >> sys.stderr, ( | 163 print >> sys.stderr, ( |
| 164 # Color(_STDOUT_IS_TTY).Color(Color.BLUE, '\nINFO: ' + message)) | 164 Color(_STDOUT_IS_TTY).Color(Color.BLUE, '\nINFO: ' + message)) |
| 165 | 165 |
| 166 | 166 |
| 167 def ListFiles(base_dir): | 167 def ListFiles(base_dir): |
| 168 """Recurively list files in a directory. | 168 """Recurively list files in a directory. |
| 169 | 169 |
| 170 Args: | 170 Args: |
| 171 base_dir: directory to start recursively listing in. | 171 base_dir: directory to start recursively listing in. |
| 172 | 172 |
| 173 Returns: | 173 Returns: |
| 174 A list of files relative to the base_dir path or | 174 A list of files relative to the base_dir path or |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 except RunCommandException as e: | 374 except RunCommandException as e: |
| 375 if not error_ok and retry_count == num_retries: | 375 if not error_ok and retry_count == num_retries: |
| 376 raise e | 376 raise e |
| 377 else: | 377 else: |
| 378 Warning(str(e)) | 378 Warning(str(e)) |
| 379 if print_cmd: | 379 if print_cmd: |
| 380 Info('PROGRAM(%s) -> RunCommand: retrying %r in dir %s' % | 380 Info('PROGRAM(%s) -> RunCommand: retrying %r in dir %s' % |
| 381 (GetCallerName(), cmd, cwd)) | 381 (GetCallerName(), cmd, cwd)) |
| 382 | 382 |
| 383 return output | 383 return output |
| OLD | NEW |