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

Unified Diff: scripts/slave/recipe_modules/python/api.py

Issue 17635005: Make blink_trybot recipe work on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fix presubmit + move polyfill (retry) Created 7 years, 6 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: scripts/slave/recipe_modules/python/api.py
diff --git a/scripts/slave/recipe_modules/python/api.py b/scripts/slave/recipe_modules/python/api.py
new file mode 100644
index 0000000000000000000000000000000000000000..6a92dc88c046fe47b1d7642aac1cac8fde261752
--- /dev/null
+++ b/scripts/slave/recipe_modules/python/api.py
@@ -0,0 +1,21 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from slave import recipe_api
+
+class PythonApi(recipe_api.RecipeApi):
+ def __call__(self, name, script, args=None, unbuffered=True, **kwargs):
+ """Return a step to run a python script with arguments."""
+ cmd = ['python']
+ if unbuffered:
+ cmd.append('-u')
+ cmd.append(script)
+ return self.m.step(name, cmd + list(args or []), **kwargs)
+
+ def inline(self, name, program, **kwargs):
+ """Run an inline python program as a step.
+
+ Program is output to a temp file and run when this step executes.
+ """
+ return self(name, recipe_api.InputDataPlaceholder(program, '.py'), **kwargs)

Powered by Google App Engine
This is Rietveld 408576698