Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VTK Examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VTK
VTK Examples
Commits
d5f6e32f
Commit
d5f6e32f
authored
3 years ago
by
Andrew Maclean
Browse files
Options
Downloads
Patches
Plain Diff
Updating VTKImportsForPython.py
parent
02561d34
No related branches found
Branches containing commit
No related tags found
1 merge request
!234
Only allow specific imports for python 5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Python/Utilities/VTKImportsForPython.py
+9
-8
9 additions, 8 deletions
src/Python/Utilities/VTKImportsForPython.py
with
9 additions
and
8 deletions
src/Python/Utilities/VTKImportsForPython.py
+
9
−
8
View file @
d5f6e32f
...
...
@@ -94,22 +94,23 @@ def format_imports(imports):
s
+=
'
,
\n
'
.
join
(
c_list
)
s
+=
'
\n
)
'
res
.
append
(
f
'
from vtkmodules.
{
module
}
import
{
s
}
'
)
additional_modules
=
[
'
vtkInteractionStyle
'
,
'
vtkRenderingFreeType
'
,
'
vtkRenderingOpenGL2
'
,
'
vtkRenderingContextOpenGL2
'
,
'
vtkRenderingUI
'
]
additional_modules
=
[
'
vtkInteractionStyle
'
,
'
vtkRenderingFreeType
'
,
'
vtkRenderingContextOpenGL2
'
,
'
vtkRenderingOpenGL2
'
,
'
vtkRenderingVolumeOpenGL2
'
,
'
vtkRenderingUI
'
]
comments
=
[
''
,
'
# You may need to uncomment one or more of the following imports.
'
,
'
# If vtkRenderWindow is used and you want to use OpenGL,
'
,
'
# you also need the vtkRenderingOpenGL2 module.
'
,
'
# If vtkRenderWindowInteractor is used,
'
,
'
# uncomment vtkRenderingUI and possibly vtkInteractionStyle
'
,
'
# If vtkRenderWindowInteractor is used, uncomment vtkInteractionStyle
'
,
'
# If text rendering is used, uncomment vtkRenderingFreeType.
'
,
''
'
#
'
,
'
# If using PyCharm, preface each one you select with this line:
'
,
'
# noinspection PyUnresolvedReferences
'
,
'
#
'
,
]
res
+=
comments
preface
=
'
# noinspection PyUnresolvedReferences
'
for
module
in
additional_modules
:
res
.
append
(
preface
)
for
module
in
sorted
(
additional_modules
):
res
.
append
(
f
'
# import vtkmodules.
{
module
}
'
)
res
.
append
(
''
)
return
res
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment