|
22 | 22 | SOFTWARE. |
23 | 23 | """ |
24 | 24 | from __future__ import annotations |
| 25 | + |
25 | 26 | import logging |
26 | | -from ..constants import BAD_CHARS |
27 | | -from .control import Control, ControlPosition, ControlConfig, _get_title_position, _get_precision |
28 | | -from .enums import ( |
29 | | - Precision, |
30 | | - TitlePosition |
31 | | -) |
32 | 27 |
|
| 28 | +from ..constants import BAD_CHARS |
| 29 | +from .control import (Control, ControlConfig, ControlPosition, _get_precision, |
| 30 | + _get_title_position) |
| 31 | +from .enums import Precision, TitlePosition |
33 | 32 |
|
34 | 33 | logger = logging.getLogger(__name__) |
35 | 34 |
|
@@ -88,12 +87,13 @@ def from_dict(cls, cfg_dict: dict): |
88 | 87 | class TableRow: |
89 | 88 | """A Table Row |
90 | 89 | """ |
| 90 | + |
91 | 91 | def __init__( |
92 | 92 | self, |
93 | 93 | label: str | None = None, |
94 | 94 | columns: list[str] | None = None, |
95 | 95 | units: str | None = None, |
96 | | - ) -> None: |
| 96 | + ) -> None: |
97 | 97 | self.label = label |
98 | 98 | if columns is None: |
99 | 99 | self.columns = columns |
@@ -207,10 +207,9 @@ def _send_row(self, row_number: int, table_row: TableRow | None) -> str: |
207 | 207 | if table_row.label is None: |
208 | 208 | row_label = "" |
209 | 209 | return f"{header_str}{row_number}\t{columns}\t{row_label}\t{table_row.units}\n" |
210 | | - else: |
211 | | - if table_row.label is None: |
212 | | - return f"{header_str}{row_number}\t{columns}\n" |
213 | | - return f"{header_str}{row_number}\t{columns}\t{row_label}\n" |
| 210 | + if table_row.label is None: |
| 211 | + return f"{header_str}{row_number}\t{columns}\n" |
| 212 | + return f"{header_str}{row_number}\t{columns}\t{table_row.label}\n" |
214 | 213 |
|
215 | 214 | def add_table_row(self, table_row: TableRow): |
216 | 215 | """Add a row to the table and send it""" |
|
0 commit comments