diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-08-25 10:18:33 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-09-28 12:54:53 +0200 |
commit | edbb8286146920583087080809f6e904ca856cc9 (patch) | |
tree | 0a7b3bf4c207707a211e66c45bafec7fab579e07 /src/hydrilla/proxy/state.py | |
parent | f1204084f5fd377e66f15b3f23e81e13a063512e (diff) | |
download | haketilo-hydrilla-edbb8286146920583087080809f6e904ca856cc9.tar.gz haketilo-hydrilla-edbb8286146920583087080809f6e904ca856cc9.zip |
[proxy] make package version info page also display other versions; fix&improve some aspects of package loading and dependency recomputing
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]): |