Commit 5ab44fb6 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Make `vtk` pseudo-package.

`vtk` module now acts as a package thus allowing access to other modules
in the `vtkmodules` package, besides importing everything from
`vtkmodules.all` module.

This ensures that all scripts using the `vtk` package continues to work
seamlessly.
parent 1b707373
"""This is the vtk module."""
import sys, importlib
vtkmodules = importlib.import_module("vtkmodules")
vtkmodules_all = importlib.import_module("vtkmodules.all")
# merge components from `all` to `vtkmodules` package.
for key in dir(vtkmodules_all):
if not hasattr(vtkmodules, key):
setattr(vtkmodules, key, getattr(vtkmodules_all, key))
from vtkmodules.all import *
# replace ourselves with the `vtkmodules` package. This is essential
# to ensure the importing of other modules/packages from `vtkmodules`
# works seamlessly when accessed via `vtk` pseudo-package.
sys.modules[__name__] = vtkmodules
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment