From 3e52ba6e12685f9c4ac4be0ecc2c2eec0cf6fdff Mon Sep 17 00:00:00 2001 From: ldericher <40151420+ldericher@users.noreply.github.com> Date: Sat, 27 Nov 2021 18:25:38 +0100 Subject: [PATCH] style --- kiwi_scp/wstring.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/kiwi_scp/wstring.py b/kiwi_scp/wstring.py index a6f07af..c23c31a 100644 --- a/kiwi_scp/wstring.py +++ b/kiwi_scp/wstring.py @@ -44,34 +44,29 @@ class WParagraph: def __str__(self) -> str: return "\n".join( str(line) - for line - in self.lines + for line in self.lines ) @classmethod def from_strings(cls, *source: str) -> "WParagraph": return cls([ WString(line) - for line - in source + for line in source ]) def align(self, alignment: WAlignment = WAlignment.CENTER, padding: int = 0, char: str = " ") -> "WParagraph": total_length = max( len(line) - for line - in self.lines + for line in self.lines ) + padding pad_lengths = ( total_length - len(line) - for line - in self.lines + for line in self.lines ) return WParagraph([ line.pad(alignment, wlen, char) - for line, wlen - in zip(self.lines, pad_lengths) + for line, wlen in zip(self.lines, pad_lengths) ]) def surround(self, char: str, padding: int = 1) -> "WParagraph": @@ -82,8 +77,7 @@ class WParagraph: lines = [ WString(f"{l_border}{line}{r_border}") - for line - in self.lines + for line in self.lines ] extra_line = char * len(lines[0]) @@ -99,6 +93,5 @@ class WParagraph: return WParagraph([ WString(f"{l_border}{line}{r_border}") - for line - in self.lines + for line in self.lines ])