(source_path: str, root_url: Optional[str]=None, parser: str="auto")
| 269 | |
| 270 | @enforce_types |
| 271 | def parse_links_from_source(source_path: str, root_url: Optional[str]=None, parser: str="auto") -> Tuple[List[Link], List[Link]]: |
| 272 | |
| 273 | from ..parsers import parse_links |
| 274 | |
| 275 | new_links: List[Link] = [] |
| 276 | |
| 277 | # parse and validate the import file |
| 278 | raw_links, parser_name = parse_links(source_path, root_url=root_url, parser=parser) |
| 279 | new_links = validate_links(raw_links) |
| 280 | |
| 281 | if parser_name: |
| 282 | num_parsed = len(raw_links) |
| 283 | log_parsing_finished(num_parsed, parser_name) |
| 284 | |
| 285 | return new_links |
| 286 | |
| 287 | @enforce_types |
| 288 | def fix_duplicate_links_in_index(snapshots: QuerySet, links: Iterable[Link]) -> Iterable[Link]: |
no test coverage detected