(self, **kwargs)
| 63 | resources = attr.ib(default=attr.Factory(list)) |
| 64 | |
| 65 | def to_dict(self, **kwargs): |
| 66 | |
| 67 | def dict_fields(attr, value): |
| 68 | if attr.name in ('resources',): |
| 69 | return False |
| 70 | return True |
| 71 | |
| 72 | license_expressions_to_combine = [] |
| 73 | if self.core_license_expression: |
| 74 | license_expressions_to_combine.append(self.core_license_expression) |
| 75 | if self.other_license_expression: |
| 76 | license_expressions_to_combine.append(self.other_license_expression) |
| 77 | if license_expressions_to_combine: |
| 78 | combined_license_expression = combine_expressions(license_expressions_to_combine) |
| 79 | if combined_license_expression: |
| 80 | self.consolidated_license_expression = str(Licensing().parse(combined_license_expression).simplify()) |
| 81 | self.core_holders = [h.original for h in self.core_holders] |
| 82 | self.other_holders = [h.original for h in self.other_holders] |
| 83 | self.consolidated_holders = sorted(set(self.core_holders + self.other_holders)) |
| 84 | # TODO: Verify and test that we are generating detectable copyrights |
| 85 | self.consolidated_copyright = 'Copyright (c) {}'.format(', '.join(self.consolidated_holders)) |
| 86 | return attr.asdict(self, filter=dict_fields, dict_factory=dict) |
| 87 | |
| 88 | |
| 89 | @attr.s |
no test coverage detected