From 357422522548f3ecbd00fad4668a62af38ee8dfe Mon Sep 17 00:00:00 2001 From: Matthias Diener <mdiener@illinois.edu> Date: Mon, 24 Aug 2020 21:30:44 -0500 Subject: [PATCH] small cleanup --- pytools/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 6b05f29..6c8e358 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -1522,13 +1522,15 @@ class Table: # last alignment specified: alignments += self.alignments[-1] * (columns - len(self.alignments)) - lines = [" | ".join([cell.center(col_width) if align == 'c' - else cell.ljust(col_width) if align == 'l' else cell.rjust(col_width) + lines = [" | ".join([ + cell.center(col_width) if align == "c" + else cell.ljust(col_width) if align == "l" + else cell.rjust(col_width) for cell, col_width, align in zip(row, col_widths, alignments)]) for row in self.rows] - lines[1:1] = ["|".join(":" + "-" * (col_width - 1 + (i > 0)) + ":" - if align == 'c' - else ':' + "-" * (col_width + (i > 0)) if align == 'l' + lines[1:1] = ["|".join( + ":" + "-" * (col_width - 1 + (i > 0)) + ":" if align == "c" + else ":" + "-" * (col_width + (i > 0)) if align == "l" else "-" * (col_width + (i > 0)) + ":" for i, (col_width, align) in enumerate(zip(col_widths, alignments)))] -- GitLab