Skip to content

Commit

Permalink
fix: work with master of nbconvert (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Mar 22, 2019
1 parent 3136a7b commit f045493
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions voila/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ def clear_output(self, outs, msg, cell_index):
self.outputs = []
# sync back the state to the kernel
self.sync_state()
# sync the state to the nbconvert state as well, since that is used for testing
self.executor.widget_state[self.comm_id]['outputs'] = self.outputs
if hasattr(self.executor, 'widget_state'):
# sync the state to the nbconvert state as well, since that is used for testing
self.executor.widget_state[self.comm_id]['outputs'] = self.outputs

def sync_state(self):
state = {'outputs': self.outputs}
Expand Down Expand Up @@ -54,8 +55,9 @@ def output(self, outs, msg, display_id, cell_index):
output = {"output_type": "display_data", "data": data, "metadata": {}}
self.outputs.append(output)
self.sync_state()
# sync the state to the nbconvert state as well, since that is used for testing
self.executor.widget_state[self.comm_id]['outputs'] = self.outputs
if hasattr(self.executor, 'widget_state'):
# sync the state to the nbconvert state as well, since that is used for testing
self.executor.widget_state[self.comm_id]['outputs'] = self.outputs

def set_state(self, state):
if 'msg_id' in state:
Expand Down

0 comments on commit f045493

Please sign in to comment.