pyworkflow.gui.project.viewprotocols module

pyworkflow.gui.project.viewprotocols.INIT_REFRESH_SECONDS = 3

View with the protocols inside the main project window.

class pyworkflow.gui.project.viewprotocols.ProtocolTreeProvider(protocol)[source]

Bases: pyworkflow.gui.tree.ObjectTreeProvider

Create the tree elements for a Protocol run

class pyworkflow.gui.project.viewprotocols.ProtocolsView(parent, windows, **args)[source]

Bases: tkinter.Frame

What you see when the “Protocols” tab is selected.

In the main project window there are three tabs: “Protocols | Data | Hosts”. This extended tk.Frame is what will appear when Protocols is on.

RUNS_CANVAS_NAME = 'runs_canvas'
createActionToolbar()[source]

Prepare the buttons that will be available for protocol actions.

createContent()[source]

Create the Protocols View for the Project. It has two panes:

Left: containing the Protocol classes tree Right: containing the Runs list
createRunItem(canvas, node)[source]
createRunsGraph(parent)[source]
createRunsTree(parent)[source]
drawRunsGraph(reorganize=False)[source]
executeProtocol(prot)[source]

Function to execute a protocol called not directly from the Form “Execute” button.

getSelectedProtocol()[source]
keyPressed(event)[source]
populateTree(tree, treeItems, prefix, obj, subclassedDict, level=0)[source]
refreshRuns(e=None, initRefreshCounter=True, checkPids=False)[source]

Refresh the status of displayed runs. Params:

e: Tk event input initRefreshCounter: if True the refresh counter will be set to 3 secs

then only case when False is from _automaticRefreshRuns where the refresh time is doubled each time to avoid refreshing too often.
switchRunsView()[source]
toggleDataSelection(prot, append)[source]
updateProtocolsTree(protCfg)[source]
updateRunsGraph(refresh=False, reorganize=False, checkPids=False)[source]
updateRunsTree(refresh=False)[source]
updateRunsTreeSelection()[source]
class pyworkflow.gui.project.viewprotocols.RunBox(nodeInfo, canvas, text, x, y, bgColor, textColor)[source]

Bases: pyworkflow.gui.canvas.TextBox

Just override TextBox move method to keep track of position changes in the graph.

move(dx, dy)[source]
moveTo(x, y)[source]

Move TextBox to a new position (x,y)

class pyworkflow.gui.project.viewprotocols.RunIOTreeProvider(parent, protocol, mapper)[source]

Bases: pyworkflow.gui.tree.TreeProvider

Create the tree elements from a Protocol Run input/output childs

static getColumns()[source]

Return a list of tuples (c, w) where: c: is the column name and index w: is the column width

getObjectActions(obj)[source]

Return a list of tuples (key, action) were keys are the string options that will be display in the context menu and the actions are the functions to call when the specific action is selected. The first action in the list will be taken as the default one when the element is double-clicked.

getObjectInfo(obj)[source]

This function will be called by the Tree with each object that will be inserted. A dictionary should be returned with the possible following entries: ‘key’: the key value to insert in the Tree ‘text’: text of the object to be displayed

(if not passed the ‘key’ will be used)

‘image’: image path to be displayed as icon (optional) ‘parent’: the object’s parent in which insert this object (optional) ‘tags’: list of tags names (optional)

static getObjectLabel(obj, parent)[source]

We will try to show in the list the string representation that is more readable for the user to pick the desired object.

static getObjectPreview(obj)[source]

Should return a tuple (img, desc), where img is the preview image and desc the description string.

getObjects()[source]

Return the objects that will be inserted in the Tree

class pyworkflow.gui.project.viewprotocols.RunsTreeProvider(project, actionFunc)[source]

Bases: pyworkflow.gui.tree.ProjectRunsTreeProvider

Provide runs info to populate tree

getActionsFromSelection()[source]

Return the list of options available for selection.

getObjectActions(obj)[source]

Return a list of tuples (key, action) were keys are the string options that will be display in the context menu and the actions are the functions to call when the specific action is selected. The first action in the list will be taken as the default one when the element is double-clicked.

class pyworkflow.gui.project.viewprotocols.SearchProtocolWindow(parentWindow, **kwargs)[source]

Bases: pyworkflow.gui.gui.Window

class pyworkflow.gui.project.viewprotocols.StepsTreeProvider(stepsList)[source]

Bases: pyworkflow.gui.tree.TreeProvider

Create the tree elements for a Protocol run

static getObjectInfo(obj)[source]

This function will be called by the Tree with each object that will be inserted. A dictionary should be returned with the possible following entries: ‘key’: the key value to insert in the Tree ‘text’: text of the object to be displayed

(if not passed the ‘key’ will be used)

‘image’: image path to be displayed as icon (optional) ‘parent’: the object’s parent in which insert this object (optional) ‘tags’: list of tags names (optional)

static getObjectPreview(obj)[source]

Should return a tuple (img, desc), where img is the preview image and desc the description string.

getObjects()[source]

Return the objects that will be inserted in the Tree

class pyworkflow.gui.project.viewprotocols.StepsWindow(title, parentWindow, protocol, **args)[source]

Bases: pyworkflow.gui.browser.BrowserWindow

pyworkflow.gui.project.viewprotocols.inspectObj(obj, filename, prefix='', maxDeep=5, inspectDetail=2, memoryDict=None)[source]

Creates a .CSV file in the filename path with all its members and recursibely with a certain maxDeep, if maxDeep=0 means no maxDeep (untils all members are inspected).

inspectDetail can be:
  • 1: All attributes are shown
  • 2: All attributes are shown and iterable values are also inspected
prefix and memoryDict will be updated in the recursibe entries:
  • prefix is to compond the two first columns (DEEP and Tree)
  • memoryDict is a dictionary with the memory adress and an identifier