Skip to content

Commit e7fa073

Browse files
authored
Merge pull request #19 from Schulich-Ignite/radu/last-minute-bugs
Fixed print() error
2 parents cf5caf3 + 4656622 commit e7fa073

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="schulich-ignite",
8-
version="0.0.9",
8+
version="0.0.10",
99
author="Schulich Ignite",
1010
author_email="info@shulichignite.com",
1111
description="Spark library for Shulich Ignite sessions",
@@ -16,6 +16,7 @@
1616
classifiers=[
1717
"Programming Language :: Python :: 3",
1818
"License :: OSI Approved :: MIT License",
19+
"Framework :: IPython",
1920
"Operating System :: OS Independent",
2021
],
2122
python_requires='>=3.8',

spark/core.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
_sparkplug_active_thread_id = None
2525
_sparkplug_last_activity = 0
26-
_sparkplug_running = True
26+
_sparkplug_running = False
2727

2828

2929
class Core:
@@ -60,6 +60,7 @@ def __init__(self, globals_dict):
6060
self.stop_button.on_click(self.on_stop_button_clicked)
6161

6262
self.canvas = Canvas()
63+
self.output_text = ""
6364
self.width, self.height = DEFAULT_CANVAS_SIZE
6465
self.mouse_x = 0
6566
self.mouse_y = 0
@@ -130,7 +131,6 @@ def start(self, methods):
130131

131132
display(self.canvas)
132133

133-
self.output_text = ""
134134
self.output_text_code = display(Code(self.output_text), display_id=True)
135135

136136
self.canvas.on_mouse_down(self.on_mouse_down)
@@ -195,8 +195,11 @@ def print_status(self, msg):
195195

196196
# Prints output to embedded output box
197197
def print(self, msg):
198+
global _sparkplug_running
198199
self.output_text += msg + "\n"
199-
self.output_text_code.update(Code(self.output_text))
200+
201+
if _sparkplug_running:
202+
self.output_text_code.update(Code(self.output_text))
200203

201204
# Update mouse_x, mouse_y, and call mouse_down handler
202205
def on_mouse_down(self, x, y):

0 commit comments

Comments
 (0)