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

Side by Side Diff: recipe_modules/json/api.py

Issue 1785543004: Split Placeholder into InputPlaceholder and OutputPlaceholder. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Simplify InputPlaceholder.cleanup Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « recipe_engine/util.py ('k') | recipe_modules/raw_io/api.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 )
OLDNEW
« no previous file with comments | « recipe_engine/util.py ('k') | recipe_modules/raw_io/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698