Skip to content

Commit

Permalink
docs(examples): update example
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Oct 10, 2023
1 parent bde6704 commit a6eafc7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions examples/06_vtk/Applications/VTPViewer/app.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
r"""
Version for trame 1.x - https://github.com/Kitware/trame/blob/release-v1/examples/VTK/Applications/VTPViewer/app.py
Delta v1..v2 - https://github.com/Kitware/trame/commit/8d7fd7d3f11360637315f61ec8c66154d3b1af69
Installation requirements:
pip install trame trame-vuetify trame-vtk trame-components
"""

from trame.app import get_server
from trame.ui.vuetify import SinglePageLayout
from trame.widgets import vuetify, trame, vtk as vtk_widgets
from trame.app.file_upload import ClientFile

from vtkmodules.vtkIOXML import vtkXMLPolyDataReader
from vtkmodules.web.utils import mesh as vtk_mesh
Expand Down Expand Up @@ -42,9 +40,10 @@ def load_client_files(files, **kwargs):
return

for file in files:
print(f'Load {file.get("name")}')
bytes = file.get("content")
filesOutput.append({"name": file.get("name"), "size": file.get("size")})
file = ClientFile(file)
print(f"Load {file.name}")
bytes = file.content
filesOutput.append({"name": file.name, "size": file.size})
reader = vtkXMLPolyDataReader()
reader.ReadFromInputStringOn()
reader.SetInputString(bytes)
Expand Down

0 comments on commit a6eafc7

Please sign in to comment.