Files
typeshed/stubs/python-crontab/cronlog.pyi
kasium a9236f9cc9 Add stubs for python-cronlog (#8917)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-10-19 18:06:55 -07:00

33 lines
1.1 KiB
Python

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]: ...