Commit 4855aae7 authored by Boris Baldassari's avatar Boris Baldassari
Browse files

make curate clearlydefined script check the score of decalred license before accepting.

parent 4cae0d6c
......@@ -86,9 +86,13 @@ for package_id in packages:
if r.status_code == 200:
answer = r.json()
if 'licensed' in answer and 'declared' in answer['licensed']:
print(f"Found license: {answer['licensed']['declared']}")
licenses[pkg] = answer['licensed']['declared']
urls[pkg] = 'https://clearlydefined.io/definitions/' + coordinates
print(f"Found license: {answer['licensed']['declared']}.", end=" ")
if 'score' in answer['licensed'] and answer['licensed']['score']['total'] >= 60:
print(f"Total license score is {answer['licensed']['score']['total']}, accepted.")
licenses[pkg] = answer['licensed']['declared']
urls[pkg] = 'https://clearlydefined.io/definitions/' + coordinates
else:
print(f"Total license score is {answer['licensed']['score']['total']}, NOT accepted.")
else:
print("No declared license found on clearlydefined.")
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment