| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 | 67 |
| 68 def get_typ_dir(): | 68 def get_typ_dir(): |
| 69 return os.path.join(get_chromium_src_dir(), 'third_party', 'typ') | 69 return os.path.join(get_chromium_src_dir(), 'third_party', 'typ') |
| 70 | 70 |
| 71 | 71 |
| 72 def get_webkitpy_thirdparty_dir(): | 72 def get_webkitpy_thirdparty_dir(): |
| 73 return os.path.join(get_scripts_dir(), 'webkitpy', 'thirdparty') | 73 return os.path.join(get_scripts_dir(), 'webkitpy', 'thirdparty') |
| 74 | 74 |
| 75 | 75 |
| 76 class WebKitFinder(object): | 76 class PathFinder(object): |
| 77 | 77 |
| 78 def __init__(self, filesystem): | 78 def __init__(self, filesystem): |
| 79 self._filesystem = filesystem | 79 self._filesystem = filesystem |
| 80 self._dirsep = filesystem.sep | 80 self._dirsep = filesystem.sep |
| 81 self._sys_path = sys.path | 81 self._sys_path = sys.path |
| 82 self._env_path = os.environ['PATH'].split(os.pathsep) | 82 self._env_path = os.environ['PATH'].split(os.pathsep) |
| 83 | 83 |
| 84 @memoized | 84 @memoized |
| 85 def _webkit_base(self): | 85 def _webkit_base(self): |
| 86 """Returns the absolute path to the top of the WebKit tree. | 86 """Returns the absolute path to the top of the WebKit tree. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 prev_dir = '' | 162 prev_dir = '' |
| 163 current_dir = fs.dirname(self._webkit_base()) | 163 current_dir = fs.dirname(self._webkit_base()) |
| 164 while current_dir != prev_dir: | 164 while current_dir != prev_dir: |
| 165 if fs.exists(fs.join(current_dir, 'depot_tools', 'pylint.py')): | 165 if fs.exists(fs.join(current_dir, 'depot_tools', 'pylint.py')): |
| 166 return fs.join(current_dir, 'depot_tools') | 166 return fs.join(current_dir, 'depot_tools') |
| 167 prev_dir = current_dir | 167 prev_dir = current_dir |
| 168 current_dir = fs.dirname(current_dir) | 168 current_dir = fs.dirname(current_dir) |
| 169 | 169 |
| 170 def path_from_depot_tools_base(self, *comps): | 170 def path_from_depot_tools_base(self, *comps): |
| 171 return self._filesystem.join(self.depot_tools_base(), *comps) | 171 return self._filesystem.join(self.depot_tools_base(), *comps) |
| OLD | NEW |