174 patternFormat = "{0}*" |
174 patternFormat = "{0}*" |
175 |
175 |
176 fileNamePatterns.append(patternFormat.format(fileName or "*")) |
176 fileNamePatterns.append(patternFormat.format(fileName or "*")) |
177 |
177 |
178 searchPaths = [] |
178 searchPaths = [] |
|
179 ignorePaths = [] |
179 if self.searchDirCheckBox.isChecked() and self.searchDirPicker.text() != "": |
180 if self.searchDirCheckBox.isChecked() and self.searchDirPicker.text() != "": |
180 searchPaths.append(self.searchDirPicker.text()) |
181 searchPaths.append(self.searchDirPicker.text()) |
181 if self.projectCheckBox.isChecked(): |
182 if self.projectCheckBox.isChecked(): |
182 searchPaths.append(self.__project.getProjectPath()) |
183 searchPaths.append(self.__project.getProjectPath()) |
|
184 ignorePaths.append(self.__project.getProjectVenvPath()) |
183 if self.syspathCheckBox.isChecked(): |
185 if self.syspathCheckBox.isChecked(): |
184 searchPaths.extend(sys.path) |
186 searchPaths.extend(sys.path) |
185 |
187 |
186 self.fileList.clear() |
188 self.fileList.clear() |
187 locations = {} |
189 locations = {} |
191 QApplication.processEvents() |
193 QApplication.processEvents() |
192 |
194 |
193 for path in searchPaths: |
195 for path in searchPaths: |
194 if os.path.isdir(path): |
196 if os.path.isdir(path): |
195 files = FileSystemUtilities.direntries( |
197 files = FileSystemUtilities.direntries( |
196 path, True, fileNamePatterns, False, self.checkStop |
198 path, |
|
199 filesonly=True, |
|
200 pattern=fileNamePatterns, |
|
201 followsymlinks=False, |
|
202 checkStop=self.checkStop, |
|
203 ignore=ignorePaths, |
197 ) |
204 ) |
198 if files: |
205 if files: |
199 for file in files: |
206 for file in files: |
200 fp, fn = os.path.split(file) |
207 fp, fn = os.path.split(file) |
201 if fn in locations: |
208 if fn in locations: |