feature: added more Enum classes useful for type checking and renamed others

This commit is contained in:
2026-01-21 09:19:46 -05:00
parent 57cf9d197d
commit 73472cb073

View File

@@ -2,19 +2,79 @@
Library of custom type hints.
"""
from typing import TypeAlias as Neotype
from pathlib import PurePosixPath, PureWindowsPath, PosixPath, WindowsPath
from enum import Enum
from typing import TypeAlias as Neotype, TypedDict as Dict
from typing import Required
from collections.abc import Sequence
from pathlib import Path, PurePath, PurePosixPath, PureWindowsPath, PosixPath, WindowsPath
from enum import StrEnum, auto
ExecutedPath: Neotype = PosixPath | WindowsPath
IdlePath: Neotype = PurePosixPath | PureWindowsPath
class VirtualPrivateServers(Enum):
Linode = 0
class RootFate(StrEnum):
disposal = auto()
retention = auto()
class AnsibleScopes(Enum):
INTERNAL = 0
INVENTORY = 1
GROUPVARS = 2
HOSTVARS = 3
ROLE = 4
class NodeType(StrEnum):
remote = auto()
control = auto()
class VPS(StrEnum):
Linode = auto()
class VPSRegion(StrEnum):
us_east = auto()
class AnsibleScopes(StrEnum):
INTERNAL = auto()
INVENTORY = auto()
GROUPVARS = auto()
HOSTVARS = auto()
ROLE = auto()
class AnsibleRoles(StrEnum):
bootstrap = auto()
class Scopes(StrEnum):
SYS = auto()
USER = auto()
LOCAL = auto()
PROJ = auto()
SHARED = auto()
class Roles(StrEnum):
CONF = auto()
DATA = auto()
MEM = auto()
EXE = auto()
class UserName(StrEnum):
root = auto()
class GroupName(StrEnum):
remote = auto()
sudo = auto()
class Software(StrEnum):
ssh = auto()
sshd = auto()
class SoftwareRoles(StrEnum):
client = auto()
server = auto()
class PacMans(StrEnum):
APT = auto()
class PathCollection(Dict, total=False):
sys: ExecutedPath | IdlePath | str | Sequence[ExecutedPath | IdlePath | str]
user: ExecutedPath | IdlePath | str | Sequence[ExecutedPath | IdlePath | str]
local: ExecutedPath | IdlePath | str | Sequence[ExecutedPath | IdlePath | str]
proj: ExecutedPath | IdlePath | str | Sequence[ExecutedPath | IdlePath | str]
shared: ExecutedPath | IdlePath | str | Sequence[ExecutedPath | IdlePath | str]
class PathRoles(Dict, total=False):
conf: PathCollection
data: PathCollection
mem: PathCollection
exe: PathCollection