pyworkflow.gui.project.viewprotocols_extra module

This modules hosts most of the accessory code that is used in view protocols

class pyworkflow.gui.project.viewprotocols_extra.ProtocolConfig(text=None, value=None, **args)[source]

Bases: MenuConfig

Store protocols configuration

Constructor for the Menu config item. Arguments:

text: text to be displayed value: internal value associated with the item. icon: display an icon with the item tag: put some tags to items

**args: pass other options to base class.

addSubMenu(text, value=None, shortCut=None, **args)[source]
class pyworkflow.gui.project.viewprotocols_extra.ProtocolTreeConfig[source]

Bases: object

Handler class that groups functions and constants related to the protocols tree configuration.

ALL_PROTOCOLS = 'All'
PLUGIN_CONFIG_PROTOCOLS = 'protocols.conf'
TAG_PROTOCOL = 'protocol'
TAG_PROTOCOL_BETA = 'protocol_beta'
TAG_PROTOCOL_DISABLED = 'protocol-disabled'
TAG_PROTOCOL_GROUP = 'protocol_group'
TAG_PROTOCOL_NEW = 'protocol_new'
TAG_PROTOCOL_UPDATED = 'protocol_updated'
TAG_SECTION = 'section'
classmethod getProtocolTag(isInstalled, isBeta=False, isNew=False, isUpdated=False)[source]

Return the proper tag depending if the protocol is installed or not.

classmethod load(domain, protocolsConf)[source]

Read the protocol configuration from a .conf file similar to the one in scipion/config/protocols.conf, which is the default one when no file is passed.

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

Bases: TreeProvider

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

Parameters
  • parent

  • protocol

  • mapper

  • loggerCallback – method to call to log events in the gui.

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