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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/multi_command_tool.py

Issue 2070333003: Use an explicit list of webkit-patch commands instead of using auto-discovery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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: third_party/WebKit/Tools/Scripts/webkitpy/tool/multi_command_tool.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/multi_command_tool.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/multi_command_tool.py
index ad10d1a73f6d98b63afdbbd48bbd907037ad245d..f4f85b1006a56bdc98b6370a4f2b3829ffdb0021 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/multi_command_tool.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/multi_command_tool.py
@@ -35,7 +35,6 @@ import optparse
import logging
import sys
-from webkitpy.tool.commands.command import Command
from webkitpy.tool.commands.command import HelpPrintingOptionParser
from webkitpy.tool.commands.help_command import HelpCommand
@@ -48,29 +47,15 @@ class MultiCommandTool(object):
def __init__(self, name=None, commands=None):
self._name = name or optparse.OptionParser(prog=name).get_prog_name() # OptionParser has nice logic for fetching the name.
- # Allow the unit tests to disable command auto-discovery.
- self.commands = commands or [cls() for cls in self._find_all_commands() if cls.name]
+ self.commands = commands or []
self.help_command = self.command_by_name(HelpCommand.name)
- # Require a help command, even if the manual test list doesn't include one.
+ # Require the help command, even if the manual test list doesn't include one.
if not self.help_command:
self.help_command = HelpCommand()
self.commands.append(self.help_command)
for command in self.commands:
command.bind_to_tool(self)
- @classmethod
- def _add_all_subclasses(cls, class_to_crawl, seen_classes):
- for subclass in class_to_crawl.__subclasses__():
- if subclass not in seen_classes:
- seen_classes.add(subclass)
- cls._add_all_subclasses(subclass, seen_classes)
-
- @classmethod
- def _find_all_commands(cls):
- commands = set()
- cls._add_all_subclasses(Command, commands)
- return sorted(commands)
-
def name(self):
return self._name

Powered by Google App Engine
This is Rietveld 408576698