1
0
Fork 0
mirror of synced 2024-07-02 21:20:54 +12:00
Rare/rare/utils/models.py
2021-08-17 17:35:02 +02:00

41 lines
1.1 KiB
Python

import os
from dataclasses import field, dataclass
from multiprocessing import Queue
from custom_legendary.downloader.manager import DLManager
from custom_legendary.models.downloading import AnalysisResult, ConditionCheckResult
from custom_legendary.models.game import Game, InstalledGame
@dataclass
class InstallOptionsModel:
app_name: str
base_path: str = os.path.expanduser("~/legendary")
max_workers: int = os.cpu_count() * 2
repair: bool = False
no_install: bool = False
ignore_space_req: bool = False
force: bool = False
sdl_list: list = field(default_factory=lambda: [''])
@dataclass
class InstallDownloadModel:
dlmanager: DLManager
analysis: AnalysisResult
game: Game
igame: InstalledGame
repair: bool
repair_file: str
res: ConditionCheckResult
@dataclass
class InstallQueueItemModel:
status_q: Queue = None
download: InstallDownloadModel = None
options: InstallOptionsModel = None
def __bool__(self):
return (self.status_q is not None) and (self.download is not None) and (self.options is not None)