Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from slave import recipe_api | |
| 6 | |
| 7 class PythonApi(recipe_api.RecipeApi): | |
| 8 def __call__(self, name, script, args=None, unbuffered=True, **kwargs): | |
| 9 """Return a step to run a python script with arguments.""" | |
| 10 preamble = ['python'] | |
|
agable
2013/06/25 15:55:28
call it 'cmd' or something -- it eventually holds
iannucci
2013/06/25 21:22:09
Done.
| |
| 11 if unbuffered: | |
| 12 preamble.append('-u') | |
| 13 preamble.append(script) | |
| 14 return self.m.step(name, preamble + list(args or []), **kwargs) | |
| 15 | |
| 16 def inline(self, name, program, **kwargs): | |
|
agable
2013/06/25 15:55:28
docstring
iannucci
2013/06/25 21:22:09
Good catch. Done.
| |
| 17 return self(name, recipe_api.InputDataPlaceholder(program, '.py'), **kwargs) | |
| OLD | NEW |