| 453 | self._traversal_files(sub_dir, include_init=include_init) |
| 454 | |
| 455 | def _traversal_files(self, path, include_init=False): |
| 456 | dir_list = os.scandir(path) |
| 457 | for item in dir_list: |
| 458 | if item.name == '__init__.py' and not include_init: |
| 459 | continue |
| 460 | elif (item.name.startswith('__') |
| 461 | and item.name != '__init__.py') or item.name.endswith( |
| 462 | '.json') or item.name.endswith('.md'): |
| 463 | continue |
| 464 | if item.is_dir(): |
| 465 | self._traversal_files(item.path, include_init=include_init) |
| 466 | elif item.is_file() and item.name.endswith('.py'): |
| 467 | self.file_dirs.append(item.path) |
| 468 | elif item.is_file() and 'requirement' in item.name: |
| 469 | self.requirement_dirs.append(item.path) |
| 470 | |
| 471 | def _get_single_file_scan_result(self, file): |
| 472 | try: |