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

Side by Side Diff: shell/subcmds/workon_cmd.py

Issue 6626039: Revert "Plumb in crprocess instead of RunCommand to allow quiet operation." (Closed) Base URL: http://git.chromium.org/git/chromite.git@master
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « shell/subcmds/shell_cmd.py ('k') | shell/utils.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 (c) 2011 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium OS 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 """Implementation of the 'workon' chromite command.""" 5 """Implementation of the 'workon' chromite command."""
6 6
7 7
8 import chromite.lib.cros_build_lib as cros_lib 8 import chromite.lib.cros_build_lib as cros_lib
9 from chromite.shell import subcmd 9 from chromite.shell import subcmd
10 10
11 11
12 class WorkonCmd(subcmd.WrappedChrootCmd): 12 class WorkonCmd(subcmd.WrappedChrootCmd):
13 """Run cros_workon.""" 13 """Run cros_workon."""
14 14
15 def __init__(self): 15 def __init__(self):
16 """WorkonCmd constructor.""" 16 """WorkonCmd constructor."""
17 # Just call the WrappedChrootCmd superclass, which does most of the work. 17 # Just call the WrappedChrootCmd superclass, which does most of the work.
18 super(WorkonCmd, self).__init__( 18 super(WorkonCmd, self).__init__(
19 » 'WORKON', 19 ['cros_workon-%s'], ['cros_workon', '--host'],
20 ['cros_workon-%s'],
21 ['./cros_workon', '--host'],
22 need_args=True 20 need_args=True
23 ) 21 )
24 22
25 def Run(self, raw_argv, *args, **kwargs): 23 def Run(self, raw_argv, *args, **kwargs):
26 """Run the command. 24 """Run the command.
27 25
28 We do just a slight optimization to help users with a common typo. 26 We do just a slight optimization to help users with a common typo.
29 27
30 Args: 28 Args:
31 raw_argv: Command line arguments, including this command's name, but not 29 raw_argv: Command line arguments, including this command's name, but not
32 the chromite command name or chromite options. 30 the chromite command name or chromite options.
33 args: The rest of the positional arguments. See _DoWrappedChrootCommand. 31 args: The rest of the positional arguments. See _DoWrappedChrootCommand.
34 kwargs: The keyword arguments. See _DoWrappedChrootCommand. 32 kwargs: The keyword arguments. See _DoWrappedChrootCommand.
35 """ 33 """
36 # Slight optimization, just since I do this all the time... 34 # Slight optimization, just since I do this all the time...
37 if len(raw_argv) >= 2: 35 if len(raw_argv) >= 2:
38 if raw_argv[1] in ('start', 'stop', 'list', 'list-all', 'iterate'): 36 if raw_argv[1] in ('start', 'stop', 'list', 'list-all', 'iterate'):
39 cros_lib.Warning('OOPS, looks like you forgot a board name. Pick one.') 37 cros_lib.Warning('OOPS, looks like you forgot a board name. Pick one.')
40 raw_argv = raw_argv[:1] + [''] + raw_argv[1:] 38 raw_argv = raw_argv[:1] + [''] + raw_argv[1:]
41 39
42 super(WorkonCmd, self).Run(raw_argv, *args, **kwargs) 40 super(WorkonCmd, self).Run(raw_argv, *args, **kwargs)
OLDNEW
« no previous file with comments | « shell/subcmds/shell_cmd.py ('k') | shell/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698