From a0ccf61e229bc6d65cedbf13c0066672ee8065ab Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 28 Nov 2024 21:57:30 +0100 Subject: [PATCH] fix: separation between run and print function --- src/rougail/output_json/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rougail/output_json/__init__.py b/src/rougail/output_json/__init__.py index e17b788..d0e4f2f 100644 --- a/src/rougail/output_json/__init__.py +++ b/src/rougail/output_json/__init__.py @@ -77,7 +77,7 @@ class RougailOutputJson: ) self.errors.append(f" - {option.description()}") - def exporter(self) -> bool: + def exporter(self) -> None: self.config.property.read_write() self.mandatory() if self.read_write: @@ -96,11 +96,13 @@ class RougailOutputJson: self.config, self.dico, ) - return True def run(self) -> None: self.exporter() - print(dumps(self.dico, ensure_ascii=False, indent=2)) + return dumps(self.dico, ensure_ascii=False, indent=2) + + def print(self) -> str: + print(self.run()) def parse_family( self,