MeVisLab Scripting Reference
MLABModuleDependency Class Reference

#include <mlabModuleDependencyAnalyzer.h>

Inherits QObject.

Public Slots

Scripting access.


QVariantMap getModuleDependencies (QStringList ignoredPackages=QStringList(), QStringList ignoredLibraryIncludes=QStringList(), bool addOnMode=false)
 
QVariantMap getDependenciesByModule ()
 
QVariantMap getModulesByDependencies ()
 
MLABModuleDependencyweb ()
 

Detailed Description

The MLABModuleDependency object is available via MLAB.

The MLABModuleDependency object contains the dependency information of modules. It is created by MLAB.getModuleDependency(moduleNames):

py> moduleNames = ["ImageLoad", "View2D"]
py> moduleDependency = MLAB.getModuleDependency(moduleNames)
Access to all global functions and objects of MLAB.
Definition mlabGlobalScriptAccess.h:79
MLABModuleDependency * getModuleDependency(const QStringList &moduleNames, bool includeModuleDirectories=true, bool includeWebContents=false, bool includeModuleHelpFiles=false, MLABNetwork *scannedNetwork=nullptr)
Returns an MLABModuleDependency object for accessing the dependency data.

The dependency information is accessible by these two functions:

The first one returns a dictionary of dependencies sorted by module names. The structure is:

{module_name_0:
{
dlls: [dll0, ..., dllN],
pythondlls: [dll0, ..., dllN],
dirs: [dir0, ..., dirN],
module: [module0, ..., moduleN],
files: [file0, ..., fileN],
scriptFiles: [file0, ..., fileN],
pythonScriptFiles: [file0, ..., fileN],
javaScriptFiles: [file0, ..., fileN],
},
...
module_name_N: ...
}

Example
The following code shows how to get the dependencies of View2D and how to list the dependencies of the required module View2DExtensions:

py> import pprint
py> moduleNames = ["View2D"]
py> moduleDependency = MLAB.getModuleDependency(moduleNames)
py> dependenciesByModule = moduleDependency.getDependenciesByModule()
py> pprint.pprint(d.getDependenciesByModule().keys())
[u'SoGroup',
u'SoView2DAutoCenter',
u'SoRLLookUpTable',
u'SoToggle',
u'SoView2D',
u'SoView2DVoxelValue',
u'View2D',
u'SoSeparator',
u'SoView2DSliceZoom',
u'View2DExtensions',
u'SoView2DAnnotation',
u'SoView2DSliceShift',
u'SoView2DSlicer',
u'SoView2DPosition',
u'VoxValueRescale',
u'SoView2DBorder',
u'SoMouseGrabber']
py> pprint.pprint(dependenciesByModule["View2DExtensions"])
{u'dirs': (u'MLAB_ROOT/MeVisLab/Standard/Modules/Macros/Viewers',),
u'dlls': (),
u'files': (u'MLAB_ROOT/MeVisLab/Standard/Modules/Macros/Viewers/examples/View2DExtensionsExample.mlab',
u'MLAB_ROOT/MeVisLab/Standard/Modules/Macros/Viewers/viewers.def',
u'MLAB_ROOT/MeVisLab/Standard/Modules/Macros/Viewers/View2DExtensions.script'),
u'modules': (u'SoView2DPosition',
u'SoView2DSliceShift',
u'SoView2DAnnotation',
u'SoRLLookUpTable',
u'SoMouseGrabber',
u'SoView2DSlicer',
u'SoToggle',
u'SoView2DBorder',
u'SoGroup',
u'SoView2DAutoCenter',
u'SoView2DSliceZoom',
u'VoxValueRescale',
u'SoView2DVoxelValue'),
u'pythondlls': (),
u'scriptFiles': (u'MLAB_ROOT/MeVisLab/Standard/Modules/Macros/Viewers/View2DExtensions.py',)}
QVariantMap getDependenciesByModule()
Returns dependencies by module.

The second access function MLABModuleDependency.getModulesByDependencies() returns the inverse structure: a dictionary of modules sorted by dependencies. The structure is:

{ modulesByDll: { dll0: [module0, ..., moduleN], ..., dllN: [module0, ..., moduleN] },
modulesByPythonDll: { dll0: [module0, ..., moduleN], ..., dllN: [module0, ..., moduleN] },
modulesByDirectory: { dir0: [module0, ..., moduleN], ..., dirN: [module0, ..., moduleN] },
modulesByModule: { module0: [module0, ..., moduleN], ..., moduleN: [module0, ..., moduleN] },
modulesByFile: { file0: [module0, ..., moduleN], ..., fileN: [module0, ..., moduleN] },
modulesByScriptFile: { file0: [module0, ..., moduleN], ..., fileN: [module0, ..., moduleN] }
}

Example
This code shows how to find out which modules depend on the view2D.def file:

py> import pprint
py> moduleNames = ["View2D"]
py> moduleDependency = MLAB.getModuleDependency(moduleNames)
py> modulesByDependencies = moduleDependency.getModulesByDependencies()
py> pprint.pprint(modulesByDependencies["modulesByFile"]["MLAB_ROOT/MeVisLab/Standard/Modules/Inventor/SoView2D/view2d.def"])
(u'SoView2DPosition',
u'SoView2DSliceShift',
u'SoView2DAnnotation',
u'SoView2DSlicer',
u'SoView2DBorder',
u'SoView2DAutoCenter',
u'SoView2DSliceZoom',
u'SoView2D',
u'SoView2DVoxelValue')
QVariantMap getModulesByDependencies()
Returns the modules by dependency.

Member Function Documentation

◆ getDependenciesByModule

QVariantMap MLABModuleDependency::getDependenciesByModule ( )
slot

Returns dependencies by module.

◆ getModuleDependencies

QVariantMap MLABModuleDependency::getModuleDependencies ( QStringList ignoredPackages = QStringList(),
QStringList ignoredLibraryIncludes = QStringList(),
bool addOnMode = false )
slot

Returns all dependencies.

◆ getModulesByDependencies

QVariantMap MLABModuleDependency::getModulesByDependencies ( )
slot

Returns the modules by dependency.

◆ web

MLABModuleDependency * MLABModuleDependency::web ( )
slot

Returns the web dependencies.