feature: added more Enum classes useful for type checking and renamed others
This commit is contained in:
82
custtypes.py
82
custtypes.py
@@ -2,19 +2,79 @@
|
|||||||
Library of custom type hints.
|
Library of custom type hints.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import TypeAlias as Neotype
|
from typing import TypeAlias as Neotype, TypedDict as Dict
|
||||||
from pathlib import PurePosixPath, PureWindowsPath, PosixPath, WindowsPath
|
from typing import Required
|
||||||
from enum import Enum
|
from collections.abc import Sequence
|
||||||
|
from pathlib import Path, PurePath, PurePosixPath, PureWindowsPath, PosixPath, WindowsPath
|
||||||
|
from enum import StrEnum, auto
|
||||||
|
|
||||||
ExecutedPath: Neotype = PosixPath | WindowsPath
|
ExecutedPath: Neotype = PosixPath | WindowsPath
|
||||||
IdlePath: Neotype = PurePosixPath | PureWindowsPath
|
IdlePath: Neotype = PurePosixPath | PureWindowsPath
|
||||||
|
|
||||||
class VirtualPrivateServers(Enum):
|
class RootFate(StrEnum):
|
||||||
Linode = 0
|
disposal = auto()
|
||||||
|
retention = auto()
|
||||||
|
|
||||||
class AnsibleScopes(Enum):
|
class NodeType(StrEnum):
|
||||||
INTERNAL = 0
|
remote = auto()
|
||||||
INVENTORY = 1
|
control = auto()
|
||||||
GROUPVARS = 2
|
|
||||||
HOSTVARS = 3
|
class VPS(StrEnum):
|
||||||
ROLE = 4
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user