Skip to content

Commit

Permalink
* Allow editing/saving/cloning queue parameters
Browse files Browse the repository at this point in the history
  Closes #147
  • Loading branch information
fonsecareyna82 committed Sep 18, 2020
1 parent 18ebaae commit e64ad4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions pyworkflow/gui/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyworkflow/utils/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down

0 comments on commit e64ad4d

Please sign in to comment.