Connect it up.
Inelegant but functional.
This commit is contained in:
+16
-1
@@ -29,7 +29,7 @@ from inspect import getdoc
|
||||
from joy.joy import run
|
||||
from joy.library import HELP_TEMPLATE
|
||||
from joy.parser import Symbol
|
||||
from joy.utils.stack import stack_to_string
|
||||
from joy.utils.stack import iter_stack, stack_to_string
|
||||
from joy.utils.types import type_check
|
||||
from .utils import is_numerical
|
||||
|
||||
@@ -152,3 +152,18 @@ class StackDisplayWorld(World):
|
||||
if os.path.exists(self.filename):
|
||||
with open(self.filename, 'rb') as f:
|
||||
return pickle.load(f)
|
||||
|
||||
|
||||
class StackWorld(StackDisplayWorld):
|
||||
|
||||
viewer = None
|
||||
|
||||
def set_viewer(self, viewer):
|
||||
self.viewer = viewer
|
||||
|
||||
def print_stack(self):
|
||||
StackDisplayWorld.print_stack(self)
|
||||
if self.viewer:
|
||||
self.viewer.stack = list(iter_stack(self.stack))
|
||||
self.viewer._update()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user