From 50713030f81a429b3ae845821ff59efd50a3d41a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 9 Jan 2022 11:46:25 -0500 Subject: [PATCH] annoying doc strings --- piker/data/feed.py | 3 ++- piker/ui/_event.py | 9 +++++---- piker/ui/_forms.py | 11 +++++++---- piker/ui/_search.py | 6 ++++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/piker/data/feed.py b/piker/data/feed.py index 1e0c55b2..b3e1efd6 100644 --- a/piker/data/feed.py +++ b/piker/data/feed.py @@ -592,7 +592,8 @@ async def maybe_open_feed( **kwargs, ) -> (Feed, ReceiveChannel[dict[str, Any]]): - '''Maybe open a data to a ``brokerd`` daemon only if there is no + ''' + Maybe open a data to a ``brokerd`` daemon only if there is no local one for the broker-symbol pair, if one is cached use it wrapped in a tractor broadcast receiver. diff --git a/piker/ui/_event.py b/piker/ui/_event.py index 9e087dd4..f9982843 100644 --- a/piker/ui/_event.py +++ b/piker/ui/_event.py @@ -26,7 +26,9 @@ import trio from PyQt5 import QtCore from PyQt5.QtCore import QEvent, pyqtBoundSignal from PyQt5.QtWidgets import QWidget -from PyQt5.QtWidgets import QGraphicsSceneMouseEvent as gs_mouse +from PyQt5.QtWidgets import ( + QGraphicsSceneMouseEvent as gs_mouse, +) MOUSE_EVENTS = { @@ -129,6 +131,8 @@ class EventRelay(QtCore.QObject): # TODO: is there a global setting for this? if ev.isAutoRepeat() and self._filter_auto_repeats: ev.ignore() + # filter out this event and stop it's processing + # https://doc.qt.io/qt-5/qobject.html#installEventFilter return True # NOTE: the event object instance coming out @@ -152,9 +156,6 @@ class EventRelay(QtCore.QObject): # **do not** filter out this event # and instead forward to the source widget - return False - - # filter out this event # https://doc.qt.io/qt-5/qobject.html#installEventFilter return False diff --git a/piker/ui/_forms.py b/piker/ui/_forms.py index 72053716..6406a199 100644 --- a/piker/ui/_forms.py +++ b/piker/ui/_forms.py @@ -174,7 +174,6 @@ class Selection(QComboBox): def __init__( self, parent=None, - ) -> None: self._items: dict[str, int] = {} @@ -200,7 +199,6 @@ class Selection(QComboBox): def set_style( self, - color: str, font_size: int, @@ -217,6 +215,7 @@ class Selection(QComboBox): def resize( self, char: str = 'W', + ) -> None: br = _font.boundingRect(str(char)) _, h = br.width(), br.height() @@ -238,9 +237,11 @@ class Selection(QComboBox): keys: list[str], ) -> None: - '''Write keys to the selection verbatim. + ''' + Write keys to the selection verbatim. All other items are cleared beforehand. + ''' self.clear() self._items.clear() @@ -536,7 +537,8 @@ async def open_form_input_handling( class FillStatusBar(QProgressBar): - '''A status bar for fills up to a position limit. + ''' + A status bar for fills up to a position limit. ''' border_px: int = 2 @@ -663,6 +665,7 @@ def mk_fill_status_bar( ) bar_labels_lhs.addSpacing(5/8 * bar_h) + bar_labels_lhs.addWidget( left_label, # XXX: doesn't seem to actually push up against diff --git a/piker/ui/_search.py b/piker/ui/_search.py index 94a2fd56..f1fc1f4e 100644 --- a/piker/ui/_search.py +++ b/piker/ui/_search.py @@ -347,7 +347,8 @@ class CompleterView(QTreeView): clear_all: bool = False, ) -> None: - '''Set result-rows for depth = 1 tree section ``section``. + ''' + Set result-rows for depth = 1 tree section ``section``. ''' model = self.model() @@ -438,7 +439,8 @@ class SearchBar(Edit): class SearchWidget(QtWidgets.QWidget): - '''Composed widget of ``SearchBar`` + ``CompleterView``. + ''' + Composed widget of ``SearchBar`` + ``CompleterView``. Includes helper methods for item management in the sub-widgets.