1 from types import TracebackType
2 from typing import IO, Any, AnyStr, Generic, Iterator, Text, Type, TypeVar
6 def _posixify(name: str) -> str: ...
7 def safecall(func: _T) -> _T: ...
8 def make_str(value: Any) -> str: ...
9 def make_default_short_help(help: str, max_length: int = ...) -> str: ...
11 class LazyFile(object):
18 self, filename: str, mode: str = ..., encoding: str | None = ..., errors: str = ..., atomic: bool = ...
20 def open(self) -> IO[Any]: ...
21 def close(self) -> None: ...
22 def close_intelligently(self) -> None: ...
23 def __enter__(self) -> LazyFile: ...
25 self, exctype: Type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
27 def __iter__(self) -> Iterator[Any]: ...
29 class KeepOpenFile(Generic[AnyStr]):
31 def __init__(self, file: IO[AnyStr]) -> None: ...
32 def __enter__(self) -> KeepOpenFile[AnyStr]: ...
34 self, exctype: Type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
36 def __iter__(self) -> Iterator[AnyStr]: ...
39 message: object = ..., file: IO[Text] | None = ..., nl: bool = ..., err: bool = ..., color: bool | None = ...
41 def get_binary_stream(name: str) -> IO[bytes]: ...
42 def get_text_stream(name: str, encoding: str | None = ..., errors: str = ...) -> IO[str]: ...
44 filename: str, mode: str = ..., encoding: str | None = ..., errors: str = ..., lazy: bool = ..., atomic: bool = ...
45 ) -> Any: ... # really IO | LazyFile | KeepOpenFile
46 def get_os_args() -> list[str]: ...
47 def format_filename(filename: str, shorten: bool = ...) -> str: ...
48 def get_app_dir(app_name: str, roaming: bool = ..., force_posix: bool = ...) -> str: ...