From d9af1262a2411dd3cd49459303d9880ab6686b79 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 11 Jun 2024 16:27:45 +0200 Subject: [PATCH] Also allow creating html files in Draw from jupyter notebook --- python/webgui.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/webgui.py b/python/webgui.py index d47db04b..90827532 100644 --- a/python/webgui.py +++ b/python/webgui.py @@ -389,6 +389,7 @@ def Draw(obj, *args, show=True, **kwargs): html = scene.GenerateHTML() display(HTML(html)) + return else: import webgui_jupyter_widgets as wjw from packaging.version import parse @@ -400,11 +401,9 @@ def Draw(obj, *args, show=True, **kwargs): scene.Draw( kwargs_with_defaults["width"], kwargs_with_defaults["height"] ) - return scene - else: - if "filename" in kwargs_with_defaults: - scene.GenerateHTML(filename=kwargs_with_defaults["filename"]) - return scene + if "filename" in kwargs_with_defaults: + scene.GenerateHTML(filename=kwargs_with_defaults["filename"]) + return scene def _DrawDocu(obj, *args, **kwargs):