Drop unused class
@@ -28,7 +28,7 @@ from typing import Optional, Tuple
from aqt.exceptions import ArchiveListError, NoPackageFound
from aqt.helper import Settings, getUrl
-from aqt.metadata import SimpleSpec, Version
+from aqt.metadata import Version
@dataclass
@@ -64,76 +64,6 @@ class QtPackage:
)
-@dataclass
-class ListInfo:
- name: str
- display_name: str
- desc: str
- virtual: str
-
-
-class PackagesList:
- """
- Hold packages list information.
- """
-
- def __init__(self, version, os_name, target, base, timeout=(5, 5)):
- self.version = Version(version)
- self.os_name = os_name
- self.target = target
- self.archives = []
- self.base = posixpath.join(base, "online", "qtsdkrepository")
- self.timeout = timeout
- self.logger = getLogger("aqt")
- self._get_archives()
-
- def _get_archives(self):
- # Get packages index
- if self.version.major == 6 and self.target == "android":
- arch_ext = ["_armv7/", "_x86/", "_x86_64/", "_arm64_v8a/"]
- elif self.version in SimpleSpec(">=5.13.0,<6.0") and self.target == "desktop":
- arch_ext = ["/", "_wasm/"]
- else:
- arch_ext = ["/"]
- for ext in arch_ext:
- archive_path = "{0}{1}{2}/qt{3}_{3}{4}{5}{6}".format(
- self.os_name,
- "_x86/" if self.os_name == "windows" else "_x64/",
- self.target,
- self.version.major,
- self.version.minor,
- self.version.patch,
- ext,
- )
- update_xml_url = posixpath.join(self.base, archive_path, "Updates.xml")
- xml_text = getUrl(update_xml_url, self.timeout)
- self.update_xml = ElementTree.fromstring(xml_text)
- for packageupdate in self.update_xml.iter("PackageUpdate"):
- name = packageupdate.find("Name").text
- if packageupdate.find("DownloadableArchives").text is not None:
- package_desc = packageupdate.findtext("Description")
- display_name = packageupdate.findtext("DisplayName")
- virtual_str = packageupdate.findtext("Virtual")
- if virtual_str == "true":
- virtual = True
- else:
- virtual = False
- self.archives.append(
- ListInfo(
- name=name,
- display_name=display_name,
- desc=package_desc,
- virtual=virtual,
- )
- )
- if len(self.archives) == 0:
- self.logger.error("Error while parsing package information!")
- exit(1)
-
- def get_list(self):
- return self.archives
-
-
class QtArchives:
"""Download and hold Qt archive packages list.
It access to download.qt.io site and get Update.xml file.
