| OLD | NEW |
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 self._depot_tools = None | 41 self._depot_tools = None |
| 42 | 42 |
| 43 def webkit_base(self): | 43 def webkit_base(self): |
| 44 """Returns the absolute path to the top of the WebKit tree. | 44 """Returns the absolute path to the top of the WebKit tree. |
| 45 | 45 |
| 46 Raises an AssertionError if the top dir can't be determined.""" | 46 Raises an AssertionError if the top dir can't be determined.""" |
| 47 # Note: This code somewhat duplicates the code in | 47 # Note: This code somewhat duplicates the code in |
| 48 # scm.find_checkout_root(). However, that code only works if the top | 48 # scm.find_checkout_root(). However, that code only works if the top |
| 49 # of the SCM repository also matches the top of the WebKit tree. Some SV
N users | 49 # of the SCM repository also matches the top of the WebKit tree. Some SV
N users |
| 50 # (the chromium test bots, for example), might only check out subdirecto
ries like | 50 # (the chromium test bots, for example), might only check out subdirecto
ries like |
| 51 # Tools/Scripts. This code will also work if there is no SCM system at a
ll. | 51 # tools. This code will also work if there is no SCM system at all. |
| 52 if not self._webkit_base: | 52 if not self._webkit_base: |
| 53 self._webkit_base = self._webkit_base | 53 self._webkit_base = self._webkit_base |
| 54 module_path = self._filesystem.abspath(self._filesystem.path_to_modu
le(self.__module__)) | 54 module_path = self._filesystem.abspath(self._filesystem.path_to_modu
le(self.__module__)) |
| 55 tools_index = module_path.rfind('tools') | 55 tools_index = module_path.rfind('tools') |
| 56 assert tools_index != -1, "could not find location of this checkout
from %s" % module_path | 56 assert tools_index != -1, "could not find location of this checkout
from %s" % module_path |
| 57 self._webkit_base = self._filesystem.normpath(module_path[0:tools_in
dex - 1]) | 57 self._webkit_base = self._filesystem.normpath(module_path[0:tools_in
dex - 1]) |
| 58 return self._webkit_base | 58 return self._webkit_base |
| 59 | 59 |
| 60 def chromium_base(self): | 60 def chromium_base(self): |
| 61 if not self._chromium_base: | 61 if not self._chromium_base: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 prev_dir = '' | 100 prev_dir = '' |
| 101 current_dir = fs.dirname(self._webkit_base) | 101 current_dir = fs.dirname(self._webkit_base) |
| 102 while current_dir != prev_dir: | 102 while current_dir != prev_dir: |
| 103 if fs.exists(fs.join(current_dir, 'depot_tools', 'pylint.py')): | 103 if fs.exists(fs.join(current_dir, 'depot_tools', 'pylint.py')): |
| 104 return fs.join(current_dir, 'depot_tools') | 104 return fs.join(current_dir, 'depot_tools') |
| 105 prev_dir = current_dir | 105 prev_dir = current_dir |
| 106 current_dir = fs.dirname(current_dir) | 106 current_dir = fs.dirname(current_dir) |
| 107 | 107 |
| 108 def path_from_depot_tools_base(self, *comps): | 108 def path_from_depot_tools_base(self, *comps): |
| 109 return self._filesystem.join(self.depot_tools_base(), *comps) | 109 return self._filesystem.join(self.depot_tools_base(), *comps) |
| OLD | NEW |