aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-09-27 13:42:55 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-29 10:47:17 +0200
commit00487547c4aff6bf0c94438768191960a3369365 (patch)
treeb8a27aa19258a27101bc5634e87fa1f9509457f2 /src/hydrilla/proxy/state.py
parentfae35b53a4f63f60f0da96e75a0c2fc310217578 (diff)
downloadhaketilo-hydrilla-00487547c4aff6bf0c94438768191960a3369365.tar.gz
haketilo-hydrilla-00487547c4aff6bf0c94438768191960a3369365.zip
[proxy] facilitate manually pruning orphaned packages (including installed ones)
Diffstat (limited to 'src/hydrilla/proxy/state.py')
-rw-r--r--src/hydrilla/proxy/state.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hydrilla/proxy/state.py b/src/hydrilla/proxy/state.py
index 7613d54..559a546 100644
--- a/src/hydrilla/proxy/state.py
+++ b/src/hydrilla/proxy/state.py
@@ -467,6 +467,7 @@ class MappingUseMode(Enum):
WHEN_ENABLED = 'W'
QUESTION = 'Q'
+
@dc.dataclass(frozen=True)
class HaketiloGlobalSettings:
"""...."""
@@ -481,6 +482,12 @@ class MissingItemError(ValueError):
pass
+@dc.dataclass(frozen=True)
+class OrphanItemsStats:
+ mappings: int
+ resources: int
+
+
class HaketiloState(ABC):
"""...."""
@abstractmethod
@@ -488,6 +495,14 @@ class HaketiloState(ABC):
...
@abstractmethod
+ def count_orphan_items(self) -> OrphanItemsStats:
+ ...
+
+ @abstractmethod
+ def prune_orphan_items(self) -> None:
+ ...
+
+ @abstractmethod
def rule_store(self) -> RuleStore:
...