@@ -360,8 +360,7 @@ def download_dca_databases(
360
360
361
361
artifact_map [pretty_name ] = analyzed_database
362
362
363
- def download_and_extract (item : tuple [str , dict ]) -> str :
364
- pretty_name , analyzed_database = item
363
+ def download_and_decompress (analyzed_database : dict ) -> str :
365
364
artifact_name = analyzed_database ["artifact_name" ]
366
365
repository = analyzed_database ["repository" ]
367
366
run_id = analyzed_database ["run_id" ]
@@ -378,7 +377,7 @@ def download_and_extract(item: tuple[str, dict]) -> str:
378
377
artifact_zip_location = download_artifact (
379
378
archive_download_url , artifact_name , pat
380
379
)
381
- print (f"=== Extracting artifact: { artifact_name } ===" )
380
+ print (f"=== Decompressing artifact: { artifact_name } ===" )
382
381
# The database is in a zip file, which contains a tar.gz file with the DB
383
382
# First we open the zip file
384
383
with zipfile .ZipFile (artifact_zip_location , "r" ) as zip_ref :
@@ -396,21 +395,21 @@ def download_and_extract(item: tuple[str, dict]) -> str:
396
395
# And we just untar it to the same directory as the zip file
397
396
tar_ref .extractall (artifact_unzipped_location )
398
397
ret = os .path .join (artifact_unzipped_location , language )
399
- print (f"Extraction complete: { ret } " )
398
+ print (f"Decompression complete: { ret } " )
400
399
return ret
401
400
402
401
results = run_in_parallel (
403
- download_and_extract ,
404
- list (artifact_map .items ()),
405
- on_error = lambda item , exc : print (
406
- f"ERROR: Failed to download database for { item [ 0 ]} : { exc } "
402
+ download_and_decompress ,
403
+ list (artifact_map .values ()),
404
+ on_error = lambda db , exc : print (
405
+ f"ERROR: Failed to download and decompress { db [ "artifact_name" ]} : { exc } "
407
406
),
408
407
error_summary = lambda failures : print (
409
408
f"ERROR: Failed to download { len (failures )} databases: { ', ' .join (item [0 ] for item in failures )} "
410
409
),
411
410
)
412
411
413
- print (f"\n === Extracted { len (results )} databases ===" )
412
+ print (f"\n === Fetched { len (results )} databases ===" )
414
413
415
414
return [(project_map [n ], r ) for n , r in zip (artifact_map , results )]
416
415
0 commit comments