From 10a2374051568edf3d872988e730328d899a0fdd Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Nov 2021 12:29:39 -0700 Subject: typing: first batch of python bulk type annotations While these changes are more delicate than simple lint changes, this specific batch of edits and annotations was *relatively* simple, and resulted in few code changes other than function signature additions. --- python/fatcat_harvest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'python/fatcat_harvest.py') diff --git a/python/fatcat_harvest.py b/python/fatcat_harvest.py index 91356aad..be3cb888 100755 --- a/python/fatcat_harvest.py +++ b/python/fatcat_harvest.py @@ -19,7 +19,7 @@ from fatcat_tools.harvest import ( sentry_client = raven.Client() -def run_crossref(args): +def run_crossref(args: argparse.Namespace) -> None: worker = HarvestCrossrefWorker( kafka_hosts=args.kafka_hosts, produce_topic=f"fatcat-{args.env}.api-crossref", @@ -31,7 +31,7 @@ def run_crossref(args): worker.run(continuous=args.continuous) -def run_datacite(args): +def run_datacite(args: argparse.Namespace) -> None: worker = HarvestDataciteWorker( kafka_hosts=args.kafka_hosts, produce_topic=f"fatcat-{args.env}.api-datacite", @@ -43,7 +43,7 @@ def run_datacite(args): worker.run(continuous=args.continuous) -def run_arxiv(args): +def run_arxiv(args: argparse.Namespace) -> None: worker = HarvestArxivWorker( kafka_hosts=args.kafka_hosts, produce_topic=f"fatcat-{args.env}.oaipmh-arxiv", @@ -54,7 +54,7 @@ def run_arxiv(args): worker.run(continuous=args.continuous) -def run_pubmed(args): +def run_pubmed(args: argparse.Namespace) -> None: worker = PubmedFTPWorker( kafka_hosts=args.kafka_hosts, produce_topic=f"fatcat-{args.env}.ftp-pubmed", @@ -65,7 +65,7 @@ def run_pubmed(args): worker.run(continuous=args.continuous) -def run_doaj_article(args): +def run_doaj_article(args: argparse.Namespace) -> None: worker = HarvestDoajArticleWorker( kafka_hosts=args.kafka_hosts, produce_topic=f"fatcat-{args.env}.oaipmh-doaj-article", @@ -76,7 +76,7 @@ def run_doaj_article(args): worker.run(continuous=args.continuous) -def run_doaj_journal(args): +def run_doaj_journal(args: argparse.Namespace) -> None: worker = HarvestDoajJournalWorker( kafka_hosts=args.kafka_hosts, produce_topic=f"fatcat-{args.env}.oaipmh-doaj-journal", @@ -87,11 +87,11 @@ def run_doaj_journal(args): worker.run(continuous=args.continuous) -def mkdate(raw): +def mkdate(raw: str) -> datetime.date: return datetime.datetime.strptime(raw, "%Y-%m-%d").date() -def main(): +def main() -> None: parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument( "--kafka-hosts", -- cgit v1.2.3