OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import fnmatch | 5 import fnmatch |
6 import inspect | 6 import inspect |
7 import os | 7 import os |
8 import re | 8 import re |
9 | 9 |
10 from telemetry import decorators | 10 from telemetry import decorators |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 | 127 |
128 def IsPageSetFile(file_path): | 128 def IsPageSetFile(file_path): |
129 root_name, ext_name = os.path.splitext(file_path) | 129 root_name, ext_name = os.path.splitext(file_path) |
130 if 'unittest' in root_name or 'page_sets/data' in root_name: | 130 if 'unittest' in root_name or 'page_sets/data' in root_name: |
131 return False | 131 return False |
132 if ext_name != '.py': | 132 if ext_name != '.py': |
133 return False | 133 return False |
134 module = util.GetPythonPageSetModule(file_path) | 134 module = util.GetPythonPageSetModule(file_path) |
135 return bool(DiscoverClassesInModule(module, page_set.PageSet)) | 135 return bool(DiscoverClassesInModule(module, page_set.PageSet)) |
136 | |
137 | |
138 def GetAllPageSetFilenames(dir_path): | |
139 results = [] | |
140 for sub_path, _, filenames in os.walk(dir_path): | |
141 for f in filenames: | |
142 if f.startswith('.'): | |
143 continue | |
144 filename = os.path.join(sub_path, f) | |
145 if IsPageSetFile(filename): | |
146 results.append(filename) | |
147 return results | |
OLD | NEW |