def cleanup(self):
    new_reports = (set(os.listdir(CONFIG_SERVICES['error_report_path'])) - self.original_reports)
    for new_report in new_reports:
        os.remove(os.path.join(CONFIG_SERVICES['error_report_path'], new_report))
    self.session.query(Appropriation).delete(synchronize_session='fetch')
    self.session.query(ObjectClassProgramActivity).delete(synchronize_session='fetch')
    self.session.query(AwardFinancial).delete(synchronize_session='fetch')
    self.session.query(ErrorMetadata).delete(synchronize_session='fetch')
    self.session.query(FlexField).delete(synchronize_session='fetch')
    self.session.commit()
def cleanup(self):
    new_reports = (set(os.listdir(CONFIG_SERVICES['error_report_path'])) - self.original_reports)
    for new_report in new_reports:
        os.remove(os.path.join(CONFIG_SERVICES['error_report_path'], new_report))
    self.session.query(Appropriation).delete(synchronize_session='fetch')
    self.session.query(ObjectClassProgramActivity).delete(synchronize_session='fetch')
    self.session.query(AwardFinancial).delete(synchronize_session='fetch')
    self.session.query(ErrorMetadata).delete(synchronize_session='fetch')
    self.session.query(FlexField).delete(synchronize_session='fetch')
    self.session.commit()