From dd349b0701cc4168ebb5fa58e0dfd2e8508d755a Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 3 Jul 2016 12:23:56 +0800 Subject: [PATCH] dashboard: simplify dataset editing code --- artiq/dashboard/datasets.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/artiq/dashboard/datasets.py b/artiq/dashboard/datasets.py index b37d3b73a..46252a043 100644 --- a/artiq/dashboard/datasets.py +++ b/artiq/dashboard/datasets.py @@ -13,12 +13,11 @@ logger = logging.getLogger(__name__) class Editor(QtWidgets.QDialog): - def __init__(self, parent, dataset_ctl, key, value, persist): + def __init__(self, parent, dataset_ctl, key, value): QtWidgets.QDialog.__init__(self, parent=parent) self.dataset_ctl = dataset_ctl self.key = key self.initial_type = type(value) - self.persist = persist self.setWindowTitle("Edit dataset") grid = QtWidgets.QGridLayout() @@ -39,8 +38,7 @@ class Editor(QtWidgets.QDialog): def accept(self): value = self.initial_type(self.get_edit_widget_value()) - asyncio.ensure_future(self.dataset_ctl.set( - self.key, value, self.persist)) + asyncio.ensure_future(self.dataset_ctl.set(self.key, value)) QtWidgets.QDialog.accept(self) def get_edit_widget(self, initial_value): @@ -165,7 +163,7 @@ class DatasetsDock(QtWidgets.QDockWidget): logger.error("Cannot edit dataset %s: " "type %s is not supported", key, t) return - dialog_cls(self, self.dataset_ctl, key, value, persist).open() + dialog_cls(self, self.dataset_ctl, key, value).open() def delete_clicked(self): idx = self.table.selectedIndexes()