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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/stepsequence.py

Issue 1839193004: Run auto-formatter (autopep8) on webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 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
OLDNEW
1 # Copyright (C) 2009 Google Inc. All rights reserved. 1 # Copyright (C) 2009 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 19 matching lines...) Expand all
30 import sys 30 import sys
31 31
32 from webkitpy.tool import steps 32 from webkitpy.tool import steps
33 33
34 from webkitpy.common.system.executive import ScriptError 34 from webkitpy.common.system.executive import ScriptError
35 35
36 _log = logging.getLogger(__name__) 36 _log = logging.getLogger(__name__)
37 37
38 38
39 class StepSequenceErrorHandler(): 39 class StepSequenceErrorHandler():
40
40 @classmethod 41 @classmethod
41 def handle_script_error(cls, tool, patch, script_error): 42 def handle_script_error(cls, tool, patch, script_error):
42 raise NotImplementedError, "subclasses must implement" 43 raise NotImplementedError, "subclasses must implement"
43 44
44 @classmethod 45 @classmethod
45 def handle_checkout_needs_update(cls, tool, state, options, error): 46 def handle_checkout_needs_update(cls, tool, state, options, error):
46 raise NotImplementedError, "subclasses must implement" 47 raise NotImplementedError, "subclasses must implement"
47 48
48 49
49 class StepSequence(object): 50 class StepSequence(object):
51
50 def __init__(self, steps): 52 def __init__(self, steps):
51 self._steps = steps or [] 53 self._steps = steps or []
52 54
53 def options(self): 55 def options(self):
54 collected_options = [ 56 collected_options = [
55 steps.Options.parent_command, 57 steps.Options.parent_command,
56 steps.Options.quiet, 58 steps.Options.quiet,
57 ] 59 ]
58 for step in self._steps: 60 for step in self._steps:
59 collected_options = collected_options + step.options() 61 collected_options = collected_options + step.options()
(...skipping 18 matching lines...) Expand all
78 state = {} 80 state = {}
79 try: 81 try:
80 self._run(tool, options, state) 82 self._run(tool, options, state)
81 except ScriptError, e: 83 except ScriptError, e:
82 if not options.quiet: 84 if not options.quiet:
83 _log.error(e.message_with_output()) 85 _log.error(e.message_with_output())
84 if options.parent_command: 86 if options.parent_command:
85 command = tool.command_by_name(options.parent_command) 87 command = tool.command_by_name(options.parent_command)
86 command.handle_script_error(tool, state, e) 88 command.handle_script_error(tool, state, e)
87 self.exit_after_handled_error(e) 89 self.exit_after_handled_error(e)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698