From 0ea4a0c44bd8629c6d98fb3ccb2d113aafb36de8 Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Fri, 21 Jul 2023 15:59:11 -0600 Subject: [PATCH] fix(trame): Update to support trame v3 --- README.rst | 9 +++++++++ peacock_trame/__init__.py | 7 +++---- peacock_trame/app/__main__.py | 4 ++++ peacock_trame/app/main.py | 3 +++ setup.cfg | 5 ++++- 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 peacock_trame/app/__main__.py diff --git a/README.rst b/README.rst index 4e44d96..4b2c3d5 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,15 @@ peacock-trame MOOSE GUI developed using Trame from Kitware Inc. +- `Blog post `_ +- `Video `_ + +|image_1| + +.. |image_1| image:: https://www.kitware.com/main/wp-content/uploads/2023/06/image1-1-1024x601.png + :width: 50% + + License ----------------------------------------------------------- diff --git a/peacock_trame/__init__.py b/peacock_trame/__init__.py index 8f568b0..035ab7c 100644 --- a/peacock_trame/__init__.py +++ b/peacock_trame/__init__.py @@ -1,5 +1,4 @@ -from .app import main +import os -__all__ = [ - "main", -] +# Disable warning +os.environ["TRAME_DISABLE_V3_WARNING"] = "1" diff --git a/peacock_trame/app/__main__.py b/peacock_trame/app/__main__.py new file mode 100644 index 0000000..40e2b01 --- /dev/null +++ b/peacock_trame/app/__main__.py @@ -0,0 +1,4 @@ +from .main import main + +if __name__ == "__main__": + main() diff --git a/peacock_trame/app/main.py b/peacock_trame/app/main.py index d2f5855..1151bb9 100644 --- a/peacock_trame/app/main.py +++ b/peacock_trame/app/main.py @@ -160,6 +160,9 @@ def main(server=None, **kwargs): if isinstance(server, str): server = get_server(server) + # Set client type + server.client_type = "vue2" + # parse args parser = server.cli parser.add_argument("-I", "--input", help="Input file (.i)") diff --git a/setup.cfg b/setup.cfg index d1d8ef9..431ed48 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,13 +28,16 @@ packages = find: include_package_data = True install_requires = trame + trame-vuetify + trame-vtk trame-xterm + trame-simput pyaml numpy # come with ParaView [options.entry_points] console_scripts = - peacock-trame = peacock_trame:main + peacock-trame = peacock_trame.app:main jupyter_serverproxy_servers = peacock-trame = peacock_trame.app.jupyter:jupyter_proxy_info