feat(typing): More types, cleaner structure
This commit is contained in:
+4
-1
@@ -64,7 +64,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
},
|
||||
"reflector": {
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ArchMgrConfig(TypedDict):
|
||||
pkgs: ArchMgrPkgConfig
|
||||
users: list[ArchMgrUserConfig]
|
||||
|
||||
|
||||
class ArchMgrPkgConfig(TypedDict):
|
||||
individual: list[str]
|
||||
bundles: list[object] # TODO: Better typing
|
||||
repos: object # TODO: Repo typing
|
||||
|
||||
|
||||
class ArchMgrUserConfig(TypedDict):
|
||||
username: str
|
||||
groups: list[str]
|
||||
home_dir: bool
|
||||
|
||||
|
||||
class ArchMgrBootConfig(TypedDict):
|
||||
bootloader: str
|
||||
esp_dir: str
|
||||
theme_folder: str
|
||||
os_prober: bool
|
||||
|
||||
|
||||
class ArchMgrThemeConfig(TypedDict):
|
||||
gtk: str
|
||||
qt: str
|
||||
font: str
|
||||
icon_theme: str
|
||||
cursor_theme: str
|
||||
|
||||
|
||||
class ArchMgrGitConfig(TypedDict):
|
||||
creds: object # TODO:
|
||||
repos: object # TODO
|
||||
|
||||
|
||||
class ArchMgrGitRepoConfig(TypedDict):
|
||||
clone_path: str
|
||||
url: str
|
||||
|
||||
|
||||
class ArchMgrCmdsConfig(TypedDict):
|
||||
always: ArchMgrCommand
|
||||
once: ArchMgrCommand
|
||||
|
||||
|
||||
class ArchMgrCommand(TypedDict):
|
||||
cmd: str
|
||||
name: Optional[str]
|
||||
capture_output: Optional[bool]
|
||||
hook: Optional[str]
|
||||
user: Optional[str]
|
||||
@@ -0,0 +1,9 @@
|
||||
from typing import TypedDict
|
||||
|
||||
from config.dtype.others import ArchMgrUserConfig
|
||||
from config.dtype.pkgs import ArchMgrPkgConfig
|
||||
|
||||
|
||||
class ArchMgrConfig(TypedDict):
|
||||
pkgs: ArchMgrPkgConfig
|
||||
users: list[ArchMgrUserConfig]
|
||||
@@ -0,0 +1,14 @@
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ArchMgrCmdsConfig(TypedDict):
|
||||
always: ArchMgrCommand
|
||||
once: ArchMgrCommand
|
||||
|
||||
|
||||
class ArchMgrCommand(TypedDict):
|
||||
cmd: str
|
||||
name: Optional[str]
|
||||
capture_output: Optional[bool]
|
||||
hook: Optional[str]
|
||||
user: Optional[str]
|
||||
@@ -0,0 +1,11 @@
|
||||
from typing import TypedDict
|
||||
|
||||
|
||||
class ArchMgrGitConfig(TypedDict):
|
||||
creds: dict # TODO:
|
||||
repos: dict # TODO
|
||||
|
||||
|
||||
class ArchMgrGitRepoConfig(TypedDict):
|
||||
clone_path: str
|
||||
url: str
|
||||
@@ -0,0 +1,22 @@
|
||||
from typing import TypedDict
|
||||
|
||||
|
||||
class ArchMgrUserConfig(TypedDict):
|
||||
username: str
|
||||
groups: list[str]
|
||||
home_dir: bool
|
||||
|
||||
|
||||
class ArchMgrBootConfig(TypedDict):
|
||||
bootloader: str
|
||||
esp_dir: str
|
||||
theme_folder: str
|
||||
os_prober: bool
|
||||
|
||||
|
||||
class ArchMgrThemeConfig(TypedDict):
|
||||
gtk: str
|
||||
qt: str
|
||||
font: str
|
||||
icon_theme: str
|
||||
cursor_theme: str
|
||||
@@ -0,0 +1,35 @@
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class ArchMgrPkgConfig(TypedDict):
|
||||
individual: list[str]
|
||||
bundles: list[ArchMgrBundleConfig]
|
||||
repos: ArchMgrRepoSettings
|
||||
|
||||
|
||||
class ArchMgrReposConfig(TypedDict):
|
||||
enabled_repos: list[ArchMgrRepoSettings]
|
||||
reflector: ArchMgrReflectorConfig
|
||||
|
||||
|
||||
class ArchMgrReflectorConfig(TypedDict):
|
||||
enabled: bool
|
||||
interval: Optional[int]
|
||||
countries: Optional[list[str]]
|
||||
count: Optional[int]
|
||||
|
||||
|
||||
class ArchMgrBundleConfig(TypedDict):
|
||||
name: str
|
||||
ignored_pkgs: Optional[list[str]]
|
||||
|
||||
|
||||
class ArchMgrRepoSettings(TypedDict):
|
||||
name: str
|
||||
setup_cmds: Optional[list[str]]
|
||||
mirrors: ArchMgrRepoMirrors
|
||||
|
||||
|
||||
class ArchMgrRepoMirrors(TypedDict):
|
||||
use_default: bool
|
||||
extra_mirrors: Optional[list[str]]
|
||||
Reference in New Issue
Block a user