attempt chunked output to avoid message too long error
All checks were successful
Test / Test (push) Successful in 1m0s
All checks were successful
Test / Test (push) Successful in 1m0s
This commit is contained in:
parent
d729d69ea3
commit
42d578da76
@ -105,14 +105,26 @@ class Console():
|
|||||||
input_lines.append(input_line)
|
input_lines.append(input_line)
|
||||||
return ''.join(input_lines)
|
return ''.join(input_lines)
|
||||||
|
|
||||||
|
def write_chunk(self, chunk: str) -> None:
|
||||||
|
"""Write a chunk of data to stdout.
|
||||||
|
|
||||||
|
:param output: the chunk to write to stdout
|
||||||
|
|
||||||
|
"""
|
||||||
|
sys.stdout.write(chunk + '\r\n')
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
def write_output(self, output: str) -> None:
|
def write_output(self, output: str) -> None:
|
||||||
"""Write something to stdout.
|
"""Write something to stdout.
|
||||||
|
|
||||||
:param output: the string to write to stdout
|
:param output: the string to write to stdout
|
||||||
|
|
||||||
"""
|
"""
|
||||||
sys.stdout.write(output + '\r\n')
|
chunk_size = 256 # Adjust the chunk size as needed
|
||||||
sys.stdout.flush()
|
|
||||||
|
for i in range(0, len(output), chunk_size):
|
||||||
|
chunk = output[i:i + chunk_size]
|
||||||
|
self.write_chunk(chunk)
|
||||||
|
|
||||||
def print_configuration(self) -> None:
|
def print_configuration(self) -> None:
|
||||||
"""Print the current running configuration.
|
"""Print the current running configuration.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user