MCPcopy Index your code
hub / github.com/ipython/ipython / store_output

Method store_output

IPython/core/history.py:1028–1048  ·  view source on GitHub ↗

If database output logging is enabled, this saves all the outputs from the indicated prompt number to the database. It's called by run_cell after code has been executed. Parameters ---------- line_num : int The line number from which to save outpu

(self, line_num: int)

Source from the content-addressed store, hash-verified

1026 self.shell.push(to_main, interactive=False)
1027
1028 def store_output(self, line_num: int) -> None:
1029 """If database output logging is enabled, this saves all the
1030 outputs from the indicated prompt number to the database. It's
1031 called by run_cell after code has been executed.
1032
1033 Parameters
1034 ----------
1035 line_num : int
1036 The line number from which to save outputs
1037 """
1038 if (not self.db_log_output) or (line_num not in self.output_hist_reprs):
1039 return
1040 lnum: int = line_num
1041 output = self.output_hist_reprs[line_num]
1042
1043 with self.db_output_cache_lock:
1044 self.db_output_cache.append((line_num, output))
1045 if self.db_cache_size <= 1 and self.using_thread:
1046 self._restart_thread_if_stopped()
1047 if self.save_flag is not None:
1048 self.save_flag.set()
1049
1050 def _writeout_input_cache(self, conn: sqlite3.Connection) -> None:
1051 with conn:

Callers 2

run_cell_asyncMethod · 0.80
test_historyFunction · 0.80

Calls 2

setMethod · 0.80

Tested by 1

test_historyFunction · 0.64