diff options
Diffstat (limited to 'src/hydrilla/proxy/state.py')
-rw-r--r-- | src/hydrilla/proxy/state.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/hydrilla/proxy/state.py b/src/hydrilla/proxy/state.py index 0e45725..e5c7bd7 100644 --- a/src/hydrilla/proxy/state.py +++ b/src/hydrilla/proxy/state.py @@ -56,14 +56,10 @@ class EnabledStatus(Enum): DISABLED - User wished to never apply given mapping. - AUTO_ENABLED - User has not configured given mapping but it will still be - used when automatic application of mappings is turned on. - NO_MARK - User has not configured given mapping and it won't be used. """ ENABLED = 'E' DISABLED = 'D' - AUTO_ENABLED = 'A' NO_MARK = 'N' @@ -84,6 +80,20 @@ class InstalledStatus(Enum): FAILED_TO_INSTALL = 'F' +class ActiveStatus(Enum): + """ + REQUIRED - Mapping version got active to fulfill a requirement of some (this + or another) explicitly enabled mapping. + + AUTO - Mapping version was activated automatically. + + NOT_ACTIVE - Mapping version is not currently being used. + """ + REQUIRED = 'R' + AUTO = 'A' + NOT_ACTIVE = 'N' + + @dc.dataclass(frozen=True, unsafe_hash=True) class Ref: """....""" @@ -188,18 +198,17 @@ class RepoIterationRef(Ref): @dc.dataclass(frozen=True) class MappingDisplayInfo: - ref: 'MappingRef' - identifier: str - enabled: EnabledStatus - active_version_ref: t.Optional['MappingVersionRef'] - active_version_info: t.Optional[item_infos.MappingInfo] + ref: 'MappingRef' + identifier: str + enabled: EnabledStatus + active_version: t.Optional['MappingVersionDisplayInfo'] @dc.dataclass(frozen=True) class MappingVersionDisplayInfo: ref: 'MappingVersionRef' info: item_infos.MappingInfo installed: InstalledStatus - is_active: bool + active: ActiveStatus is_orphan: bool is_local: bool mapping_enabled: EnabledStatus @@ -231,7 +240,8 @@ class MappingVersionRef(Ref): ... @abstractmethod - def get_display_info(self) -> MappingVersionDisplayInfo: + def get_all_version_display_infos(self) \ + -> t.Sequence[MappingVersionDisplayInfo]: ... class MappingVersionStore(Store[MappingVersionRef]): |