capsul.qt_apps module

Graphical applications. This section is normally not meant to be real function / class 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

capsul.qt_apps.pipeline_viewer_app submodule

capsul.qt_apps.utils submodule

capsul.qt_apps.utils.application submodule

Classes

Application

EmittingStream

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

Base Application 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 example: >>> 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

fill_treectrl()

add_tree_nodes()

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

find_pipelines_from_description()

find_pipeline_and_process()

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 split module names to a hierarchic dictionary with list leafs that contain the url to the module documentation.

Parameters:
  • list_of_pipeline_description (list of list of str (mandatory)) – the split module names to organize by 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.