Skip to content

Commit

Permalink
Right align numerical columns in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
boxed committed Oct 26, 2024
1 parent ec61b12 commit 9b63e60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mutmut/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
parse,
ParserSyntaxError,
)
from rich.text import Text
from setproctitle import setproctitle

import mutmut
Expand Down Expand Up @@ -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()
]

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9b63e60

Please sign in to comment.