2021-03-09 05:20:28 +13:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
2021-05-23 07:56:13 +12:00
|
|
|
class InstallOptionsModel:
|
2021-05-24 00:52:39 +12:00
|
|
|
def __init__(self, app_name: str, base_path: str = os.path.expanduser("~/legendary"),
|
|
|
|
max_workers: int = os.cpu_count() * 2, repair: bool = False, no_install: bool = False,
|
2021-05-24 00:15:36 +12:00
|
|
|
ignore_space_req: bool = False, force: bool = False, sdl_list: list = ['']
|
2021-05-21 09:00:38 +12:00
|
|
|
):
|
2021-03-09 05:20:28 +13:00
|
|
|
self.app_name = app_name
|
2021-05-24 00:52:39 +12:00
|
|
|
self.base_path = base_path
|
2021-03-09 05:20:28 +13:00
|
|
|
self.max_workers = max_workers
|
|
|
|
self.repair = repair
|
2021-05-24 00:52:39 +12:00
|
|
|
self.no_install = no_install
|
2021-05-24 00:15:36 +12:00
|
|
|
self.ignore_space_req = ignore_space_req
|
2021-04-05 21:53:33 +12:00
|
|
|
self.force = force
|
2021-05-22 02:48:15 +12:00
|
|
|
self.sdl_list = sdl_list
|
2021-05-23 07:56:13 +12:00
|
|
|
|
|
|
|
|
|
|
|
class InstallDownloadModel:
|
2021-05-24 00:15:36 +12:00
|
|
|
def __init__(self, dlmanager, analysis, game, igame, repair: bool, repair_file: str):
|
2021-05-23 07:56:13 +12:00
|
|
|
self.dlmanager = dlmanager
|
|
|
|
self.analysis = analysis
|
|
|
|
self.game = game
|
|
|
|
self.igame = igame
|
|
|
|
self.repair = repair
|
|
|
|
self.repair_file = repair_file
|
|
|
|
|
|
|
|
|
|
|
|
class InstallQueueItemModel:
|
2021-05-24 00:15:36 +12:00
|
|
|
def __init__(self, status_q=None, download: InstallDownloadModel = None, options: InstallOptionsModel = None):
|
|
|
|
self.status_q = status_q
|
2021-05-23 07:56:13 +12:00
|
|
|
self.download = download
|
|
|
|
self.options = options
|
2021-05-24 00:15:36 +12:00
|
|
|
|
|
|
|
def __bool__(self):
|
|
|
|
return (self.status_q is not None) and (self.download is not None) and (self.options is not None)
|