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

Method get_session_info

IPython/core/history.py:307–331  ·  view source on GitHub ↗

Get info about a session. Parameters ---------- session : int Session number to retrieve. Returns ------- session_id : int Session ID number start : datetime Timestamp for the start of the session.

(self, session)

Source from the content-addressed store, hash-verified

305 @needs_sqlite
306 @catch_corrupt_db
307 def get_session_info(self, session):
308 """Get info about a session.
309
310 Parameters
311 ----------
312
313 session : int
314 Session number to retrieve.
315
316 Returns
317 -------
318
319 session_id : int
320 Session ID number
321 start : datetime
322 Timestamp for the start of the session.
323 end : datetime
324 Timestamp for the end of the session, or None if IPython crashed.
325 num_cmds : int
326 Number of commands run, or None if IPython crashed.
327 remark : unicode
328 A manually set description.
329 """
330 query = "SELECT * from sessions where session == ?"
331 return self.db.execute(query, (session,)).fetchone()
332
333 @catch_corrupt_db
334 def get_last_session_id(self):

Callers

nothing calls this directly

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected