Licenses from the current ScanCode installation
| 48 | |
| 49 | |
| 50 | class 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 | |
| 77 | class ExternalLicensesSource: |