use KEY, NAME, and PARSER to define parsers instead of hardcoding in init

This commit is contained in:
Nick Sweeting 2021-03-31 01:05:49 -04:00
parent 36f0646501
commit 8ce93ff787
13 changed files with 88 additions and 28 deletions
archivebox/parsers

View file

@ -63,3 +63,8 @@ def parse_generic_json_export(json_file: IO[str], **_kwargs) -> Iterable[Link]:
tags=htmldecode(link.get('tags')) or '',
sources=[json_file.name],
)
KEY = 'json'
NAME = 'Generic JSON'
PARSER = parse_generic_json_export