mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
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:
32
stubs/python-crontab/cronlog.pyi
Normal file
32
stubs/python-crontab/cronlog.pyi
Normal 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]: ...
|
||||
Reference in New Issue
Block a user