@@ -28,7 +28,7 @@ See: http://en.wikipedia.org/wiki/ANSI_escape_code
28
28
# Based on colorama
29
29
# https://github.com/tartley/colorama
30
30
# Copyright Jonathan Hartley 2013
31
- # Distrubuted under the BSD 3-Clause license.
31
+ # Distributed under the BSD 3-Clause license.
32
32
# | Redistribution and use in source and binary forms, with or without
33
33
# | modification, are permitted provided that the following conditions are met:
34
34
# |
@@ -64,13 +64,13 @@ from typing import List
64
64
# 3rd party
65
65
from typing_extensions import Final
66
66
67
- CSI : Final [str ] = ' \033 ['
68
- OSC : Final [str ] = ' \033 ]'
69
- BEL : Final [str ] = ' \a '
67
+ CSI : Final [str ]
68
+ OSC : Final [str ]
69
+ BEL : Final [str ]
70
70
71
- fore_stack : List [str ] = []
72
- back_stack : List [str ] = []
73
- style_stack : List [str ] = []
71
+ fore_stack : List [str ]
72
+ back_stack : List [str ]
73
+ style_stack : List [str ]
74
74
75
75
76
76
def code_to_chars (code ) -> str : ...
@@ -79,6 +79,9 @@ def clear_screen(mode: int = 2) -> str: ...
79
79
def clear_line (mode : int = 2 ) -> str : ...
80
80
81
81
82
+ def strip_ansi (value : str ) -> str : ...
83
+
84
+
82
85
class Colour (str ):
83
86
style : str
84
87
reset : str
@@ -134,8 +137,8 @@ class AnsiFore(AnsiCodes):
134
137
135
138
class AnsiBack (AnsiCodes ):
136
139
137
- _stack = back_stack
138
- _reset = " \033 [49m"
140
+ _stack : List [ str ]
141
+ _reset : str
139
142
140
143
BLACK : Colour
141
144
RED : Colour
@@ -160,8 +163,8 @@ class AnsiBack(AnsiCodes):
160
163
161
164
class AnsiStyle (AnsiCodes ):
162
165
163
- _stack = style_stack
164
- _reset = " \033 [22m"
166
+ _stack : List [ str ]
167
+ _reset : str
165
168
166
169
BRIGHT : Colour
167
170
DIM : Colour
@@ -173,7 +176,3 @@ Fore = AnsiFore()
173
176
Back = AnsiBack ()
174
177
Style = AnsiStyle ()
175
178
Cursor = AnsiCursor ()
176
-
177
- fore_stack .append (Fore .RESET )
178
- back_stack .append (Back .RESET )
179
- style_stack .append (Style .NORMAL )
0 commit comments