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

Unified Diff: recipe_modules/raw_io/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_modules/json/api.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/raw_io/api.py
diff --git a/recipe_modules/raw_io/api.py b/recipe_modules/raw_io/api.py
index 10da51a8604cde5de76b972ce0119221fd59911b..ca64afb24a14393be4cde578529e7efc0a6e9f47 100644
--- a/recipe_modules/raw_io/api.py
+++ b/recipe_modules/raw_io/api.py
@@ -10,7 +10,7 @@ import shutil
import tempfile
-class InputDataPlaceholder(recipe_util.Placeholder):
+class InputDataPlaceholder(recipe_util.InputPlaceholder):
def __init__(self, data, suffix):
assert isinstance(data, basestring)
self.data = data
@@ -34,15 +34,15 @@ class InputDataPlaceholder(recipe_util.Placeholder):
os.close(input_fd)
return [self._backing_file]
- def result(self, presentation, test):
+ def cleanup(self, test_enabled):
assert self._backing_file
exists = os.path.exists(self._backing_file)
- if not test.enabled and exists: # pragma: no cover
+ if not test_enabled and exists: # pragma: no cover
os.unlink(self._backing_file)
self._backing_file = None
-class OutputDataPlaceholder(recipe_util.Placeholder):
+class OutputDataPlaceholder(recipe_util.OutputPlaceholder):
def __init__(self, suffix, leak_to):
self.suffix = suffix
self.leak_to = leak_to
@@ -80,7 +80,7 @@ class OutputDataPlaceholder(recipe_util.Placeholder):
self._backing_file = None
-class OutputDataDirPlaceholder(recipe_util.Placeholder):
+class OutputDataDirPlaceholder(recipe_util.OutputPlaceholder):
def __init__(self, suffix, leak_to):
self.suffix = suffix
self.leak_to = leak_to
« no previous file with comments | « recipe_modules/json/api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698