Cleanup
authorScott Gasch <[email protected]>
Fri, 18 Feb 2022 02:37:51 +0000 (18:37 -0800)
committerScott Gasch <[email protected]>
Fri, 18 Feb 2022 02:37:51 +0000 (18:37 -0800)
deferred_operand.py
string_utils.py
text_utils.py

index 70e9d57392dc0a0b44ba7464cf3be9ee1aa797eb..1de2bfb0931ffa8b9bfdd754e7ac00ad3551af90 100644 (file)
@@ -19,7 +19,7 @@ class DeferredOperand(ABC, Generic[T]):
     """
 
     @abstractmethod
-    def _resolve(self) -> T:
+    def _resolve(self, timeout=None) -> T:
         pass
 
     @staticmethod
index 4bec031738e989d10507992387e18aa47996da8e..c995070ff09fbe128d67d27d3ff42007e94ba2d5 100644 (file)
@@ -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:
index 720bf20561a63bcd5c1afeba42658c8924566adc..564d67eb98c479efdfa00671a98ea179f0f189a8 100644 (file)
@@ -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