diff --git a/rare/components/dialogs/install_dialog.py b/rare/components/dialogs/install_dialog.py index 17965aba..c1dff40a 100644 --- a/rare/components/dialogs/install_dialog.py +++ b/rare/components/dialogs/install_dialog.py @@ -332,7 +332,7 @@ class InstallInfoWorker(QRunnable): order_opt=self.dl_item.options.order_opt, # dl_timeout=, repair_mode=self.dl_item.options.repair_mode, - # repair_and_update=True, + repair_and_update=self.dl_item.options.repair_and_update, ignore_space=self.dl_item.options.ignore_space, # disable_delta=, # override_delta_manifest=, diff --git a/rare/lgndr/api_arguments.py b/rare/lgndr/api_arguments.py index 9dd0c1d5..b3ce7d02 100644 --- a/rare/lgndr/api_arguments.py +++ b/rare/lgndr/api_arguments.py @@ -4,7 +4,7 @@ from typing import Callable, List from .api_monkeys import get_boolean_choice - +""" @dataclass(kw_only=True) class LgndrCommonArgs: # keep this here for future reference @@ -12,6 +12,7 @@ class LgndrCommonArgs: app_name: str platform: str = "Windows" yes: bool = False +""" @dataclass diff --git a/rare/lgndr/cli.py b/rare/lgndr/cli.py index fde08990..643b8f79 100644 --- a/rare/lgndr/cli.py +++ b/rare/lgndr/cli.py @@ -2,10 +2,9 @@ import functools import os import logging import time -from typing import Optional, Union, overload +from typing import Optional, Union import legendary.cli -from PyQt5.QtWidgets import QLabel, QMessageBox from legendary.cli import logger from legendary.models.downloading import AnalysisResult, ConditionCheckResult from legendary.models.game import Game, InstalledGame, VerifyResult @@ -16,7 +15,7 @@ from .core import LegendaryCore from .manager import DLManager from .api_arguments import LgndrInstallGameArgs, LgndrImportGameArgs, LgndrVerifyGameArgs from .api_exception import LgndrException, LgndrLogHandler -from .api_monkeys import return_exit, get_boolean_choice +from .api_monkeys import return_exit as exit, get_boolean_choice class LegendaryCLI(legendary.cli.LegendaryCLI): @@ -36,7 +35,7 @@ class LegendaryCLI(legendary.cli.LegendaryCLI): @functools.wraps(func) def inner(self, args, *oargs, **kwargs): old_exit = legendary.cli.exit - legendary.cli.exit = return_exit + legendary.cli.exit = exit old_choice = legendary.cli.get_boolean_choice if hasattr(args, 'get_boolean_choice') and args.get_boolean_choice is not None: @@ -64,6 +63,7 @@ class LegendaryCLI(legendary.cli.LegendaryCLI): args.repair_mode = True repair_file = None + # Rare: The 'args.no_install' flags is set externally from the InstallDialog if args.repair_mode: args.repair_mode = True args.no_install = args.repair_and_update is False @@ -230,6 +230,7 @@ class LegendaryCLI(legendary.cli.LegendaryCLI): def uninstall_game(self, args): super(LegendaryCLI, self).uninstall_game(args) + @wrapped def verify_game(self, args: Union[LgndrVerifyGameArgs, LgndrInstallGameArgs], print_command=True, repair_mode=False, repair_online=False): args.app_name = self._resolve_aliases(args.app_name) if not self.core.is_installed(args.app_name): diff --git a/rare/utils/models.py b/rare/utils/models.py index 6a20e06a..926e031b 100644 --- a/rare/utils/models.py +++ b/rare/utils/models.py @@ -17,6 +17,7 @@ class InstallOptionsModel: shared_memory: int = 1024 max_workers: int = os.cpu_count() * 2 repair_mode: bool = False + repair_and_update: bool = False no_install: bool = False ignore_space: bool = False force: bool = False