mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 21:24:38 +03:00
Add type hints to QtArchives
This is meant to make the QtArchives class more readable, so the types of each data member are absolutely clear.
This commit is contained in:
@@ -24,7 +24,7 @@ import posixpath
|
|||||||
import xml.etree.ElementTree as ElementTree
|
import xml.etree.ElementTree as ElementTree
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from typing import List, Optional, Tuple
|
from typing import Iterable, List, Optional, Tuple
|
||||||
|
|
||||||
from aqt.exceptions import ArchiveListError, NoPackageFound
|
from aqt.exceptions import ArchiveListError, NoPackageFound
|
||||||
from aqt.helper import Settings, getUrl
|
from aqt.helper import Settings, getUrl
|
||||||
@@ -73,30 +73,28 @@ class QtArchives:
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
os_name,
|
os_name: str,
|
||||||
target,
|
target: str,
|
||||||
version_str,
|
version_str: str,
|
||||||
arch,
|
arch: str,
|
||||||
base,
|
base: str,
|
||||||
subarchives=None,
|
subarchives: Optional[Iterable[str]] = None,
|
||||||
modules=None,
|
modules: Optional[Iterable[str]] = None,
|
||||||
all_extra=False,
|
all_extra: bool = False,
|
||||||
timeout=(5, 5),
|
timeout=(5, 5),
|
||||||
):
|
):
|
||||||
self.version = Version(version_str)
|
self.version: Version = Version(version_str)
|
||||||
self.target = target
|
self.target: str = target
|
||||||
self.arch = arch
|
self.arch: str = arch
|
||||||
self.os_name = os_name
|
self.os_name: str = os_name
|
||||||
self.all_extra = all_extra
|
self.all_extra: bool = all_extra
|
||||||
self.arch_list = [item.get("arch") for item in Settings.qt_combinations]
|
self.arch_list: List[str] = [item.get("arch") for item in Settings.qt_combinations]
|
||||||
all_archives = subarchives is None
|
all_archives = subarchives is None
|
||||||
self.base = base + "/online/qtsdkrepository/"
|
self.base = base + "/online/qtsdkrepository/"
|
||||||
self.logger = getLogger("aqt.archives")
|
self.logger = getLogger("aqt.archives")
|
||||||
self.archives = []
|
self.archives: List[QtPackage] = []
|
||||||
self.mod_list = []
|
self.mod_list: List[str] = []
|
||||||
if all_extra:
|
if not all_extra:
|
||||||
self.all_extra = True
|
|
||||||
else:
|
|
||||||
for m in modules if modules is not None else []:
|
for m in modules if modules is not None else []:
|
||||||
self.mod_list.append(
|
self.mod_list.append(
|
||||||
"qt.qt{0}.{1}.{2}.{3}".format(
|
"qt.qt{0}.{1}.{2}.{3}".format(
|
||||||
|
|||||||
Reference in New Issue
Block a user