Close the database session, filling in the end time and line count.
(self)
| 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.""" |
| 574 | self.writeout_cache() |
| 575 | with self.db: |
| 576 | self.db.execute("""UPDATE sessions SET end=?, num_cmds=? WHERE |
| 577 | session==?""", (datetime.datetime.now(), |
| 578 | len(self.input_hist_parsed)-1, self.session_number)) |
| 579 | self.session_number = 0 |
| 580 | |
| 581 | def name_session(self, name): |
| 582 | """Give the current session a name in the history database.""" |