From 9b63e604a1383c50653bc2f688e9c10976542dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Hovm=C3=B6ller?= Date: Sat, 26 Oct 2024 12:01:47 +0200 Subject: [PATCH] Right align numerical columns in browser --- mutmut/__main__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mutmut/__main__.py b/mutmut/__main__.py index 828c9501..7069750e 100644 --- a/mutmut/__main__.py +++ b/mutmut/__main__.py @@ -51,6 +51,7 @@ parse, ParserSyntaxError, ) +from rich.text import Text from setproctitle import setproctitle import mutmut @@ -1462,7 +1463,7 @@ class ResultBrowser(App): columns = [ ('path', 'Path'), ] + [ - (status, emoji) + (status, Text(emoji, justify='right')) for status, emoji in emoji_by_status.items() ] @@ -1512,7 +1513,10 @@ def populate_files_table(self): files_table.clear() for p, (source_file_mutation_data, stat) in sorted(self.source_file_mutation_data_and_stat_by_path.items()): - row = [p] + [getattr(stat, k.replace(' ', '_')) for k, _ in self.columns[1:]] + row = [p] + [ + Text(str(getattr(stat, k.replace(' ', '_'))), justify="right") + for k, _ in self.columns[1:] + ] files_table.add_row(*row, key=p) files_table.move_cursor(row=selected_row)