Skip to content

Commit

Permalink
Added 'store_history' option to 'preprocess_cell' and 'run_cell' meth…
Browse files Browse the repository at this point in the history
…ods of ExecutePreprocessor.
  • Loading branch information
wwitzel committed Jun 26, 2019
1 parent 5134ca2 commit 40989d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nbconvert/preprocessors/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def set_widgets_metadata(self):
if buffers:
widget['buffers'] = buffers

def preprocess_cell(self, cell, resources, cell_index):
def preprocess_cell(self, cell, resources, cell_index, store_history=True):
"""
Executes a single code cell. See base.py for details.
Expand All @@ -435,7 +435,7 @@ def preprocess_cell(self, cell, resources, cell_index):
if cell.cell_type != 'code' or not cell.source.strip():
return cell, resources

reply, outputs = self.run_cell(cell, cell_index)
reply, outputs = self.run_cell(cell, cell_index, store_history)
# Backwards compatibility for processes that wrap run_cell
cell.outputs = outputs

Expand Down Expand Up @@ -542,9 +542,9 @@ def _passed_deadline(self, deadline):
return True
return False

def run_cell(self, cell, cell_index=0):
parent_msg_id = self.kc.execute(
cell.source, stop_on_error=not self.allow_errors)
def run_cell(self, cell, cell_index=0, store_history=True):
parent_msg_id = self.kc.execute(cell.source,
store_history=store_history, stop_on_error=not self.allow_errors)
self.log.debug("Executing cell:\n%s", cell.source)
exec_timeout = self._get_timeout(cell)
deadline = None
Expand Down

0 comments on commit 40989d8

Please sign in to comment.