(links: List[Link],
status: str,
out_dir: Path=OUTPUT_DIR)
| 926 | |
| 927 | @enforce_types |
| 928 | def list_folders(links: List[Link], |
| 929 | status: str, |
| 930 | out_dir: Path=OUTPUT_DIR) -> Dict[str, Optional[Link]]: |
| 931 | |
| 932 | check_data_folder(out_dir=out_dir) |
| 933 | |
| 934 | STATUS_FUNCTIONS = { |
| 935 | "indexed": get_indexed_folders, |
| 936 | "archived": get_archived_folders, |
| 937 | "unarchived": get_unarchived_folders, |
| 938 | "present": get_present_folders, |
| 939 | "valid": get_valid_folders, |
| 940 | "invalid": get_invalid_folders, |
| 941 | "duplicate": get_duplicate_folders, |
| 942 | "orphaned": get_orphaned_folders, |
| 943 | "corrupted": get_corrupted_folders, |
| 944 | "unrecognized": get_unrecognized_folders, |
| 945 | } |
| 946 | |
| 947 | try: |
| 948 | return STATUS_FUNCTIONS[status](links, out_dir=out_dir) |
| 949 | except KeyError: |
| 950 | raise ValueError('Status not recognized.') |
| 951 | |
| 952 | @enforce_types |
| 953 | def setup(out_dir: Path=OUTPUT_DIR) -> None: |
no test coverage detected