forked from spdx/tools-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextracted_licensing_info.py
More file actions
30 lines (25 loc) · 1.07 KB
/
extracted_licensing_info.py
File metadata and controls
30 lines (25 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# SPDX-FileCopyrightText: 2022 spdx contributors
#
# SPDX-License-Identifier: Apache-2.0
from dataclasses import field
from beartype.typing import List, Optional, Union
from spdx_tools.common.typing.dataclass_with_properties import dataclass_with_properties
from spdx_tools.common.typing.type_checks import check_types_and_set_values
from spdx_tools.spdx.model import SpdxNoAssertion
@dataclass_with_properties
class ExtractedLicensingInfo:
license_id: Optional[str] = None
extracted_text: Optional[str] = None
license_name: Optional[Union[str, SpdxNoAssertion]] = None
cross_references: List[str] = field(default_factory=list)
comment: Optional[str] = None
def __init__(
self,
license_id: Optional[str] = None,
extracted_text: Optional[str] = None,
license_name: Optional[Union[str, SpdxNoAssertion]] = None,
cross_references: List[str] | None = None,
comment: Optional[str] = None,
):
cross_references = [] if cross_references is None else cross_references
check_types_and_set_values(self, locals())