pyworkflow.project.config module

class pyworkflow.project.config.Label(name='', color=None)[source]

Bases: Scalar

Store Label information

EMPTY_OLD_NAME = None
clearOldName()[source]
get()[source]

Get the value, if internal value is None the default argument passed is returned.

getColor() str[source]
getName() str[source]
getObjValue()[source]

Return the internal value for storage. This is a good place to do some update of the internal value before been stored

getOldName() str[source]
hasOldName() bool[source]
setColor(color)[source]
setName(newName)[source]
class pyworkflow.project.config.LabelsList[source]

Bases: List

Store all labels information

addLabel(label)[source]
clear()[source]

Remove all items from list.

deleteLabel(label)[source]
getLabel(name)[source]
updateDict()[source]
class pyworkflow.project.config.MenuConfig(text=None, value=None, icon=None, tag=None, shortCut=None, openItem=False, visible=True)[source]

Bases: object

Menu configuration in a tree fashion. Each menu can contain submenus. Leaf elements can contain actions

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, **args)[source]
isEmpty()[source]
class pyworkflow.project.config.NodeConfig(nodeId=0, x=None, y=None, selected=False, expanded=True, visible=True)[source]

Bases: Scalar

Store Graph node information such as x, y.

get()[source]

Get the value, if internal value is None the default argument passed is returned.

getId()[source]
getLabels()[source]
getObjValue()[source]

Return the internal value for storage. This is a good place to do some update of the internal value before been stored

getPosition()[source]
getX()[source]
getY()[source]
isExpanded()[source]
isSelected()[source]
isVisible()[source]
setExpanded(expanded)[source]
setLabels(labels)[source]
setPosition(x, y)[source]
setSelected(selected)[source]
setVisible(visible)[source]
setX(x)[source]
setY(y)[source]
class pyworkflow.project.config.NodeConfigList[source]

Bases: List

Store all nodes information items and also store a dictionary for quick access to nodes query.

addNode(nodeId, **kwargs)[source]
clear()[source]

Remove all items from list.

getNode(nodeId)[source]
removeNode(nodeId)[source]

Removes a node with the id = nodeId

updateDict()[source]
class pyworkflow.project.config.ProjectSettings(confs={}, **kwargs)[source]

Bases: Object

Store settings related to a project.

COLOR_MODES = (0, 1, 2, 3)
COLOR_MODE_AGE = 2
COLOR_MODE_LABELS = 1
COLOR_MODE_SIZE = 3
COLOR_MODE_STATUS = 0
addNode(nodeId, **kwargs)[source]
ageColorMode()[source]
cleanUpNodes(runsIds, toRemove=True)[source]

This will clean up all the nodes that do not have a matching run. This is because until now, the nodes here weren’t removes when protocols were removed.

Parameters
  • runsIds – iterable with protocol’s objId to be removed.

  • toRemove – Passed is are to be removed. Otherwise, are the ones to keep

commit()[source]

Commit changes made.

getColorMode()[source]
getCreationTime()[source]
getLabels()[source]
getLifeTime()[source]
getNodeById(nodeId)[source]
getNodes()[source]
getProtocolView()[source]
getReadOnly()[source]
getRunsView()[source]
labelsColorMode()[source]
classmethod load(dbPath)[source]

Load a ProjectSettings from dbPath.

removeNode(nodeId)[source]

Removes a graphical node based on its id

setColorMode(colorMode)[source]

Set the color mode to use when drawing the graph.

setCreationTime(value)[source]
setLifeTime(value)[source]
setProtocolView(protocolView)[source]

Set the new protocol Menu given its index. The new ProtocolMenu will be returned.

setReadOnly(value)[source]
setRunsView(value)[source]
sizeColorMode()[source]
statusColorMode()[source]
write(dbPath=None)[source]