diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-03 12:29:39 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-03 12:31:07 -0700 |
commit | 10a2374051568edf3d872988e730328d899a0fdd (patch) | |
tree | 795be5e149a021f84bc4305c1811e63cc86f7aa1 /python/fatcat_ingest.py | |
parent | cfab1ddcd8a05b62ecc16763d18a6ecee8fa234f (diff) | |
download | fatcat-10a2374051568edf3d872988e730328d899a0fdd.tar.gz fatcat-10a2374051568edf3d872988e730328d899a0fdd.zip |
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.
Diffstat (limited to 'python/fatcat_ingest.py')
-rwxr-xr-x | python/fatcat_ingest.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/fatcat_ingest.py b/python/fatcat_ingest.py index 21597fae..71965f14 100755 --- a/python/fatcat_ingest.py +++ b/python/fatcat_ingest.py @@ -21,7 +21,7 @@ from fatcat_tools.transforms import release_ingest_request sentry_client = raven.Client() -def _init_search(args): +def _init_search(args: argparse.Namespace) -> Search: # ensure API connection works args.api.get_changelog() @@ -31,7 +31,7 @@ def _init_search(args): return search -def _run_search_dump(args, search): +def _run_search_dump(args: argparse.Namespace, search: Search) -> None: if args.dry_run: print("=== THIS IS A DRY RUN ===") @@ -122,7 +122,7 @@ def _run_search_dump(args, search): print("=== THIS WAS A DRY RUN ===") -def run_ingest_container(args): +def run_ingest_container(args: argparse.Namespace) -> None: """ This command queries elasticsearch for releases from a given container (eg, journal), and prepares ingest requests for them. @@ -151,7 +151,7 @@ def run_ingest_container(args): return _run_search_dump(args, search) -def run_ingest_query(args): +def run_ingest_query(args: argparse.Namespace) -> None: """ Accepts a free-form Lucene query language string. Intended to work the same way as searches in the fatcat web interface. @@ -173,7 +173,7 @@ def run_ingest_query(args): return _run_search_dump(args, search) -def run_ingest_extid(args): +def run_ingest_extid(args: argparse.Namespace) -> None: """ Selects release entities where the external identifier (extid) exists """ @@ -183,7 +183,7 @@ def run_ingest_extid(args): return _run_search_dump(args, search) -def main(): +def main() -> None: parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument( "--fatcat-api-url", default="http://localhost:9411/v0", help="connect to this host/port" |