From e7822aa364fcc392476ded5537948292f7db2300 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Thu, 17 Feb 2022 18:37:51 -0800 Subject: [PATCH] Cleanup --- deferred_operand.py | 2 +- string_utils.py | 4 ++-- text_utils.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deferred_operand.py b/deferred_operand.py index 70e9d57..1de2bfb 100644 --- a/deferred_operand.py +++ b/deferred_operand.py @@ -19,7 +19,7 @@ class DeferredOperand(ABC, Generic[T]): """ @abstractmethod - def _resolve(self) -> T: + def _resolve(self, timeout=None) -> T: pass @staticmethod diff --git a/string_utils.py b/string_utils.py index 4bec031..c995070 100644 --- a/string_utils.py +++ b/string_utils.py @@ -1649,7 +1649,7 @@ def ip_v4_sort_key(txt: str) -> Optional[Tuple[int, ...]]: if not is_ip_v4(txt): print(f"not IP: {txt}") return None - return tuple([int(x) for x in txt.split('.')]) + return tuple(int(x) for x in txt.split('.')) def path_ancestors_before_descendants_sort_key(volume: str) -> Tuple[str, ...]: @@ -1664,7 +1664,7 @@ def path_ancestors_before_descendants_sort_key(volume: str) -> Tuple[str, ...]: ['/usr', '/usr/local', '/usr/local/bin'] """ - return tuple([x for x in volume.split('/') if len(x) > 0]) + return tuple(x for x in volume.split('/') if len(x) > 0) def replace_all(in_str: str, replace_set: str, replacement: str) -> str: diff --git a/text_utils.py b/text_utils.py index 720bf20..564d67e 100644 --- a/text_utils.py +++ b/text_utils.py @@ -71,13 +71,13 @@ def bar_graph( include_text=True, width=70, fgcolor=fg("school bus yellow"), - reset=reset(), + reset_seq=reset(), left_end="[", right_end="]", ) -> str: """Returns a string containing a bar graph. - >>> bar_graph(0.5, fgcolor='', reset='') + >>> bar_graph(0.5, fgcolor='', reset_seq='') '[███████████████████████████████████ ] 50.0%' """ @@ -104,7 +104,7 @@ def bar_graph( + "█" * whole_width + part_char + " " * (width - whole_width - 1) - + reset + + reset_seq + right_end + " " + text -- 2.45.2