1 from typing import Any, Callable, Iterator, IO, List, Optional, TypeVar, Union, Text
\r
4 _Decorator = Callable[[_T], _T]
\r
7 def _posixify(name: str) -> str:
\r
11 def safecall(func: _T) -> _T:
\r
15 def make_str(value: Any) -> str:
\r
19 def make_default_short_help(help: str, max_length: int = ...):
\r
26 encoding: Optional[str]
\r
34 encoding: Optional[str] = ...,
\r
40 def open(self) -> IO:
\r
43 def close(self) -> None:
\r
46 def close_intelligently(self) -> None:
\r
49 def __enter__(self) -> 'LazyFile':
\r
52 def __exit__(self, exc_type, exc_value, tb):
\r
55 def __iter__(self) -> Iterator:
\r
62 def __init__(self, file: IO) -> None:
\r
65 def __enter__(self) -> 'KeepOpenFile':
\r
68 def __exit__(self, exc_type, exc_value, tb):
\r
71 def __iter__(self) -> Iterator:
\r
76 message: Optional[Union[bytes, Text]] = ...,
\r
77 file: Optional[IO] = ...,
\r
80 color: Optional[bool] = ...,
\r
85 def get_binary_stream(name: str) -> IO[bytes]:
\r
89 def get_text_stream(
\r
90 name: str, encoding: Optional[str] = ..., errors: str = ...
\r
98 encoding: Optional[str] = ...,
\r
102 ) -> Union[IO, LazyFile, KeepOpenFile]:
\r
106 def get_os_args() -> List[str]:
\r
110 def format_filename(filename: str, shorten: bool = ...) -> str:
\r
115 app_name: str, roaming: bool = ..., force_posix: bool = ...
\r