From d516b9decad07b940b3cd117fc4e353dd8bbe7d2 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 24 Aug 2022 10:47:33 +0200 Subject: make repo packages (mappings) load as uninstalled; make them installable through the web UI --- src/hydrilla/proxy/state.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/hydrilla/proxy/state.py') diff --git a/src/hydrilla/proxy/state.py b/src/hydrilla/proxy/state.py index 0c6dff3..0e45725 100644 --- a/src/hydrilla/proxy/state.py +++ b/src/hydrilla/proxy/state.py @@ -47,6 +47,7 @@ from ..exceptions import HaketiloException from ..versions import VerTuple from ..url_patterns import ParsedPattern from .. import item_infos +from .simple_dependency_satisfying import ImpossibleSituation class EnabledStatus(Enum): @@ -112,11 +113,19 @@ class RepoUrlInvalid(HaketiloException): class RepoCommunicationError(HaketiloException): pass -@dc.dataclass -class FileInstallationError(RepoCommunicationError): +@dc.dataclass(frozen=True) +class FileInstallationError(HaketiloException): repo_id: str sha256: str +@dc.dataclass(frozen=True) +class FileIntegrityError(FileInstallationError): + invalid_sha256: str + +@dc.dataclass(frozen=True) +class FileMissingError(FileInstallationError): + pass + class RepoApiVersionUnsupported(HaketiloException): pass @@ -214,8 +223,11 @@ class MappingStore(Store[MappingRef]): class MappingVersionRef(Ref): """....""" @abstractmethod - def update_status(self, new_status: EnabledStatus) -> None: - """....""" + def install(self) -> None: + ... + + @abstractmethod + def uninstall(self) -> None: ... @abstractmethod -- cgit v1.2.3