From 2bf41f20d18bfa06b5fd4db88f1ae5e5f442b960 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Fri, 15 Jul 2022 21:00:52 +0300 Subject: [PATCH] Lgndr: Match the arguments of legendary's get_boolean_choice --- .../tabs/games/import_sync/import_group.py | 2 +- rare/lgndr/api_arguments.py | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/rare/components/tabs/games/import_sync/import_group.py b/rare/components/tabs/games/import_sync/import_group.py index 3e276367..9654f6f6 100644 --- a/rare/components/tabs/games/import_sync/import_group.py +++ b/rare/components/tabs/games/import_sync/import_group.py @@ -103,7 +103,7 @@ class ImportWorker(QRunnable): args = LgndrImportGameArgs( app_path=str(path), app_name=app_name, - get_boolean_choice=lambda a0: self.import_dlcs + get_boolean_choice=lambda prompt, default=True: self.import_dlcs ) try: cli.import_game(args) diff --git a/rare/lgndr/api_arguments.py b/rare/lgndr/api_arguments.py index d1328ccd..273624ab 100644 --- a/rare/lgndr/api_arguments.py +++ b/rare/lgndr/api_arguments.py @@ -25,7 +25,16 @@ class LgndrImportGameArgs: with_dlcs: bool = False yes: bool = False # Rare: Extra arguments - get_boolean_choice: Callable[[str], bool] = lambda a0: False + get_boolean_choice: Callable[[str, bool], bool] = lambda prompt, default=True: default + + +@dataclass +class LgndrUninstallGameArgs: + app_name: str + keep_files: bool = False + yes: bool = False + # Rare: Extra arguments + get_boolean_choice: Callable[[str, bool], bool] = lambda prompt, default=True: default @dataclass @@ -70,8 +79,8 @@ class LgndrInstallGameArgs: disable_https: bool = False yes: bool = True # Rare: Extra arguments - get_boolean_choice: Callable[[str], bool] = lambda a0: False - sdl_prompt: Callable[[str, str], List[str]] = lambda a0, a1: [] + get_boolean_choice: Callable[[str, bool], bool] = lambda prompt, default=True: default + sdl_prompt: Callable[[str, str], List[str]] = lambda sdl_data, title: [""] verify_stdout: Callable[[int, int, float, float], None] = lambda a0, a1, a2, a3: print( f"Verification progress: {a0}/{a1} ({a2:.01f}%) [{a3:.1f} MiB/s]\t\r" )