From fd8c05e024ba2e2f3cca3c6e74f5ab0db15ad538 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 19 Sep 2022 14:04:54 -0400 Subject: [PATCH] A lines entry should always exist or it's a bug --- piker/ui/_editors.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/piker/ui/_editors.py b/piker/ui/_editors.py index e250eee3..b065fef4 100644 --- a/piker/ui/_editors.py +++ b/piker/ui/_editors.py @@ -179,9 +179,9 @@ class LineEditor(Struct): graphic in view. ''' - lines = self._order_lines.get(uuid) + lines = self._order_lines[uuid] if lines: - for line in self._order_lines.get(uuid, []): + for line in lines: line.show_labels() log.debug(f'Level active for level: {line.value()}') # TODO: other flashy things to indicate the order is active @@ -189,9 +189,10 @@ class LineEditor(Struct): return lines def lines_under_cursor(self) -> list[LevelLine]: - """Get the line(s) under the cursor position. + ''' + Get the line(s) under the cursor position. - """ + ''' # Delete any hoverable under the cursor return self.godw.get_cursor()._hovered