feat: add -Swp option
perf: tar.extractall wrapped in asyncio.to_thread
This commit is contained in:
parent
aa147792e6
commit
efc2abf858
2
setup.py
2
setup.py
@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text()
|
||||
|
||||
setup(
|
||||
name='worthless',
|
||||
version='2.1.0',
|
||||
version='2.1.0-1',
|
||||
packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'],
|
||||
url='https://git.froggi.es/tretrauit/worthless-launcher',
|
||||
license='MIT License',
|
||||
|
@ -274,6 +274,8 @@ async def main():
|
||||
help="Update the game and specified voiceover pack only (or install if not found)")
|
||||
parser.add_argument("-Sw", "--download-game", action="store_true",
|
||||
help="Download the full game to the temporary directory")
|
||||
parser.add_argument("-Swp", "--download-patch", action="store_true",
|
||||
help="Download/Update the game patch to the temporary directory")
|
||||
parser.add_argument("-Swv", "--download-voiceover", action="store", type=str,
|
||||
help="Download the full voiceover to the temporary directory")
|
||||
parser.add_argument("-Syw", "--download-game-update", action="store", type=str, default="",
|
||||
@ -330,6 +332,9 @@ async def main():
|
||||
if args.download_game:
|
||||
await ui.download_game()
|
||||
|
||||
if args.download_patch:
|
||||
await ui.download_patch()
|
||||
|
||||
if args.download_voiceover:
|
||||
await ui.download_voiceover(args.download_voiceover)
|
||||
|
||||
|
@ -95,8 +95,8 @@ class Patcher:
|
||||
if not archive:
|
||||
raise RuntimeError("Cannot download patch repository")
|
||||
|
||||
with tarfile.open(archive) as tar:
|
||||
tar.extractall(self._patch_path)
|
||||
async with tarfile.open(archive) as tar:
|
||||
await asyncio.to_thread(tar.extractall, self._patch_path)
|
||||
|
||||
def override_patch_url(self, url) -> None:
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user