Skip to content

Commit 25d1a79

Browse files
author
James Boulton
committed
Remove debug mesg, and fix IndexError
1 parent d08a02f commit 25d1a79

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dashio/device.py

-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ def add_all_c64_controls(self, c64_dict: dict, column_no=1):
255255
new_control = CONTROL_INSTANCE_DICT[control_type].from_cfg_dict(control, column_no=column_no)
256256
self.add_control(new_control)
257257
elif control_type == "CFG" and isinstance(control_list, dict):
258-
logger.debug("CFG: %s", control_list)
259258
if 'name' in control_list['deviceSetup']:
260259
self._set_device_setup("name", True)
261260
self.set_name_callback(self._name_callback)

dashio/iotcontrol/table.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
SOFTWARE.
2323
"""
2424
from __future__ import annotations
25+
import logging
2526
from ..constants import BAD_CHARS
2627
from .control import Control, ControlPosition, ControlConfig, _get_title_position, _get_precision
2728
from .enums import (
@@ -30,6 +31,9 @@
3031
)
3132

3233

34+
logger = logging.getLogger(__name__)
35+
36+
3337
class TableConfig(ControlConfig):
3438
"""TableConfig"""
3539

@@ -244,9 +248,10 @@ def clear_row(self, row_number: int):
244248
row_number : int
245249
The row to clear
246250
"""
247-
self._rows[row_number] = None
248-
header_str = self._control_hdr_str + f"{row_number}\n"
249-
self.state_str = header_str
251+
if 0 <= row_number < len(self._rows):
252+
self._rows[row_number] = None
253+
header_str = self._control_hdr_str + f"{row_number}\n"
254+
self.state_str = header_str
250255

251256
def clear_table(self):
252257
"""Clears the table

0 commit comments

Comments
 (0)