Changeset 76339 in webkit
- Timestamp:
- Jan 21, 2011 3:23:39 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r76326 r76339 1 2011-01-21 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Split Host object off from WebKitPatch for easier re-use 6 https://bugs.webkit.org/show_bug.cgi?id=52284 7 8 new-run-webkit-tests and other tools are eventually going to want one of these. 9 Basically you need to inherit from this class if you want to pretend to be a 10 self.tool object for Steps/Commands. 11 12 * Scripts/webkitpy/common/host.py: Added. 13 * Scripts/webkitpy/tool/main.py: 14 1 15 2011-01-20 Dirk Pranke <dpranke@chromium.org> 2 16 -
trunk/Tools/Scripts/webkitpy/tool/main.py
r75575 r76339 37 37 from webkitpy.common.checkout.scm import default_scm 38 38 from webkitpy.common.config.ports import WebKitPort 39 from webkitpy.common.host import Host 39 40 from webkitpy.common.net.bugzilla import Bugzilla 40 41 from webkitpy.common.net.buildbot import BuildBot … … 47 48 48 49 49 class WebKitPatch(MultiCommandTool ):50 class WebKitPatch(MultiCommandTool, Host): 50 51 global_options = [ 51 52 make_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="enable all logging"), … … 60 61 def __init__(self, path): 61 62 MultiCommandTool.__init__(self) 63 Host.__init__(self) 62 64 63 65 self._path = path 64 66 self.wakeup_event = threading.Event() 65 # FIXME: All of these shared objects should move off onto a66 # separate "Tool" object. WebKitPatch should inherit from67 # "Tool" and all these objects should use getters/setters instead of68 # manual getter functions (e.g. scm()).69 self.bugs = Bugzilla()70 self.buildbot = BuildBot()71 self.executive = executive.Executive()72 self._irc = None73 self.filesystem = filesystem.FileSystem()74 self.workspace = workspace.Workspace(self.filesystem, self.executive)75 self._port = None76 self.user = user.User()77 self._scm = None78 self._checkout = None79 self.status_server = StatusServer()80 self.port_factory = port.factory81 self.platform = platforminfo.PlatformInfo()82 83 def scm(self):84 # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).85 if not self._scm:86 self._scm = default_scm(self._options.patch_directories)87 return self._scm88 89 def checkout(self):90 if not self._checkout:91 self._checkout = Checkout(self.scm())92 return self._checkout93 94 def port(self):95 return self._port96 97 def ensure_irc_connected(self, irc_delegate):98 if not self._irc:99 self._irc = IRCProxy(irc_delegate)100 101 def irc(self):102 # We don't automatically construct IRCProxy here because constructing103 # IRCProxy actually connects to IRC. We want clients to explicitly104 # connect to IRC.105 return self._irc106 67 107 68 def path(self): 108 69 return self._path 109 110 def command_completed(self):111 if self._irc:112 self._irc.disconnect()113 70 114 71 def should_show_in_main_help(self, command): … … 121 78 # FIXME: This may be unnecessary since we pass global options to all commands during execute() as well. 122 79 def handle_global_options(self, options): 123 self._ options = options80 self._initialize_scm(options.patch_directories) 124 81 if options.dry_run: 125 82 self.scm().dryrun = True
Note: See TracChangeset
for help on using the changeset viewer.