Add stubs for python-cronlog (#8917)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
kasium
2022-10-20 03:06:55 +02:00
committed by GitHub
parent de68029716
commit a9236f9cc9
5 changed files with 292 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
from _typeshed import Self, StrOrBytesPath
from codecs import StreamReaderWriter
from collections.abc import Generator, Iterator
from types import TracebackType
MATCHER: str
class LogReader:
filename: StrOrBytesPath
mass: int
size: int
read: int
pipe: StreamReaderWriter | None
def __init__(self, filename: StrOrBytesPath, mass: int = ...) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, error_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def readlines(self, until: int = ...) -> Generator[tuple[int, str], None, None]: ...
class CronLog(LogReader):
user: str | None
def __init__(self, filename: StrOrBytesPath = ..., user: str | None = ...) -> None: ...
def for_program(self, command: str) -> ProgramLog: ...
def __iter__(self) -> dict[str, str | None]: ... # type: ignore[override]
class ProgramLog:
log: CronLog
command: str
def __init__(self, log: CronLog, command: str) -> None: ...
def __iter__(self) -> dict[str, str | None]: ...