| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 functools | 5 import functools |
| 6 import collections | 6 import collections |
| 7 import contextlib | 7 import contextlib |
| 8 import json | 8 import json |
| 9 | 9 |
| 10 from recipe_engine import recipe_api | 10 from recipe_engine import recipe_api |
| 11 from recipe_engine import util as recipe_util | 11 from recipe_engine import util as recipe_util |
| 12 from recipe_engine import config_types | 12 from recipe_engine import config_types |
| 13 | 13 |
| 14 | 14 |
| 15 class JsonOutputPlaceholder(recipe_util.Placeholder): | 15 class JsonOutputPlaceholder(recipe_util.OutputPlaceholder): |
| 16 """JsonOutputPlaceholder is meant to be a placeholder object which, when added | 16 """JsonOutputPlaceholder is meant to be a placeholder object which, when added |
| 17 to a step's cmd list, will be replaced by annotated_run with the path to a | 17 to a step's cmd list, will be replaced by annotated_run with the path to a |
| 18 temporary file (e.g. /tmp/tmp4lp1qM) which will exist only for the duration of | 18 temporary file (e.g. /tmp/tmp4lp1qM) which will exist only for the duration of |
| 19 the step. If the script requires a flag (e.g. --output-json /path/to/file), | 19 the step. If the script requires a flag (e.g. --output-json /path/to/file), |
| 20 you must supply that flag yourself in the cmd list. | 20 you must supply that flag yourself in the cmd list. |
| 21 | 21 |
| 22 This placeholder can be optionally added when you use the Steps.step() | 22 This placeholder can be optionally added when you use the Steps.step() |
| 23 method in this module. | 23 method in this module. |
| 24 | 24 |
| 25 FIXME | 25 FIXME |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 name, | 118 name, |
| 119 """ | 119 """ |
| 120 import shutil | 120 import shutil |
| 121 import sys | 121 import sys |
| 122 shutil.copy(sys.argv[1], sys.argv[2]) | 122 shutil.copy(sys.argv[1], sys.argv[2]) |
| 123 """, | 123 """, |
| 124 args=[path, self.output(add_json_log=add_json_log)], | 124 args=[path, self.output(add_json_log=add_json_log)], |
| 125 add_python_log=False, | 125 add_python_log=False, |
| 126 **kwargs | 126 **kwargs |
| 127 ) | 127 ) |
| OLD | NEW |