MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / ScanCodeLicenses

Class ScanCodeLicenses

etc/scripts/licenses/synclic.py:50–74  ·  view source on GitHub ↗

Licenses from the current ScanCode installation

Source from the content-addressed store, hash-verified

48
49
50class ScanCodeLicenses:
51 """
52 Licenses from the current ScanCode installation
53 """
54
55 def __init__(self):
56 self.by_key = load_licenses(with_deprecated=True)
57 self.by_spdx_key = get_licenses_by_spdx_key(self.by_key.values())
58
59 def clean(self):
60 """
61 Redump licenses YAML re-applying pretty-printing.
62 """
63 for lic in self.by_key.values():
64 updated = False
65 if lic.standard_notice:
66 updated = True
67 lic.standard_notice = clean_text(lic.standard_notice)
68 if lic.notes:
69 updated = True
70 lic.notes = clean_text(lic.notes)
71
72 if updated:
73 models.update_ignorables(lic, verbose=False)
74 lic.dump(licenses_data_dir=licensedcode.models.licenses_data_dir)
75
76
77class ExternalLicensesSource:

Callers 1

cliFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected