Skip to content
Snippets Groups Projects
Commit d5f6e32f authored by Andrew Maclean's avatar Andrew Maclean
Browse files

Updating VTKImportsForPython.py

parent 02561d34
No related branches found
No related tags found
1 merge request!234Only allow specific imports for python 5
...@@ -94,22 +94,23 @@ def format_imports(imports): ...@@ -94,22 +94,23 @@ def format_imports(imports):
s += ',\n'.join(c_list) s += ',\n'.join(c_list)
s += '\n )' s += '\n )'
res.append(f'from vtkmodules.{module} import {s}') res.append(f'from vtkmodules.{module} import {s}')
additional_modules = ['vtkInteractionStyle', 'vtkRenderingFreeType', 'vtkRenderingOpenGL2', additional_modules = ['vtkInteractionStyle', 'vtkRenderingFreeType',
'vtkRenderingContextOpenGL2', 'vtkRenderingUI'] 'vtkRenderingContextOpenGL2', 'vtkRenderingOpenGL2', 'vtkRenderingVolumeOpenGL2',
'vtkRenderingUI']
comments = [ comments = [
'', '',
'# You may need to uncomment one or more of the following imports.', '# You may need to uncomment one or more of the following imports.',
'# If vtkRenderWindow is used and you want to use OpenGL,', '# If vtkRenderWindow is used and you want to use OpenGL,',
'# you also need the vtkRenderingOpenGL2 module.', '# you also need the vtkRenderingOpenGL2 module.',
'# If vtkRenderWindowInteractor is used,', '# If vtkRenderWindowInteractor is used, uncomment vtkInteractionStyle',
'# uncomment vtkRenderingUI and possibly vtkInteractionStyle',
'# If text rendering is used, uncomment vtkRenderingFreeType.', '# If text rendering is used, uncomment vtkRenderingFreeType.',
'' '#',
'# If using PyCharm, preface each one you select with this line:',
'# noinspection PyUnresolvedReferences',
'#',
] ]
res += comments res += comments
preface = '# noinspection PyUnresolvedReferences' for module in sorted(additional_modules):
for module in additional_modules:
res.append(preface)
res.append(f'# import vtkmodules.{module}') res.append(f'# import vtkmodules.{module}')
res.append('') res.append('')
return res return res
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment