small fix Doppelhochkomma innerhalb des Format Strings

This commit is contained in:
2024-01-09 10:22:18 +01:00
parent 5da92d57d1
commit ba643e2744
+3 -3
View File
@@ -337,7 +337,7 @@ class Treeview:
"""Prints root number (number for which the user wants to see the tree) to the console""" """Prints root number (number for which the user wants to see the tree) to the console"""
background_color = self._set_text_background_color(self.main_partnumber) background_color = self._set_text_background_color(self.main_partnumber)
print(f"{background_color}{self.main_partnumber}{Treeview.console_colors["RESET"]}") print(f"{background_color}{self.main_partnumber}{Treeview.console_colors['RESET']}")
def _tree_body(self, parent_id=None, prefix=""): def _tree_body(self, parent_id=None, prefix=""):
@@ -395,7 +395,7 @@ class Treeview:
+ len(Treeview.console_colors["RESET"]) \ + len(Treeview.console_colors["RESET"]) \
+ len(Treeview.console_colors["RED"]) # other color codes (ansi escape sequences) could have been used instead since they all have the same length + len(Treeview.console_colors["RED"]) # other color codes (ansi escape sequences) could have been used instead since they all have the same length
text_before_description = f"{prefix}{connector}{color}{child_id}{Treeview.console_colors["RESET"]}".ljust(longest_entry) text_before_description = f"{prefix}{connector}{color}{child_id}{Treeview.console_colors['RESET']}".ljust(longest_entry)
description = self._descriptions[child_id] description = self._descriptions[child_id]
print(f"{text_before_description} {description}") print(f"{text_before_description} {description}")
@@ -452,4 +452,4 @@ if __name__ == '__main__':
treeview_comparison = Treeview(num, environment.data_dir, environment.data_dir, environment.ruledesigner_csv_filename) treeview_comparison = Treeview(num, environment.data_dir, environment.data_dir, environment.ruledesigner_csv_filename)
treeview_comparison.generate_tree() treeview_comparison.generate_tree()
else: else:
parser.print_help() parser.print_help()