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

Unified Diff: recipe_engine/util.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: Fix nits. 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
Index: recipe_engine/util.py
diff --git a/recipe_engine/util.py b/recipe_engine/util.py
index 75cd5f9441f5b9eed881ef37bdf4ccedabcaa6e1..1bc3f4e54cfd6935288c60c188ce1e99d58e7575 100644
--- a/recipe_engine/util.py
+++ b/recipe_engine/util.py
@@ -34,7 +34,7 @@ class ModuleInjectionSite(object):
class Placeholder(object):
- """Base class for json placeholders. Do not use directly."""
+ """Base class for command line argument placeholders. Do not use directly."""
def __init__(self):
self.name_pieces = None
@@ -57,8 +57,6 @@ class Placeholder(object):
presentation (StepPresentation) - for the current step.
test (PlaceholderTestData) - test data for this placeholder.
- Returns value to add to step result.
-
May optionally modify presentation as a side-effect.
"""
pass
@@ -69,6 +67,22 @@ class Placeholder(object):
return "%s.%s" % self.name_pieces
+class InputPlaceholder(Placeholder):
+ """Base class for json/raw_io input placeholders. Do not use directly."""
+ def result(self, presentation, test):
+ """Returned value will be discarded."""
+ pass
+ result.__doc__ = Placeholder.result.__doc__
+
+
+class OutputPlaceholder(Placeholder):
+ """Base class for json/raw_io output placeholders. Do not use directly."""
+ def result(self, presentation, test):
+ """Returned value will be added to the step result."""
+ pass
+ result.__doc__ = Placeholder.result.__doc__
+
+
def static_wraps(func):
wrapped_fn = func
if isinstance(func, staticmethod):

Powered by Google App Engine
This is Rietveld 408576698