Skip to content
config.pyi 758 B
Newer Older
Dom Sekotill's avatar
Dom Sekotill committed
from argparse import Namespace
from collections.abc import Iterable
from collections.abc import Sequence
from configparser import SectionProxy
from pathlib import Path
from typing import NamedTuple
from typing import Union

from typing_extensions import Self

__all__ = [
	'CONFIG_FILES',
	'LOG_FORMAT',
	'SERVERS',
	'Config',
	'from_args',
]

CONFIG_FILES: Sequence[Path]
LOG_FORMAT: str
SERVERS: dict[str, dict[str, str]]


class Config(NamedTuple):

	host: str
	port: int
	passwd: Union[str, None] = None

	@classmethod
	def from_string(cls) -> Self: ...

	@classmethod
	def from_config_section(cls, section: SectionProxy) -> Self: ...


def load(config_files: Union[Path, Iterable[Path]] = ...) -> None: ...
def from_args(args: Namespace) -> Config: ...