def _do_preview(self, uploadedfile, sheet, req): filereader = get_reader(uploadedfile, sheet) try: return self._process(filereader, get_reporter_id(req), PreviewProcessor(self.env, req)) finally: filereader.close()
def _do_import(self, uploadedfile, sheet, req, uploadedfilename, tickettime): filereader = get_reader(uploadedfile, sheet) try: try: return self._process(filereader, get_reporter_id(req), ImportProcessor(self.env, req, uploadedfilename, tickettime)) finally: filereader.close() except: # Unlock the database. This is not really tested, but seems reasonable. TODO: test or verify this self.env.get_db_cnx().rollback() raise
def _do_import(self, uploadedfile, sheet, req, uploadedfilename, tickettime, encoding=None): filereader = get_reader(uploadedfile, sheet, self._datetime_format(), encoding=encoding) try: try: return self._process(filereader, get_reporter_id(req), ImportProcessor(self.env, req, uploadedfilename, tickettime)) finally: filereader.close() except: # Unlock the database. This is not really tested, but seems reasonable. TODO: test or verify this self.env.get_db_cnx().rollback() raise
def _do_preview(self, uploadedfile, sheet, req, encoding=None): filereader = get_reader(uploadedfile, sheet, self._datetime_format(), encoding=encoding) try: return self._process(filereader, get_reporter_id(req), PreviewProcessor(self.env, req)) finally: filereader.close()