From e5dd5d77fe5ba256d33356dadf20fbec153ff36a Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 10 Apr 2024 18:27:49 +0200 Subject: Printing image_parameters and draw_parameters. --- src/argaze/DataFeatures.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/argaze/DataFeatures.py b/src/argaze/DataFeatures.py index a608540..af18c3b 100644 --- a/src/argaze/DataFeatures.py +++ b/src/argaze/DataFeatures.py @@ -1035,6 +1035,33 @@ class PipelineStepObject(): if output[-1] != '\n': output += '\n' + def print_dict(d: dict, key_color, tabs) -> str: + + output = '' + tabs = f'{tabs}\t' + + for k, v in d.items(): + + if type(v) is dict: + + output += f'{tabs} - {key_color}{Style.BRIGHT}{k}{Style.RESET_ALL}:\n{print_dict(v, key_color, tabs)}' + + else: + + output += f'{tabs} - {key_color}{Style.BRIGHT}{k}{Style.RESET_ALL}: {v}\n' + + return output + + if len(self._image_parameters): + + output += f'{tabs}\t{Style.BRIGHT}image_parameters{Style.RESET_ALL}:\n' + output += print_dict(self._image_parameters, Fore.YELLOW, tabs) + + if len(self._draw_parameters): + + output += f'{tabs}\t{Style.BRIGHT}draw_parameters{Style.RESET_ALL}:\n' + output += print_dict(self._draw_parameters, Fore.YELLOW, tabs) + return output @property -- cgit v1.1