From 52ae399cce49b49fb8489d580a9deaa28e591064 Mon Sep 17 00:00:00 2001 From: Yann Papouin Date: Fri, 17 May 2024 09:27:37 +0200 Subject: [PATCH] Print to default output according to verbosity --- src/manifestoo/addons_path.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/manifestoo/addons_path.py b/src/manifestoo/addons_path.py index bae7712..ca480c8 100644 --- a/src/manifestoo/addons_path.py +++ b/src/manifestoo/addons_path.py @@ -54,11 +54,17 @@ def extend_from_import_odoo(self, python: str) -> None: output = tempfile.NamedTemporaryFile(delete=False) try: output.close() + stderrpipe = subprocess.DEVNULL + stdoutpipe = subprocess.DEVNULL + if echo.verbosity > 0: + stderrpipe = None + if echo.verbosity > 1: + stdoutpipe = None try: r = subprocess.call( [python, script.name, output.name], - stderr=subprocess.DEVNULL, - stdout=subprocess.DEVNULL, + stderr=stderrpipe, + stdout=stdoutpipe, env=os.environ, ) except FileNotFoundError: