def save_report(session):
<EOL>previous_reports = glob.glob(os.path.join(report_dir(), '<STR_LIT>'))<EOL>previous_reports.sort(reverse=True)<EOL>while len(previous_reports) > <NUM_LIT:10>:<EOL><INDENT>report_file = previous_reports.pop()<EOL>os.remove(report_file)<EOL><DEDENT>identifier = time.strftime('<STR_LIT>', time.localtime(session.start_time))<EOL>path = os.path.join(<EOL>report_dir(),<EOL>identifier + '<STR_LIT>'<EOL>)<EOL>session.save(path)<EOL>return path, identifier<EOL>
Saves the session to a temp file, and returns that path.
Also prunes the number of reports to 10 so there aren't loads building up.