Dump a representation of this license as a .LICENSE file with: - the license data as YAML frontmatter - the license text
(self, licenses_data_dir)
| 488 | return data |
| 489 | |
| 490 | def dump(self, licenses_data_dir): |
| 491 | """ |
| 492 | Dump a representation of this license as a .LICENSE file with: |
| 493 | - the license data as YAML frontmatter |
| 494 | - the license text |
| 495 | """ |
| 496 | metadata = self.to_dict(include_builtin=False) |
| 497 | content = self.text |
| 498 | # We add a space to empty newlines to make this text YAML safe |
| 499 | content = get_yaml_safe_text(content) |
| 500 | output = dumps_frontmatter(content=content, metadata=metadata) |
| 501 | license_file = self.license_file(licenses_data_dir=licenses_data_dir) |
| 502 | with open(license_file, 'w') as of: |
| 503 | of.write(output) |
| 504 | |
| 505 | def load(self, license_file, check_consistency=True): |
| 506 | """ |
nothing calls this directly
no test coverage detected