aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-08-24 10:47:33 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-28 12:54:53 +0200
commitd516b9decad07b940b3cd117fc4e353dd8bbe7d2 (patch)
tree2ab6f78e067d88a9dce1043e496b1d5af283464b /src/hydrilla/proxy/state.py
parent964bd44649aaf03c9afea06eadad0443032d8b77 (diff)
downloadhaketilo-hydrilla-d516b9decad07b940b3cd117fc4e353dd8bbe7d2.tar.gz
haketilo-hydrilla-d516b9decad07b940b3cd117fc4e353dd8bbe7d2.zip
make repo packages (mappings) load as uninstalled; make them installable through the web UI
Diffstat (limited to 'src/hydrilla/proxy/state.py')
-rw-r--r--src/hydrilla/proxy/state.py20
1 files changed, 16 insertions, 4 deletions
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