MCPcopy Create free account
hub / github.com/ipython/ipython / new_session

Method new_session

IPython/core/history.py:562–570  ·  view source on GitHub ↗

Get a new session number.

(self, conn=None)

Source from the content-addressed store, hash-verified

560
561 @needs_sqlite
562 def new_session(self, conn=None):
563 """Get a new session number."""
564 if conn is None:
565 conn = self.db
566
567 with conn:
568 cur = conn.execute("""INSERT INTO sessions VALUES (NULL, ?, NULL,
569 NULL, "") """, (datetime.datetime.now(),))
570 self.session_number = cur.lastrowid
571
572 def end_session(self):
573 """Close the database session, filling in the end time and line count."""

Callers 3

__init__Method · 0.95
resetMethod · 0.95
writeout_cacheMethod · 0.95

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected