diff --git a/cli_support/CLI.py b/cli_support/CLI.py index f6d0750..5a074cc 100644 --- a/cli_support/CLI.py +++ b/cli_support/CLI.py @@ -9,7 +9,7 @@ import sys import xml.etree.ElementTree as ET -from typing import Any, Optional +from typing import Any, List, Optional from .cli_assessment_summary import CliAssessmentSummary from .cli_copyright import CliCopyright @@ -65,12 +65,12 @@ def __init__(self) -> None: self.general_information = CliGeneralInformation() self.assessment_summary = CliAssessmentSummary() - self.licenses: list[CliLicense] = [] - self.copyrights: list[CliCopyright] = [] - self.obligations: list[CliObligation] = [] - self.tags: list[str] = [] - self.export_restrictions: list[CliExportRestriction] = [] - self.external_ids: list[CliExternalId] = [] + self.licenses: List[CliLicense] = [] + self.copyrights: List[CliCopyright] = [] + self.obligations: List[CliObligation] = [] + self.tags: List[str] = [] + self.export_restrictions: List[CliExportRestriction] = [] + self.external_ids: List[CliExternalId] = [] self.irrelevant_files = CliIrrelevantFiles() self.comment: str = "" diff --git a/cli_support/cli_copyright.py b/cli_support/cli_copyright.py index 02c8e25..fb8acf7 100644 --- a/cli_support/cli_copyright.py +++ b/cli_support/cli_copyright.py @@ -8,6 +8,7 @@ # ------------------------------------------------------------------------------- import xml.etree.ElementTree as ET +from typing import List from .cli_file_item_base import CliFileItemBase @@ -20,8 +21,8 @@ class CliCopyright(CliFileItemBase): def __init__(self) -> None: CliFileItemBase.__init__(self) self.text: str = "" - self.files: list[str] = [] - self.hashes: list[str] = [] + self.files: List[str] = [] + self.hashes: List[str] = [] def _read_from_element(self, element: ET.Element) -> None: """Read copyright from XML element.""" diff --git a/cli_support/cli_file_item_base.py b/cli_support/cli_file_item_base.py index a9a7615..80b889f 100644 --- a/cli_support/cli_file_item_base.py +++ b/cli_support/cli_file_item_base.py @@ -8,6 +8,7 @@ # ------------------------------------------------------------------------------- import xml.etree.ElementTree as ET +from typing import List from .xml_base import XmlBase @@ -19,8 +20,8 @@ class CliFileItemBase(XmlBase): FILEHASH_TAG = "FileHash" def __init__(self) -> None: - self.files: list[str] = [] - self.hashes: list[str] = [] + self.files: List[str] = [] + self.hashes: List[str] = [] def _read_files_from_element(self, element: ET.Element) -> None: """Read files and hashes from XML element.""" diff --git a/cli_support/cli_irrelevant_files.py b/cli_support/cli_irrelevant_files.py index eb90c77..d2c092c 100644 --- a/cli_support/cli_irrelevant_files.py +++ b/cli_support/cli_irrelevant_files.py @@ -8,6 +8,7 @@ # ------------------------------------------------------------------------------- import xml.etree.ElementTree as ET +from typing import List from .cli_file_item_base import CliFileItemBase @@ -19,8 +20,8 @@ class CliIrrelevantFiles(CliFileItemBase): def __init__(self) -> None: CliFileItemBase.__init__(self) - self.files: list[str] = [] - self.hashes: list[str] = [] + self.files: List[str] = [] + self.hashes: List[str] = [] def _read_from_element(self, element: ET.Element) -> None: """Read irrelevant files from XML element.""" diff --git a/cli_support/cli_license.py b/cli_support/cli_license.py index b897c75..efa1176 100644 --- a/cli_support/cli_license.py +++ b/cli_support/cli_license.py @@ -8,6 +8,7 @@ # ------------------------------------------------------------------------------- import xml.etree.ElementTree as ET +from typing import List from .cli_file_item_base import CliFileItemBase @@ -25,10 +26,10 @@ def __init__(self) -> None: self.type: str = "" self.name: str = "" self.spdx_identifier: str = "" - self.acknowledgements: list[str] = [] - self.tags: list[str] = [] - self.files: list[str] = [] - self.hashes: list[str] = [] + self.acknowledgements: List[str] = [] + self.tags: List[str] = [] + self.files: List[str] = [] + self.hashes: List[str] = [] def _read_from_element(self, element: ET.Element) -> None: """Read license from XML element.""" diff --git a/cli_support/cli_obligation.py b/cli_support/cli_obligation.py index e4824aa..5a70373 100644 --- a/cli_support/cli_obligation.py +++ b/cli_support/cli_obligation.py @@ -8,6 +8,7 @@ # ------------------------------------------------------------------------------- import xml.etree.ElementTree as ET +from typing import List from .xml_base import XmlBase @@ -23,7 +24,7 @@ class CliObligation(XmlBase): def __init__(self) -> None: self.text: str = "" self.topic: str = "" - self.licenses: list[str] = [] + self.licenses: List[str] = [] def _read_from_element(self, element: ET.Element) -> None: """Read license from XML element.""" diff --git a/cli_support/license_tools.py b/cli_support/license_tools.py index 443d714..03493fd 100644 --- a/cli_support/license_tools.py +++ b/cli_support/license_tools.py @@ -33,7 +33,7 @@ def get_global_license(clifile: CliFile) -> Optional[CliLicense]: @staticmethod def get_non_global_licenses(clifile: CliFile) -> List[CliLicense]: """Gets the non global licenses.""" - result: list[CliLicense] = [] + result: List[CliLicense] = [] for lic in clifile.licenses: if lic.type.upper() != "GLOBAL": result.append(lic)