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

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

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (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 unified diff | Download patch
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 os.environ['LC_MESSAGES'] = 'en_US.UTF-8' 79 os.environ['LC_MESSAGES'] = 'en_US.UTF-8'
80 os.environ['LC_ALL'] = '' 80 os.environ['LC_ALL'] = ''
81 81
82 # FIXME: This is a horrible, horrible hack for WinPort and should be removed . 82 # FIXME: This is a horrible, horrible hack for WinPort and should be removed .
83 # Maybe this belongs in Git in some more generic "find the git binary" codep ath? 83 # Maybe this belongs in Git in some more generic "find the git binary" codep ath?
84 # Or possibly Executive should have a way to emulate shell path-lookups? 84 # Or possibly Executive should have a way to emulate shell path-lookups?
85 # FIXME: Unclear how to test this, since it currently mutates global state o n Git. 85 # FIXME: Unclear how to test this, since it currently mutates global state o n Git.
86 def _engage_awesome_windows_hacks(self): 86 def _engage_awesome_windows_hacks(self):
87 try: 87 try:
88 self.executive.run_command(['git', 'help']) 88 self.executive.run_command(['git', 'help'])
89 except OSError, e: 89 except OSError as e:
90 try: 90 try:
91 self.executive.run_command(['git.bat', 'help']) 91 self.executive.run_command(['git.bat', 'help'])
92 # The Win port uses the depot_tools package, which contains a nu mber 92 # The Win port uses the depot_tools package, which contains a nu mber
93 # of development tools, including Python and git. Instead of usi ng a 93 # of development tools, including Python and git. Instead of usi ng a
94 # real git executable, depot_tools indirects via a batch file, c alled 94 # real git executable, depot_tools indirects via a batch file, c alled
95 # git.bat. This batch file allows depot_tools to auto-update the real 95 # git.bat. This batch file allows depot_tools to auto-update the real
96 # git executable, which is contained in a subdirectory. 96 # git executable, which is contained in a subdirectory.
97 # 97 #
98 # That's all fine and good, except that subprocess.popen can det ect 98 # That's all fine and good, except that subprocess.popen can det ect
99 # the difference between a real git executable and batch file wh en we 99 # the difference between a real git executable and batch file wh en we
100 # don't provide use shell=True. Rather than use shell=True on Wi ndows, 100 # don't provide use shell=True. Rather than use shell=True on Wi ndows,
101 # We hack the git.bat name into the SVN class. 101 # We hack the git.bat name into the SVN class.
102 _log.debug('Engaging git.bat Windows hack.') 102 _log.debug('Engaging git.bat Windows hack.')
103 from webkitpy.common.checkout.scm.git import Git 103 from webkitpy.common.checkout.scm.git import Git
104 Git.executable_name = 'git.bat' 104 Git.executable_name = 'git.bat'
105 except OSError, e: 105 except OSError as e:
106 _log.debug('Failed to engage git.bat Windows hack.') 106 _log.debug('Failed to engage git.bat Windows hack.')
107 107
108 def initialize_scm(self, patch_directories=None): 108 def initialize_scm(self, patch_directories=None):
109 if sys.platform == "win32": 109 if sys.platform == "win32":
110 self._engage_awesome_windows_hacks() 110 self._engage_awesome_windows_hacks()
111 detector = SCMDetector(self.filesystem, self.executive) 111 detector = SCMDetector(self.filesystem, self.executive)
112 self._scm = detector.default_scm(patch_directories) 112 self._scm = detector.default_scm(patch_directories)
113 113
114 def scm(self): 114 def scm(self):
115 return self._scm 115 return self._scm
116 116
117 def scm_for_path(self, path): 117 def scm_for_path(self, path):
118 # FIXME: make scm() be a wrapper around this, and clean up the way 118 # FIXME: make scm() be a wrapper around this, and clean up the way
119 # callers call initialize_scm() (to remove patch_directories) and scm(). 119 # callers call initialize_scm() (to remove patch_directories) and scm().
120 if sys.platform == "win32": 120 if sys.platform == "win32":
121 self._engage_awesome_windows_hacks() 121 self._engage_awesome_windows_hacks()
122 return SCMDetector(self.filesystem, self.executive).detect_scm_system(pa th) 122 return SCMDetector(self.filesystem, self.executive).detect_scm_system(pa th)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698