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

Method end_session

IPython/core/history.py:772–785  ·  view source on GitHub ↗

Close the database session, filling in the end time and line count.

(self)

Source from the content-addressed store, hash-verified

770 self.session_number = cur.lastrowid
771
772 def end_session(self) -> None:
773 """Close the database session, filling in the end time and line count."""
774 self.writeout_cache()
775 with self.db:
776 self.db.execute(
777 """UPDATE sessions SET end=?, num_cmds=? WHERE
778 session==?""",
779 (
780 datetime.datetime.now(datetime.timezone.utc).isoformat(" "),
781 len(self.input_hist_parsed) - 1,
782 self.session_number,
783 ),
784 )
785 self.session_number = 0
786
787 def name_session(self, name: str) -> None:
788 """Give the current session a name in the history database."""

Callers 7

resetMethod · 0.95
_atexit_onceMethod · 0.80
test_historyFunction · 0.80
test_calling_run_cellFunction · 0.80

Calls 2

writeout_cacheMethod · 0.95
executeMethod · 0.80