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

def end_session(self):

    self.writeout_cache()
    with self.db:
        self.db.execute('UPDATE    sessions    SET    end=?,    num_cmds=?    WHERE\n                                                                                                                session==?', (datetime.datetime.now(), (len(self.input_hist_parsed) - 1), self.session_number))
    self.session_number = 0
