@@ -26,6 +26,7 @@ class ArkPTYSSHWinConnection(ArkConnection):
26
26
__DEFAULT_ROW_SIZE : Final [int ] = 24
27
27
__DEFAULT_NONEAGER_TIMEOEUT : Final [float ] = 1.0
28
28
__DEFAULT_PROMPT_OVERALL_TIMEOUT : Final [float ] = 20.0
29
+ __CHAR_SLEEP_TIME : Final [float ] = 0.05
29
30
30
31
def __init__ (self ):
31
32
super ().__init__ ()
@@ -35,11 +36,11 @@ def __init__(self):
35
36
self .__output_lock : threading .Lock = threading .Lock ()
36
37
self .__buffer : str = ''
37
38
38
- def __strip_ansi (self , input : str ) -> str :
39
- input = input .strip ()
40
- input = ArkPTYSSHWinConnection .__ANSI_COLOR_STRIPPER .sub ('' , input )
41
- input = ArkPTYSSHWinConnection .__ANSI_ESCAPE_STRIPPER .sub ('' , input )
42
- return input
39
+ def __strip_ansi (self , ansi_input : str ) -> str :
40
+ ansi_input = ansi_input .strip ()
41
+ ansi_input = ArkPTYSSHWinConnection .__ANSI_COLOR_STRIPPER .sub ('' , ansi_input )
42
+ ansi_input = ArkPTYSSHWinConnection .__ANSI_ESCAPE_STRIPPER .sub ('' , ansi_input )
43
+ return ansi_input
43
44
44
45
def __reset_buffer (self ) -> None :
45
46
with self .__output_lock :
@@ -67,7 +68,7 @@ def __read_until_latest_prompt(
67
68
break
68
69
if (time .time () - start_time ) > overall_timeout and prompt_found_at == - 1 :
69
70
raise RuntimeError (f'Timeout while waiting for prompt [{ buffer } ]' )
70
- time .sleep (0.05 )
71
+ time .sleep (ArkPTYSSHWinConnection . __CHAR_SLEEP_TIME )
71
72
continue
72
73
73
74
buffer += char
@@ -105,6 +106,7 @@ def connect(self, connection_details: ArkConnectionDetails) -> None:
105
106
Raises:
106
107
ArkException: _description_
107
108
"""
109
+ # pylint: disable=import-error
108
110
import winpty
109
111
110
112
if self .__is_connected :
0 commit comments