Skip to content

Commit 9b63e60

Browse files
committed
Right align numerical columns in browser
1 parent ec61b12 commit 9b63e60

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mutmut/__main__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
parse,
5252
ParserSyntaxError,
5353
)
54+
from rich.text import Text
5455
from setproctitle import setproctitle
5556

5657
import mutmut
@@ -1462,7 +1463,7 @@ class ResultBrowser(App):
14621463
columns = [
14631464
('path', 'Path'),
14641465
] + [
1465-
(status, emoji)
1466+
(status, Text(emoji, justify='right'))
14661467
for status, emoji in emoji_by_status.items()
14671468
]
14681469

@@ -1512,7 +1513,10 @@ def populate_files_table(self):
15121513
files_table.clear()
15131514

15141515
for p, (source_file_mutation_data, stat) in sorted(self.source_file_mutation_data_and_stat_by_path.items()):
1515-
row = [p] + [getattr(stat, k.replace(' ', '_')) for k, _ in self.columns[1:]]
1516+
row = [p] + [
1517+
Text(str(getattr(stat, k.replace(' ', '_'))), justify="right")
1518+
for k, _ in self.columns[1:]
1519+
]
15161520
files_table.add_row(*row, key=p)
15171521

15181522
files_table.move_cursor(row=selected_row)

0 commit comments

Comments
 (0)