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)
| 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): |