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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/host.py

Issue 2143123004: Access environment variables through Host object instead of directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and updated after change for dummy home dir on linux. Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/common/system/environment.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10 matching lines...) Expand all
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
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
32 import sys 31 import sys
33 32
34 from webkitpy.common.checkout.scm.detection import SCMDetector 33 from webkitpy.common.checkout.scm.detection import SCMDetector
35 from webkitpy.common.config.builders import BUILDERS 34 from webkitpy.common.config.builders import BUILDERS
36 from webkitpy.common.net.buildbot import BuildBot 35 from webkitpy.common.net.buildbot import BuildBot
37 from webkitpy.common.net import web 36 from webkitpy.common.net import web
38 from webkitpy.common.system.systemhost import SystemHost 37 from webkitpy.common.system.systemhost import SystemHost
39 from webkitpy.layout_tests.builder_list import BuilderList 38 from webkitpy.layout_tests.builder_list import BuilderList
40 from webkitpy.layout_tests.port.factory import PortFactory 39 from webkitpy.layout_tests.port.factory import PortFactory
41 40
(...skipping 24 matching lines...) Expand all
66 65
67 # 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
68 # earliest calls made for all webkitpy-based programs. 67 # earliest calls made for all webkitpy-based programs.
69 def _engage_awesome_locale_hacks(self): 68 def _engage_awesome_locale_hacks(self):
70 # To make life easier on our non-English users, we override 69 # To make life easier on our non-English users, we override
71 # the locale environment variables inside webkitpy. 70 # the locale environment variables inside webkitpy.
72 # 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
73 # messages and svn.py will fail to parse them. 72 # messages and svn.py will fail to parse them.
74 # 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!
75 # This hack only works in unix environments. 74 # This hack only works in unix environments.
76 os.environ['LANGUAGE'] = 'en' 75 self.environ['LANGUAGE'] = 'en'
77 os.environ['LANG'] = 'en_US.UTF-8' 76 self.environ['LANG'] = 'en_US.UTF-8'
78 os.environ['LC_MESSAGES'] = 'en_US.UTF-8' 77 self.environ['LC_MESSAGES'] = 'en_US.UTF-8'
79 os.environ['LC_ALL'] = '' 78 self.environ['LC_ALL'] = ''
80 79
81 # FIXME: This is a horrible, horrible hack for WinPort and should be removed . 80 # FIXME: This is a horrible, horrible hack for WinPort and should be removed .
82 # Maybe this belongs in Git in some more generic "find the git binary" codep ath? 81 # Maybe this belongs in Git in some more generic "find the git binary" codep ath?
83 # Or possibly Executive should have a way to emulate shell path-lookups? 82 # Or possibly Executive should have a way to emulate shell path-lookups?
84 # FIXME: Unclear how to test this, since it currently mutates global state o n Git. 83 # FIXME: Unclear how to test this, since it currently mutates global state o n Git.
85 def _engage_awesome_windows_hacks(self): 84 def _engage_awesome_windows_hacks(self):
86 try: 85 try:
87 self.executive.run_command(['git', 'help']) 86 self.executive.run_command(['git', 'help'])
88 except OSError as e: 87 except OSError as e:
89 try: 88 try:
(...skipping 22 matching lines...) Expand all
112 111
113 def scm(self): 112 def scm(self):
114 return self._scm 113 return self._scm
115 114
116 def scm_for_path(self, path): 115 def scm_for_path(self, path):
117 # 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
118 # callers call initialize_scm() (to remove patch_directories) and scm(). 117 # callers call initialize_scm() (to remove patch_directories) and scm().
119 if sys.platform == "win32": 118 if sys.platform == "win32":
120 self._engage_awesome_windows_hacks() 119 self._engage_awesome_windows_hacks()
121 return SCMDetector(self.filesystem, self.executive).detect_scm_system(pa th) 120 return SCMDetector(self.filesystem, self.executive).detect_scm_system(pa th)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/common/system/environment.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698