capsul.qt_apps module

Inheritance diagram of capsul.qt_apps, capsul.qt_apps.main_window, capsul.qt_apps.pipeline_viewer_app, capsul.qt_apps.utils, capsul.qt_apps.utils.application, capsul.qt_apps.utils.fill_treectrl, capsul.qt_apps.utils.find_pipelines, capsul.qt_apps.utils.window

Graphical applications. This section is normally not meant to be real function / classe libraries but rather applications. There are a few widgets here, though, but it is not recommended to use them in custom applications.

capsul.qt_apps.main_window submodule

Classes

CapsulMainWindow

class capsul.qt_apps.main_window.CapsulMainWindow(pipeline_menu, ui_file, default_study_config=None)[source]

Capsul main window.

Method to initialize the Capsul main window class.

Parameters:
  • pipeline_menu (hierachic dict) – each key is a sub module of the module. Leafs contain a list with the url to the documentation.
  • ui_file (str (mandatory)) – a filename containing the user interface description
  • default_study_config (ordered dict (madatory)) – some parameters for the study configuration
add_controls_to_ui()[source]

Method to find dynamic controls

onBrowseClicked()[source]

Event to show / hide the browse dock widget.

onChangeViewClicked()[source]

Event to switch between simple and full pipeline views.

onCloseTabClicked(index)[source]

Event to close a pipeline view.

onCurrentTabChanged(index)[source]

Event to refresh the controller controller widget when a new tab is selected

onHelpClicked()[source]

Event to display the documentation of the active pipeline.

onLoadClicked()[source]

Event to load and display a pipeline.

onLoadSubPipelineClicked(name, sub_pipeline, modifiers)[source]

Event to load and display a sub pipeline.

onParametersClicked()[source]

Event to show / hide the parameters dock widget.

onQualityControlClicked()[source]

Event to show / hide the board dock widget.

onRunClicked()[source]

Event to execute the process/pipeline.

onRunStatus()[source]

Event to refresh the run button status.

When all the controller widget controls are correctly filled, enable the user to execute the pipeline.

onSearchClicked()[source]

Event to refresh the menu tree control that contains the pipeline modules.

onStudyConfigClicked()[source]

Event to show / hide the study config dock widget.

onTreeSelectionChanged()[source]

Event to refresh the pipeline load button status.

show()[source]

Shows the widget and its child widgets.

capsul.qt_apps.pipeline_viewer_app submodule

Classes

PipelineViewerApp

class capsul.qt_apps.pipeline_viewer_app.PipelineViewerApp(*args, **kwargs)[source]

CAPSULVIEW Application.

Method to initialize the PipelineViewerApp class.

init_window()[source]

Method to initialize the main window.

capsul.qt_apps.utils submodule

capsul.qt_apps.utils.application submodule

Classes

EmittingStream

class capsul.qt_apps.utils.application.Application(extra_options=None)[source]

Base Aplication class.

Used to set some user options

Method to initialize the Application class.

The capsulview application can be executed with command line options (that can also be passed to the class constructor as extra_options). From the command line, we can set the debug level with the -d option: * debug * info * warning * error * critical

For exemple: >>> capsulview -d debug

The default mode is error.

From the command line we can also redirect all messages to a graphical message box with the -r option: >>> capsulview -r

Parameters:extra_options (list (optional)) – some additional options that are not passed through the command line.
class capsul.qt_apps.utils.application.EmittingStream[source]

Logging emitting string basic handler.

capsul.qt_apps.utils.fill_treectrl submodule

Functions

search_in_menu()

capsul.qt_apps.utils.fill_treectrl.add_tree_nodes(parent_item, menu, match, parent_module='')[source]

Add the menu to tree control if match in current module name or child modules.

The match is insensitive to the cast.

Parameters:
  • parent_item (QTreeWidgetItem (mandatory)) – a tree control item where we want to insert the menu
  • menu (hierachic dict (mandatory)) – each key is a sub module of the module. Leafs contain a list with the url to the documentation.
  • match (str (mandatory)) – the string used to filter the menu items
  • parent_module (str (optional)) – the parent module string description (‘module.sub_module’)
capsul.qt_apps.utils.fill_treectrl.fill_treectrl(treectrl, menu, match='')[source]

Fill a tree control with the different menu items.

This procedure is able to filter the menu items. Loadable pipelines appear in bold in the tree control. Insert three elements (current module name, url, parent module name) When the url and then parent module name are different from ‘None’ we have reached a leaf that contain a pipeline description.

Parameters:
  • treectrl (QTreeControl (mandatory)) – the tree control where we want to insert the menu
  • menu (hierachic dict (mandatory)) – each key is a sub module of the module. Leafs contain a list with the url to the documentation.
  • match (str (optional)) – the string used to filter the menu items
capsul.qt_apps.utils.fill_treectrl.search_in_menu(menu, match)[source]

Recursive search in tree.

The search procedure is insensitive to the cast.

Parameters:
  • menu (hierachic dict (mandatory)) – each key is a sub module of the module. Leafs contain a list with the url to the documentation.
  • match (str (mandatory)) – the string used to filter the menu items
Returns:

is_included – True if we found match in the tree, False otherwise.

Return type:

bool

capsul.qt_apps.utils.find_pipelines submodule

Functions

lists2dict()

capsul.qt_apps.utils.find_pipelines.find_pipeline_and_process(module_name)[source]

Function that return all the Pipeline and Process classes of a module.

All the mdoule path are scanned recuresively. Any pipeline or process will be added to the output.

Parameters:module_name (str (mandatory)) – the name of the module we want to go through in order to find all pipeline classes.
Returns:output – a dictionary with a list of pipeline and process string descriptions found in the module.
Return type:dict
capsul.qt_apps.utils.find_pipelines.find_pipelines_from_description(module_name, url=None)[source]

Function that list all the pipeline of a module.

Parameters:
  • module_name (str (mandatory)) – the name of the module we want to go through in order to find all pipeline classes.
  • url (str (optional)) – the url to the module documentation.
Returns:

  • structured_pipelines (hierachic dict) – each key is a sub module of the module. Leafs contain a list with the url to the documentation.
  • pipelines (list) – a list a pipeline string descriptions.

capsul.qt_apps.utils.find_pipelines.lists2dict(list_of_pipeline_description, url, d)[source]

Convert a list of splited module names to a hierachic dictionary with list leafs that contain the url to the module docuementation.

Parameters:
  • list_of_pipeline_description (list of list of str (mandatory)) – the splited module names to organize bu modules
  • url (str (mandatory)) – the url to the module documentation
Returns:

d – each key is a sub module of the module. Leafs contain a list with the url to the documentation.

Return type:

hierachic dict

capsul.qt_apps.utils.window submodule

Classes

MyQUiLoader

class capsul.qt_apps.utils.window.MyQUiLoader(uifile)[source]

Base window class based on ui file description.

Method to initialize the base window.

Parameters:uifile (str (mandatory)) – a filename containing the user interface description.