Skip to content

Commit

Permalink
Merge pull request #19 from Schulich-Ignite/radu/last-minute-bugs
Browse files Browse the repository at this point in the history
Fixed print() error
  • Loading branch information
raduschirliu authored Oct 17, 2020
2 parents cf5caf3 + 4656622 commit e7fa073
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="schulich-ignite",
version="0.0.9",
version="0.0.10",
author="Schulich Ignite",
author_email="[email protected]",
description="Spark library for Shulich Ignite sessions",
Expand All @@ -16,6 +16,7 @@
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Framework :: IPython",
"Operating System :: OS Independent",
],
python_requires='>=3.8',
Expand Down
9 changes: 6 additions & 3 deletions spark/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

_sparkplug_active_thread_id = None
_sparkplug_last_activity = 0
_sparkplug_running = True
_sparkplug_running = False


class Core:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e7fa073

Please sign in to comment.