From 4fde1ddf1447dc625ecbd2de67ebc197be3746ba Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Thu, 21 Feb 2019 01:49:15 -0800 Subject: [PATCH] Reorganize data_bind.py --- corrscope/gui/data_bind.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/corrscope/gui/data_bind.py b/corrscope/gui/data_bind.py index 80c08db..9483635 100644 --- a/corrscope/gui/data_bind.py +++ b/corrscope/gui/data_bind.py @@ -30,15 +30,15 @@ if TYPE_CHECKING: assert Enum -__all__ = ["PresentationModel", "map_gui", "behead", "rgetattr", "rsetattr"] +__all__ = ["PresentationModel", "map_gui", "behead", "rgetattr", "rsetattr", "Symbol"] +Signal = Any WidgetUpdater = Callable[[], None] - - Symbol = Union[str, "Enum"] +# Data binding presentation-model class PresentationModel(qc.QObject): """ Key-value MVP presentation-model. @@ -82,7 +82,6 @@ class PresentationModel(qc.QObject): updater() -# TODO add tests for recursive operations def map_gui(view: "MainWindow", model: PresentationModel) -> None: """ Binding: @@ -106,9 +105,7 @@ def map_gui(view: "MainWindow", model: PresentationModel) -> None: widget.bind_widget(model, path) -Signal = Any - - +# Bound widgets class BoundWidget(QWidget): default_palette: QPalette error_palette: QPalette