105
105
style_stack : List [str ] = []
106
106
107
107
108
- def code_to_chars (code ) -> str :
108
+ def code_to_chars (code ) -> str : # noqa: D103
109
109
return CSI + str (code ) + 'm'
110
110
111
111
112
- def set_title (title : str ) -> str :
112
+ def set_title (title : str ) -> str : # noqa: D103
113
113
return OSC + "2;" + title + BEL
114
114
115
115
116
- def clear_screen (mode : int = 2 ) -> str :
116
+ def clear_screen (mode : int = 2 ) -> str : # noqa: D103
117
117
return CSI + str (mode ) + 'J'
118
118
119
119
120
- def clear_line (mode : int = 2 ) -> str :
120
+ def clear_line (mode : int = 2 ) -> str : # noqa: D103
121
121
return CSI + str (mode ) + 'K'
122
122
123
123
@@ -204,9 +204,15 @@ def __init__(self) -> None:
204
204
205
205
206
206
class AnsiCursor :
207
+ """
208
+ Provides methods to control the cursor.
209
+
210
+ .. TODO:: Add show and hide methods.
211
+ """
207
212
208
213
def UP (self , n : int = 1 ) -> str :
209
214
"""
215
+ Moves the cursor up.
210
216
211
217
:param n:
212
218
"""
@@ -215,6 +221,7 @@ def UP(self, n: int = 1) -> str:
215
221
216
222
def DOWN (self , n : int = 1 ) -> str :
217
223
"""
224
+ Moves the cursor down.
218
225
219
226
:param n:
220
227
"""
@@ -223,6 +230,7 @@ def DOWN(self, n: int = 1) -> str:
223
230
224
231
def FORWARD (self , n : int = 1 ) -> str :
225
232
"""
233
+ Moves the cursor forward (right).
226
234
227
235
:param n:
228
236
"""
@@ -231,6 +239,7 @@ def FORWARD(self, n: int = 1) -> str:
231
239
232
240
def BACK (self , n : int = 1 ) -> str :
233
241
"""
242
+ Moves the cursor back (left).
234
243
235
244
:param n:
236
245
"""
@@ -239,6 +248,7 @@ def BACK(self, n: int = 1) -> str:
239
248
240
249
def POS (self , x : int = 1 , y : int = 1 ) -> str :
241
250
"""
251
+ Sets the position of the cursor.
242
252
243
253
:param x:
244
254
:param y:
0 commit comments