mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 15:36:44 +00:00
fe9c1261a0
Signed-off-by: Karako <karakohear@gmail.com>
35 lines
840 B
Python
35 lines
840 B
Python
from logging import Filter, LogRecord
|
|
from pathlib import Path
|
|
from types import TracebackType
|
|
from typing import Any, Callable, Dict, Optional, Tuple, Type, Union
|
|
|
|
from httpx import URL
|
|
from pydantic import ConstrainedInt
|
|
|
|
__all__ = [
|
|
"StrOrPath",
|
|
"StrOrURL",
|
|
"StrOrInt",
|
|
"SysExcInfoType",
|
|
"ExceptionInfoType",
|
|
"JSONDict",
|
|
"JSONType",
|
|
"LogFilterType",
|
|
"NaturalNumber",
|
|
]
|
|
|
|
StrOrPath = Union[str, Path]
|
|
StrOrURL = Union[str, URL]
|
|
StrOrInt = Union[str, int]
|
|
|
|
SysExcInfoType = Union[Tuple[Type[BaseException], BaseException, Optional[TracebackType]], Tuple[None, None, None]]
|
|
ExceptionInfoType = Union[bool, SysExcInfoType, BaseException]
|
|
JSONDict = Dict[str, Any]
|
|
JSONType = Union[JSONDict, list]
|
|
|
|
LogFilterType = Union[Filter, Callable[[LogRecord], int]]
|
|
|
|
|
|
class NaturalNumber(ConstrainedInt):
|
|
ge = 0
|