| OLD | NEW |
| 1 # Copyright (c) 2010 Google Inc. All rights reserved. | 1 # Copyright (c) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (c) 2009 Apple Inc. All rights reserved. | 2 # Copyright (c) 2009 Apple Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 import logging | 30 import logging |
| 31 import os | 31 import os |
| 32 import sys | 32 import sys |
| 33 | 33 |
| 34 from webkitpy.common.checkout.scm.detection import SCMDetector | 34 from webkitpy.common.checkout.scm.detection import SCMDetector |
| 35 from webkitpy.common.memoized import memoized | 35 from webkitpy.common.memoized import memoized |
| 36 from webkitpy.common.net import buildbot, web | 36 from webkitpy.common.net import buildbot, web |
| 37 from webkitpy.common.system.systemhost import SystemHost | 37 from webkitpy.common.system.systemhost import SystemHost |
| 38 from webkitpy.layout_tests.builders import Builders |
| 38 from webkitpy.layout_tests.port.factory import PortFactory | 39 from webkitpy.layout_tests.port.factory import PortFactory |
| 39 | 40 |
| 40 | 41 |
| 41 _log = logging.getLogger(__name__) | 42 _log = logging.getLogger(__name__) |
| 42 | 43 |
| 43 | 44 |
| 44 class Host(SystemHost): | 45 class Host(SystemHost): |
| 45 | 46 |
| 46 def __init__(self): | 47 def __init__(self): |
| 47 SystemHost.__init__(self) | 48 SystemHost.__init__(self) |
| 48 self.web = web.Web() | 49 self.web = web.Web() |
| 49 | 50 |
| 50 self._scm = None | 51 self._scm = None |
| 51 | 52 |
| 52 # Everything below this line is WebKit-specific and belongs on a higher-
level object. | 53 # Everything below this line is WebKit-specific and belongs on a higher-
level object. |
| 53 self.buildbot = buildbot.BuildBot() | 54 self.buildbot = buildbot.BuildBot() |
| 54 | 55 |
| 55 # FIXME: Unfortunately Port objects are currently the central-dispatch o
bjects of the NRWT world. | 56 # FIXME: Unfortunately Port objects are currently the central-dispatch o
bjects of the NRWT world. |
| 56 # In order to instantiate a port correctly, we have to pass it at least
an executive, user, scm, and filesystem | 57 # In order to instantiate a port correctly, we have to pass it at least
an executive, user, scm, and filesystem |
| 57 # so for now we just pass along the whole Host object. | 58 # so for now we just pass along the whole Host object. |
| 58 # FIXME: PortFactory doesn't belong on this Host object if Port is going
to have a Host (circular dependency). | 59 # FIXME: PortFactory doesn't belong on this Host object if Port is going
to have a Host (circular dependency). |
| 59 self.port_factory = PortFactory(self) | 60 self.port_factory = PortFactory(self) |
| 60 | 61 |
| 61 self._engage_awesome_locale_hacks() | 62 self._engage_awesome_locale_hacks() |
| 62 | 63 |
| 64 self.builders = Builders() |
| 65 |
| 63 # We call this from the Host constructor, as it's one of the | 66 # We call this from the Host constructor, as it's one of the |
| 64 # earliest calls made for all webkitpy-based programs. | 67 # earliest calls made for all webkitpy-based programs. |
| 65 def _engage_awesome_locale_hacks(self): | 68 def _engage_awesome_locale_hacks(self): |
| 66 # To make life easier on our non-english users, we override | 69 # To make life easier on our non-english users, we override |
| 67 # the locale environment variables inside webkitpy. | 70 # the locale environment variables inside webkitpy. |
| 68 # If we don't do this, programs like SVN will output localized | 71 # If we don't do this, programs like SVN will output localized |
| 69 # messages and svn.py will fail to parse them. | 72 # messages and svn.py will fail to parse them. |
| 70 # FIXME: We should do these overrides *only* for the subprocesses we kno
w need them! | 73 # FIXME: We should do these overrides *only* for the subprocesses we kno
w need them! |
| 71 # This hack only works in unix environments. | 74 # This hack only works in unix environments. |
| 72 os.environ['LANGUAGE'] = 'en' | 75 os.environ['LANGUAGE'] = 'en' |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 111 |
| 109 def scm(self): | 112 def scm(self): |
| 110 return self._scm | 113 return self._scm |
| 111 | 114 |
| 112 def scm_for_path(self, path): | 115 def scm_for_path(self, path): |
| 113 # FIXME: make scm() be a wrapper around this, and clean up the way | 116 # FIXME: make scm() be a wrapper around this, and clean up the way |
| 114 # callers call initialize_scm() (to remove patch_directories) and scm(). | 117 # callers call initialize_scm() (to remove patch_directories) and scm(). |
| 115 if sys.platform == "win32": | 118 if sys.platform == "win32": |
| 116 self._engage_awesome_windows_hacks() | 119 self._engage_awesome_windows_hacks() |
| 117 return SCMDetector(self.filesystem, self.executive).detect_scm_system(pa
th) | 120 return SCMDetector(self.filesystem, self.executive).detect_scm_system(pa
th) |
| OLD | NEW |