diff --git a/setup.py b/setup.py index a0910e5..49a0264 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="schulich-ignite", - version="0.0.9", + version="0.0.10", author="Schulich Ignite", author_email="info@shulichignite.com", description="Spark library for Shulich Ignite sessions", @@ -16,6 +16,7 @@ classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", + "Framework :: IPython", "Operating System :: OS Independent", ], python_requires='>=3.8', diff --git a/spark/core.py b/spark/core.py index fbae40e..fd31a6a 100644 --- a/spark/core.py +++ b/spark/core.py @@ -23,7 +23,7 @@ _sparkplug_active_thread_id = None _sparkplug_last_activity = 0 -_sparkplug_running = True +_sparkplug_running = False class Core: @@ -60,6 +60,7 @@ def __init__(self, globals_dict): self.stop_button.on_click(self.on_stop_button_clicked) self.canvas = Canvas() + self.output_text = "" self.width, self.height = DEFAULT_CANVAS_SIZE self.mouse_x = 0 self.mouse_y = 0 @@ -130,7 +131,6 @@ def start(self, methods): display(self.canvas) - self.output_text = "" self.output_text_code = display(Code(self.output_text), display_id=True) self.canvas.on_mouse_down(self.on_mouse_down) @@ -195,8 +195,11 @@ def print_status(self, msg): # Prints output to embedded output box def print(self, msg): + global _sparkplug_running self.output_text += msg + "\n" - self.output_text_code.update(Code(self.output_text)) + + if _sparkplug_running: + self.output_text_code.update(Code(self.output_text)) # Update mouse_x, mouse_y, and call mouse_down handler def on_mouse_down(self, x, y):