Skip to content

Commit 76fe142

Browse files
author
James Boulton
committed
table testing
1 parent a324ae0 commit 76fe142

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

dashio/iotcontrol/table.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,9 @@ def __init__(
143143
phones or 2 column fold out phones or 3 column tablets.
144144
"""
145145
super().__init__("TBL", control_id)
146-
if column_headings is None:
147-
self.column_headings = None
148-
else:
149-
self.column_headings = [heading.translate(BAD_CHARS) for heading in column_headings]
146+
ch = column_headings
147+
if column_headings is not None:
148+
ch = [heading.translate(BAD_CHARS) for heading in column_headings]
150149
self._app_columns_cfg[str(column_no)].append(
151150
TableConfig(
152151
control_id,
@@ -156,7 +155,7 @@ def __init__(
156155
font_size,
157156
label_width_percent,
158157
columns,
159-
self.column_headings,
158+
ch,
160159
control_position
161160
)
162161
)
@@ -235,7 +234,7 @@ def update_table_row(self, table_row: TableRow, row_number: int) -> int:
235234
return row_number
236235
self._rows.append(table_row)
237236
self.state_str = self._send_row(len(self._rows) - 1, table_row)
238-
return len(self._rows - 1)
237+
return len(self._rows)-1
239238

240239
def clear_row(self, row_number: int):
241240
"""Clears the row at row_numer

0 commit comments

Comments
 (0)