Title: [237269] trunk/Tools
Revision
237269
Author
commit-qu...@webkit.org
Date
2018-10-18 15:14:52 -0700 (Thu, 18 Oct 2018)

Log Message

clean-webkit pulls in many unnecessary dependencies in webkitpy
https://bugs.webkit.org/show_bug.cgi?id=190732

Patch by Dean Johnson <dean_john...@apple.com> on 2018-10-18
Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/host.py:
(Host.__init__): Split out 'bugs', 'bugzilla', and 'web' to only be created when used.
(Host):
(Host.bugs):
(Host.bugzilla):
(Host.web):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (237268 => 237269)


--- trunk/Tools/ChangeLog	2018-10-18 21:44:24 UTC (rev 237268)
+++ trunk/Tools/ChangeLog	2018-10-18 22:14:52 UTC (rev 237269)
@@ -1,3 +1,17 @@
+2018-10-18  Dean Johnson  <dean_john...@apple.com>
+
+        clean-webkit pulls in many unnecessary dependencies in webkitpy
+        https://bugs.webkit.org/show_bug.cgi?id=190732
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/common/host.py:
+        (Host.__init__): Split out 'bugs', 'bugzilla', and 'web' to only be created when used.
+        (Host):
+        (Host.bugs):
+        (Host.bugzilla):
+        (Host.web):
+
 2018-10-18  Chris Dumez  <cdu...@apple.com>
 
         [PSON] SuspendedPages do not report meaningful domains in Activity Monitor

Modified: trunk/Tools/Scripts/webkitpy/common/host.py (237268 => 237269)


--- trunk/Tools/Scripts/webkitpy/common/host.py	2018-10-18 21:44:24 UTC (rev 237268)
+++ trunk/Tools/Scripts/webkitpy/common/host.py	2018-10-18 22:14:52 UTC (rev 237269)
@@ -34,7 +34,6 @@
 from webkitpy.common.checkout import Checkout
 from webkitpy.common.checkout.scm.detection import SCMDetector
 from webkitpy.common.memoized import memoized
-from webkitpy.common.net import bugzilla, buildbot, web
 from webkitpy.common.system.systemhost import SystemHost
 from webkitpy.common.watchlist.watchlistparser import WatchListParser
 from webkitpy.port.factory import PortFactory
@@ -46,14 +45,8 @@
 class Host(SystemHost):
     def __init__(self):
         SystemHost.__init__(self)
-        self.web = web.Web()
-
         self._checkout = None
 
-        # Everything below this line is WebKit-specific and belongs on a higher-level object.
-        self.bugs = bugzilla.Bugzilla()
-        self.buildbot = buildbot.BuildBot()
-
         # FIXME: Unfortunately Port objects are currently the central-dispatch objects of the NRWT world.
         # In order to instantiate a port correctly, we have to pass it at least an executive, user, scm, and filesystem
         # so for now we just pass along the whole Host object.
@@ -62,6 +55,24 @@
 
         self._engage_awesome_locale_hacks()
 
+    @property
+    @memoized
+    def bugs(self):
+        from webkitpy.common.net import bugzilla
+        return bugzilla.Bugzilla()
+
+    @property
+    @memoized
+    def bugzilla(self):
+        from webkitpy.common.net import buildbot
+        return buildbot.BuildBot()
+
+    @property
+    @memoized
+    def web(self):
+        from webkitpy.common.net import web
+        return web.Web()
+
     # We call this from the Host constructor, as it's one of the
     # earliest calls made for all webkitpy-based programs.
     def _engage_awesome_locale_hacks(self):
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to