1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
from io import StringIO as TextIO
from io import BytesIO as BytesIO
from typing import Any, AnyStr, Callable, Generic, IO, List, Optional, Text, Tuple, TypeVar, Union, overload
from typing_extensions import Final
import sys
_T = TypeVar("_T")
class FDCapture(Generic[AnyStr]):
def __init__(self, targetfd: int, tmpfile: Optional[IO[AnyStr]] = ..., now: bool = ..., patchsys: bool = ...) -> None: ...
def start(self) -> None: ...
def done(self) -> IO[AnyStr]: ...
def writeorg(self, data: AnyStr) -> None: ...
class StdCaptureFD:
def __init__(
self,
out: Union[bool, IO[str]] = ...,
err: Union[bool, IO[str]] = ...,
mixed: bool = ...,
in_: bool = ...,
patchsys: bool = ...,
now: bool = ...,
) -> None: ...
@classmethod
def call(cls, func: Callable[..., _T], *args: Any, **kwargs: Any) -> Tuple[_T, str, str]: ...
def reset(self) -> Tuple[str, str]: ...
def suspend(self) -> Tuple[str, str]: ...
def startall(self) -> None: ...
def resume(self) -> None: ...
def done(self, save: bool = ...) -> Tuple[IO[str], IO[str]]: ...
def readouterr(self) -> Tuple[str, str]: ...
class StdCapture:
def __init__(
self,
out: Union[bool, IO[str]] = ...,
err: Union[bool, IO[str]] = ...,
in_: bool = ...,
mixed: bool = ...,
now: bool = ...,
) -> None: ...
@classmethod
def call(cls, func: Callable[..., _T], *args: Any, **kwargs: Any) -> Tuple[_T, str, str]: ...
def reset(self) -> Tuple[str, str]: ...
def suspend(self) -> Tuple[str, str]: ...
def startall(self) -> None: ...
def resume(self) -> None: ...
def done(self, save: bool = ...) -> Tuple[IO[str], IO[str]]: ...
def readouterr(self) -> Tuple[IO[str], IO[str]]: ...
# XXX: The type here is not exactly right. If f is IO[bytes] and
# encoding is not None, returns some weird hybrid, not exactly IO[bytes].
def dupfile(
f: IO[AnyStr],
mode: Optional[str] = ...,
buffering: int = ...,
raising: bool = ...,
encoding: Optional[str] = ...,
) -> IO[AnyStr]: ...
def get_terminal_width() -> int: ...
def ansi_print(
text: Union[str, Text],
esc: Union[Union[str, Text], Tuple[Union[str, Text], ...]],
file: Optional[IO[Any]] = ...,
newline: bool = ...,
flush: bool = ...,
) -> None: ...
def saferepr(obj, maxsize: int = ...) -> str: ...
class TerminalWriter:
stringio: TextIO
encoding: Final[str]
hasmarkup: bool
def __init__(self, file: Optional[IO[str]] = ..., stringio: bool = ..., encoding: Optional[str] = ...) -> None: ...
@property
def fullwidth(self) -> int: ...
@fullwidth.setter
def fullwidth(self, value: int) -> None: ...
@property
def chars_on_current_line(self) -> int: ...
@property
def width_of_current_line(self) -> int: ...
def markup(
self,
text: str,
*,
black: int = ..., red: int = ..., green: int = ..., yellow: int = ..., blue: int = ..., purple: int = ...,
cyan: int = ..., white: int = ..., Black: int = ..., Red: int = ..., Green: int = ..., Yellow: int = ...,
Blue: int = ..., Purple: int = ..., Cyan: int = ..., White: int = ..., bold: int = ..., light: int = ...,
blink: int = ..., invert: int = ...,
) -> str: ...
def sep(
self,
sepchar: str,
title: Optional[str] = ...,
fullwidth: Optional[int] = ...,
*,
black: int = ..., red: int = ..., green: int = ..., yellow: int = ..., blue: int = ..., purple: int = ...,
cyan: int = ..., white: int = ..., Black: int = ..., Red: int = ..., Green: int = ..., Yellow: int = ...,
Blue: int = ..., Purple: int = ..., Cyan: int = ..., White: int = ..., bold: int = ..., light: int = ...,
blink: int = ..., invert: int = ...,
) -> None: ...
def write(
self,
msg: str,
*,
black: int = ..., red: int = ..., green: int = ..., yellow: int = ..., blue: int = ..., purple: int = ...,
cyan: int = ..., white: int = ..., Black: int = ..., Red: int = ..., Green: int = ..., Yellow: int = ...,
Blue: int = ..., Purple: int = ..., Cyan: int = ..., White: int = ..., bold: int = ..., light: int = ...,
blink: int = ..., invert: int = ...,
) -> None: ...
def line(
self,
s: str = ...,
*,
black: int = ..., red: int = ..., green: int = ..., yellow: int = ..., blue: int = ..., purple: int = ...,
cyan: int = ..., white: int = ..., Black: int = ..., Red: int = ..., Green: int = ..., Yellow: int = ...,
Blue: int = ..., Purple: int = ..., Cyan: int = ..., White: int = ..., bold: int = ..., light: int = ...,
blink: int = ..., invert: int = ...,
) -> None: ...
def reline(
self,
line: str,
*,
black: int = ..., red: int = ..., green: int = ..., yellow: int = ..., blue: int = ..., purple: int = ...,
cyan: int = ..., white: int = ..., Black: int = ..., Red: int = ..., Green: int = ..., Yellow: int = ...,
Blue: int = ..., Purple: int = ..., Cyan: int = ..., White: int = ..., bold: int = ..., light: int = ...,
blink: int = ..., invert: int = ...,
) -> None: ...
|