fix: separation between run and print function

This commit is contained in:
egarette@silique.fr 2024-11-28 22:06:38 +01:00
parent 6b3987a39a
commit 4c2e9e9a86

View file

@ -119,9 +119,15 @@ class RougailOutputConsole:
self.end() self.end()
return True return True
def run(self) -> None: def run(self) -> str:
with self.console.capture() as capture:
self.print()
return capture.get()
def print(self) -> None:
self.exporter() self.exporter()
return self.print() for out in self.out:
self.console.print(out)
def parse_options( def parse_options(
self, self,
@ -216,10 +222,6 @@ class RougailOutputConsole:
def end(self): def end(self):
self.out.append(self.output.tree) self.out.append(self.output.tree)
def print(self):
for out in self.out:
self.console.print(out)
class OutputFamily: class OutputFamily:
def __init__( def __init__(