From c138b367229b5c0323984668315f369151668e32 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 6 Apr 2020 16:41:12 -0500 Subject: - Added some output and run main() by default - Disabled ssl checking which does not work if you lack a certificate --- bh20sequploader/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bh20sequploader') diff --git a/bh20sequploader/main.py b/bh20sequploader/main.py index 9de51f4..17ad492 100644 --- a/bh20sequploader/main.py +++ b/bh20sequploader/main.py @@ -17,18 +17,22 @@ def main(): parser.add_argument('metadata', type=argparse.FileType('r'), help='sequence metadata json') args = parser.parse_args() - api = arvados.api(host=ARVADOS_API_HOST, token=ARVADOS_API_TOKEN) + api = arvados.api(host=ARVADOS_API_HOST, token=ARVADOS_API_TOKEN, insecure=True) col = arvados.collection.Collection(api_client=api) + print("Reading FASTA") with col.open("sequence.fasta", "w") as f: r = args.sequence.read(65536) + print(r[0:20]) while r: f.write(r) r = args.sequence.read(65536) + print("Reading JSONLD") with col.open("metadata.jsonld", "w") as f: r = args.metadata.read(65536) + print(r[0:20]) while r: f.write(r) r = args.metadata.read(65536) @@ -44,3 +48,5 @@ def main(): col.save_new(owner_uuid=UPLOAD_PROJECT, name="Uploaded by %s from %s" % (properties['upload_user'], properties['upload_ip']), properties=properties, ensure_unique_name=True) + +main() -- cgit v1.2.3