@@ -28,7 +28,7 @@ See: http://en.wikipedia.org/wiki/ANSI_escape_code
2828# Based on colorama
2929# https://github.com/tartley/colorama
3030# Copyright Jonathan Hartley 2013
31- # Distrubuted under the BSD 3-Clause license.
31+ # Distributed under the BSD 3-Clause license.
3232# | Redistribution and use in source and binary forms, with or without
3333# | modification, are permitted provided that the following conditions are met:
3434# |
@@ -64,13 +64,13 @@ from typing import List
6464# 3rd party
6565from typing_extensions import Final
6666
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 ]
7070
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 ]
7474
7575
7676def code_to_chars (code ) -> str : ...
@@ -79,6 +79,9 @@ def clear_screen(mode: int = 2) -> str: ...
7979def clear_line (mode : int = 2 ) -> str : ...
8080
8181
82+ def strip_ansi (value : str ) -> str : ...
83+
84+
8285class Colour (str ):
8386 style : str
8487 reset : str
@@ -134,8 +137,8 @@ class AnsiFore(AnsiCodes):
134137
135138class AnsiBack (AnsiCodes ):
136139
137- _stack = back_stack
138- _reset = " \033 [49m"
140+ _stack : List [ str ]
141+ _reset : str
139142
140143 BLACK : Colour
141144 RED : Colour
@@ -160,8 +163,8 @@ class AnsiBack(AnsiCodes):
160163
161164class AnsiStyle (AnsiCodes ):
162165
163- _stack = style_stack
164- _reset = " \033 [22m"
166+ _stack : List [ str ]
167+ _reset : str
165168
166169 BRIGHT : Colour
167170 DIM : Colour
@@ -173,7 +176,3 @@ Fore = AnsiFore()
173176Back = AnsiBack ()
174177Style = AnsiStyle ()
175178Cursor = AnsiCursor ()
176-
177- fore_stack .append (Fore .RESET )
178- back_stack .append (Back .RESET )
179- style_stack .append (Style .NORMAL )
0 commit comments