From 3d0d352c3bd02bba9b0fd01a427499a70427c7e3 Mon Sep 17 00:00:00 2001 From: Alexandre 'Kidev' Poumaroux <1204936+Kidev@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:26:42 +0100 Subject: [PATCH] Fix types --- aqt/installer.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/aqt/installer.py b/aqt/installer.py index b245692e..5a18ed5e 100644 --- a/aqt/installer.py +++ b/aqt/installer.py @@ -1082,14 +1082,13 @@ def _make_list_tool_parser(self, subparsers: argparse._SubParsersAction): ) list_parser.set_defaults(func=self.run_list_tool) - def _make_common_parsers(self, subparsers: argparse._SubParsersAction): + def _make_common_parsers(self, subparsers: argparse._SubParsersAction) -> None: help_parser = subparsers.add_parser("help") help_parser.set_defaults(func=self.show_help) - # version_parser = subparsers.add_parser("version") version_parser.set_defaults(func=self.show_aqt_version) - def _set_common_options(self, subparser: argparse._SubParsersAction) -> None: + def _set_common_options(self, subparser: argparse.ArgumentParser) -> None: subparser.add_argument( "-O", "--outputdir", @@ -1469,13 +1468,13 @@ class CommercialInstaller: def __init__( self, target: str, - arch: str, - version: str, + arch: Optional[str], + version: Optional[str], username: Optional[str] = None, password: Optional[str] = None, output_dir: Optional[str] = None, logger: Optional[Logger] = None, - timeout: int = 10, + timeout: Optional[float] = None, base_url: str = "https://download.qt.io", operation_does_not_exist_error="Ignore", overwrite_target_dir: str = "Yes", @@ -1486,13 +1485,13 @@ def __init__( telemetry: str = "No", ): self.target = target - self.arch = arch - self.version = Version(version) + self.arch = arch or "" + self.version = Version(version) if version else Version() self.username = username self.password = password self.output_dir = output_dir self.logger = logger or getLogger(__name__) - self.timeout = timeout + self.timeout = int(timeout) if timeout else 5 self.base_url = base_url self.operation_does_not_exist_error = operation_does_not_exist_error