From d4773bc38d2c6377be1b7a81955487be0bd47f6c Mon Sep 17 00:00:00 2001 From: tretrauit Date: Sat, 25 Jun 2022 02:09:26 +0700 Subject: [PATCH] fix: _ask won't automatically think the answer is yes. I am dumb --- setup.py | 2 +- worthless/cli.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index d726aa5..1483bb0 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text() setup( name='worthless', - version='2.0.0', + version='2.0.1', packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'], url='https://git.froggi.es/tretrauit/worthless-launcher', license='MIT License', diff --git a/worthless/cli.py b/worthless/cli.py index db5e624..6ced00b 100755 --- a/worthless/cli.py +++ b/worthless/cli.py @@ -24,10 +24,10 @@ class UI: # Fake dialog print(question + " [Y/n]:") return True - answer = "" + + # random text + answer = "kurumi3" while answer.lower() not in ['y', 'n', '']: - if answer != "": - print("Invalid choice, please try again.") answer = input(question + " [Y/n]: ") return answer.lower() == 'y' or answer == '' @@ -244,9 +244,9 @@ class UI: print("{}: expected {}, actual {}".format(file[0], file[1], file[2])) async def clear_cache(self): - if self._ask("Do you want to clear Installer cache (contains downloaded game files, etc)"): + if self._ask("Do you want to clear Installer cache (contains downloaded game files, etc)?"): await self._installer.clear_cache() - if self._ask("Do you want to clear Patcher cache (contains files used to patch)"): + if self._ask("Do you want to clear Patcher cache (contains files used to patch)?"): await self._patcher.clear_cache() @@ -322,6 +322,9 @@ async def main(): if args.check_telemetry: await ui.check_telemetry() + if args.clear_cache: + await ui.clear_cache() + # Download if args.download_game: @@ -371,8 +374,6 @@ async def main(): if args.verify: await ui.verify_game() - if args.clear_cache: - await ui.clear_cache() if __name__ == "__main__": asyncio.run(main())