From e64ad4debd375434a3ce00365088c0aa50a2cdc6 Mon Sep 17 00:00:00 2001 From: "Yunior C. Fonseca Reyna" Date: Fri, 18 Sep 2020 11:48:33 +0200 Subject: [PATCH] * Allow editing/saving/cloning queue parameters Closes #147 --- pyworkflow/gui/form.py | 19 ++++++++++++------- pyworkflow/utils/properties.py | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pyworkflow/gui/form.py b/pyworkflow/gui/form.py index d979e2f41..8c90b4243 100644 --- a/pyworkflow/gui/form.py +++ b/pyworkflow/gui/form.py @@ -31,7 +31,6 @@ import os import tkinter as tk import tkinter.ttk as ttk -import webbrowser from collections import OrderedDict from datetime import datetime @@ -49,7 +48,7 @@ from .browser import FileBrowserWindow from .widgets import Button, HotButton, IconButton from .dialog import (showInfo, showError, showWarning, EditObjectDialog, - ListDialog, askYesNo, Dialog,RESULT_CANCEL, + ListDialog, askYesNo, Dialog, RESULT_CANCEL, askSingleAllCancel, RESULT_RUN_ALL, RESULT_RUN_SINGLE) from .canvas import Canvas from .tree import TreeProvider, BoundTree @@ -1891,13 +1890,17 @@ def _createCommon(self, parent): self._createParallel(runFrame, r) # ---- QUEUE ---- - self._createHeaderLabel(runFrame, pwutils.Message.LABEL_QUEUE, row=r, sticky='e', column=c) var, frame = ParamWidget.createBoolWidget(runFrame, bg='white', font=self.font) + btn = IconButton(frame, pwutils.Message.LABEL_BUTTON_WIZ, pwutils.Icon.ACTION_WIZ, + highlightthickness=0, command=self._editQueueParams) + btn.grid(row=0, column=2, sticky='nes', padx=1, pady=4) + frame.columnconfigure(2, weight=1) + self._addVarBinding(pwutils.Message.VAR_QUEUE, var) frame.grid(row=r, column=c + 1, pady=5, sticky='ew') @@ -2146,16 +2149,18 @@ def save(self, e=None): def schedule(self): if self.protocol.useQueue(): - if not self._editQueueParams(): - return + if not self.protocol.getQueueParams()[0]: + if not self._editQueueParams(): + return self._close(doSchedule=True) def execute(self, e=None): if self.protocol.useQueue(): - if not self._editQueueParams(): - return + if not self.protocol.getQueueParams()[0]: + if not self._editQueueParams(): + return else: # use queue = No hostConfig = self._getHostConfig() cores = self.protocol.numberOfMpi.get(1) * self.protocol.numberOfThreads.get(1) diff --git a/pyworkflow/utils/properties.py b/pyworkflow/utils/properties.py index c4bb08721..218ed9596 100644 --- a/pyworkflow/utils/properties.py +++ b/pyworkflow/utils/properties.py @@ -158,12 +158,12 @@ class Message: """ HELP_USEQUEUE = """ - Select *Yes* if you want to submit a single job per protocol to a Queue system. + Click *Yes* if you want to submit a single job per protocol to a Queue system. The queue commands for launch and stop jobs should be configured for the current host in the _hosts.conf_ file. """ HELP_USEQUEUEPERJOB = """ - Select *Yes* if you want to submit the multiple jobs per protocol to a Queue system. + Click *Yes* if you want to submit the multiple jobs per protocol to a Queue system. The queue commands for launch and stop jobs should be configured for the current host in the _hosts.conf_ file. """