pyworkflow.gui.project.variables module

Module for editing variables

class pyworkflow.gui.project.variables.EditVariableDialog(parent, title, variable: Variable, **kwargs)[source]

Bases: Dialog

Dialog to edit a variable

Initialize a dialog. Arguments:

parent – a parent window (the application window) title – the dialog title

**args accepts:

buttons – list of buttons tuples containing which buttons to display

apply()[source]

process the data This method is called automatically to process the data, after the dialog is destroyed. By default, it does nothing.

body(bodyFrame)[source]

create dialog body. return widget that should have initial focus. This method should be overridden, and is called by the __init__ method.

buttonClicked(e)[source]

Callback for when the wizard button has been clicked

validate()[source]

validate the data This method is called automatically to validate the data before the dialog is destroyed. By default, it always validates OK.

class pyworkflow.gui.project.variables.VariablesDialog(parent, **kwargs)[source]

Bases: ToolbarListDialog

This dialog will allow editing variables coming either from pyworkflow or the plugins

From kwargs: message: message tooltip to show when browsing. selected: the item that should be selected. validateSelectionCallback:

a callback function to validate selected items.

allowSelect: if set to False, the ‘Select’ button will not

be shown.

apply()[source]

process the data This method is called automatically to process the data, after the dialog is destroyed. By default, it does nothing.

class pyworkflow.gui.project.variables.VariablesTreeProvider[source]

Bases: TreeProvider

Populate Tree from Labels.

getColumns()[source]

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

getObjectInfo(variable: Variable)[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)

getObjects()[source]

Return the objects that will be inserted in the Tree