More cleanup, yey!
[python_utils.git] / text_utils.py
index 76cc7e816db9ae87581989bc314fd7d07d4ca154..4384a1e6134810982e9227d2bb1dfdb517627f72 100644 (file)
@@ -15,6 +15,8 @@ logger = logging.getLogger(__file__)
 
 
 class RowsColumns(NamedTuple):
+    """Row + Column"""
+
     rows: int
     columns: int
 
@@ -31,7 +33,7 @@ def get_console_rows_columns() -> RowsColumns:
         ).split()
     except Exception as e:
         logger.exception(e)
-        raise Exception('Can\'t determine console size?!')
+        raise Exception('Can\'t determine console size?!') from e
     return RowsColumns(int(rows), int(columns))
 
 
@@ -122,10 +124,10 @@ def sparkline(numbers: List[float]) -> Tuple[float, float, str]:
     barcount = len(_bar)
     min_num, max_num = min(numbers), max(numbers)
     span = max_num - min_num
-    sparkline = ''.join(
+    sline = ''.join(
         _bar[min([barcount - 1, int((n - min_num) / span * barcount)])] for n in numbers
     )
-    return min_num, max_num, sparkline
+    return min_num, max_num, sline
 
 
 def distribute_strings(