diff options
Diffstat (limited to 'python/fatcat_worker.py')
-rwxr-xr-x | python/fatcat_worker.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/python/fatcat_worker.py b/python/fatcat_worker.py index f68b0606..4c52d2c1 100755 --- a/python/fatcat_worker.py +++ b/python/fatcat_worker.py @@ -5,7 +5,6 @@ import argparse import datetime from fatcat_tools.workers.changelog import FatcatChangelogWorker, FatcatEntityUpdatesWorker from fatcat_tools.workers.elastic import FatcatElasticReleaseWorker -from fatcat_tools.harvest import HarvestCrossrefWorker def run_changelog(args): topic = "fatcat-{}.changelog".format(args.env) @@ -27,26 +26,6 @@ def run_elastic_release(args): elastic_index=args.elastic_index) worker.run() -def run_harvest_crossref(args): - worker = HarvestCrossrefWorker( - args.kafka_hosts, - produce_topic="fatcat-{}.crossref".format(args.env), - state_topic="fatcat-{}.crossref-state".format(args.env), - contact_email=args.contact_email, - start_date=args.start_date, - end_date=args.end_date) - worker.run_once() - -def run_harvest_datacite(args): - worker = HarvestDataciteWorker( - args.kafka_hosts, - produce_topic="fatcat-{}.datacite".format(args.env), - state_topic="fatcat-{}.datacite-state".format(args.env), - contact_email=args.contact_email, - start_date=args.start_date, - end_date=args.end_date) - worker.run_once() - def main(): parser = argparse.ArgumentParser() parser.add_argument('--debug', @@ -81,21 +60,6 @@ def main(): help="elasticsearch index to push into", default="fatcat") - def mkdate(raw): - return datetime.datetime.strptime(raw, "%Y-%m-%d").date() - - sub_harvest_crossref = subparsers.add_parser('harvest-crossref') - sub_harvest_crossref.set_defaults(func=run_harvest_crossref) - sub_harvest_crossref.add_argument('--contact-email', - default="undefined", # better? - help="contact email to use in API header") - sub_harvest_crossref.add_argument('--start-date', - default=None, type=mkdate, - help="begining of harvest period") - sub_harvest_crossref.add_argument('--end-date', - default=None, type=mkdate, - help="end of harvest period") - args = parser.parse_args() if not args.__dict__.get("func"): print("tell me what to do!") |