Return a directory name relative to top_path and files contained.
(top_path)
| 621 | yield os.path.join(dirpath, f) |
| 622 | |
| 623 | def general_source_directories_files(top_path): |
| 624 | """Return a directory name relative to top_path and |
| 625 | files contained. |
| 626 | """ |
| 627 | pruned_directories = ['CVS', '.svn', 'build'] |
| 628 | prune_file_pat = re.compile(r'(?:[~#]|\.py[co]|\.o)$') |
| 629 | for dirpath, dirnames, filenames in os.walk(top_path, topdown=True): |
| 630 | pruned = [ d for d in dirnames if d not in pruned_directories ] |
| 631 | dirnames[:] = pruned |
| 632 | for d in dirnames: |
| 633 | dpath = os.path.join(dirpath, d) |
| 634 | rpath = rel_path(dpath, top_path) |
| 635 | files = [] |
| 636 | for f in os.listdir(dpath): |
| 637 | fn = os.path.join(dpath, f) |
| 638 | if os.path.isfile(fn) and not prune_file_pat.search(fn): |
| 639 | files.append(fn) |
| 640 | yield rpath, files |
| 641 | dpath = top_path |
| 642 | rpath = rel_path(dpath, top_path) |
| 643 | filenames = [os.path.join(dpath, f) for f in os.listdir(dpath) \ |
| 644 | if not prune_file_pat.search(f)] |
| 645 | files = [f for f in filenames if os.path.isfile(f)] |
| 646 | yield rpath, files |
| 647 | |
| 648 | |
| 649 | def get_ext_source_files(ext): |
no test coverage detected