pyworkflow.viewer module

class pyworkflow.viewer.CommandView(cmd, **kwargs)[source]

Bases: View

View for calling an external command.

show()[source]

This method should be overwritten to implement how this particular view will be displayed in desktop.

class pyworkflow.viewer.MessageView(msg, title='', msgType=0, tkParent=None, **kwargs)[source]

Bases: View

View for some message.

getMessage()[source]
show()[source]

This method should be overwritten to implement how this particular view will be displayed in desktop.

class pyworkflow.viewer.ProtocolViewer(**kwargs)[source]

Bases: Viewer, Protocol

Special kind of viewer that have a Form to organize better complex visualization associated with protocol results. If should provide a mapping between form params and the corresponding functions that will return the corresponding Views.

getTkRoot()[source]
getWindow()[source]
setProtocol(protocol)[source]

Set the protocol instance to the viewer and call the definition of the parameters.

validateInstallation()[source]

Check if the installation of this protocol is correct. By default, we will check if the protocols’ package provide a validateInstallation function and use it. Returning an empty list means that the installation is correct and there are not errors. If some errors are found, a list with the error messages will be returned.

visualize(obj, **args)[source]

Open the Protocol GUI Form given a Protocol instance

class pyworkflow.viewer.TextView(filelist, title='', tkParent=None, **kwargs)[source]

Bases: View

View for display some text file.

getFileList()[source]
show()[source]

This method should be overwritten to implement how this particular view will be displayed in desktop.

class pyworkflow.viewer.View[source]

Bases: object

Represents a visualization result for some object or file. Views can be plots, table views, chimera scripts, commands or messages.

show()[source]

This method should be overwritten to implement how this particular view will be displayed in desktop.

toUrl()[source]

If the view have web implementation, this method should be implemented to build the url with parameters that will be used to respond.

class pyworkflow.viewer.Viewer(tmpPath='./Tmp', **args)[source]

Bases: object

A Viewer will provide several Views to visualize the data associated to data objects or protocol.

The _targets class property should contain a list of string with the class names that this viewer is able to visualize. For example: _targets = [‘Image’, ‘SetOfImages’]

controlPressed()[source]
errorList(errors, views, title='Visualization errors')[source]

Convert an error list in a single Error message.

errorMessage(msg, title='')[source]

Build a message View of type INFO.

getKeyPressed()[source]
classmethod getName()[source]
getParent()[source]

Get the Tk parent widget.

getProject()[source]
getProtocolId()[source]
getTkRoot()[source]
getView()[source]

This method should return the string value of the view in web that will respond to this viewer. This method only should be implemented in those viewers that have WEB_DJANGO environment defined.

infoMessage(msg, title='')[source]

Build a message View of type INFO.

setProject(project)[source]
shiftPressed()[source]
textView(filelist, title='')[source]
tkWindow(windowClass, **kwargs)[source]
visualize(obj, **kwargs)[source]

Display each of the views, by default the implementation is for desktop.

warnMessage(msg, title='')[source]

Build a message View of type INFO.