From e1764d39776f0d57ff2c659d6a0fd3cfb5e9ec0b Mon Sep 17 00:00:00 2001 From: Sandip Samal Date: Thu, 12 Sep 2024 14:20:17 -0400 Subject: [PATCH] print exit code to std op for downstream use --- lld_chxr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lld_chxr.py b/lld_chxr.py index c1b207e..f610d50 100644 --- a/lld_chxr.py +++ b/lld_chxr.py @@ -26,7 +26,7 @@ logger.opt(colors = True) logger.add(sys.stderr, format=logger_format) -__version__ = '1.1.0' +__version__ = '1.1.2' DISPLAY_TITLE = r""" _ _ _ _ _ @@ -108,7 +108,7 @@ def main(options: Namespace, inputdir: Path, outputdir: Path): tagStruct = tagInfo_to_tagStruct(options) mapper = PathMapper.file_mapper(inputdir, outputdir, glob=f"**/*{options.fileFilter}",fail_if_empty=False) for input_file, output_file in mapper: - LOG(input_file) + LOG(f"Reading input file {input_file}") filename = ntpath.basename(input_file) jsonFilePath = os.path.join(options.outputdir, filename.replace(options.fileFilter,"status.json")) with open(input_file) as f: @@ -118,6 +118,8 @@ def main(options: Namespace, inputdir: Path, outputdir: Path): LOG("Analysis check successful.") files_dir = copytree(inputdir, outputdir,dirs_exist_ok=True,ignore=ignore_patterns('*.json')) LOG(f"copying files to {files_dir} done.") + else: + LOG(f"QA check failed with exit code {status['exitCode']}") # Open a json writer, and use the json.dumps() # function to dump data with open(jsonFilePath, 'w', encoding='utf-8') as jsonf: @@ -202,7 +204,7 @@ def analyze_measurements(data, tagStruct, unit, diff): status['exitCode'] = 3 status['flag'] = False LOG(f"Allowed difference {diff}%, actual difference {difference}%") - #return status + return status