def _drop_table(self): try: data_manager = ReportDataTableManager(self.element_id, self._logger) table_name = data_manager.drop_table() except Exception, e: log_traceback(self._logger, traceback) print simplejson.dumps({'status': 'ERROR', 'message': "%s" % e}) sys.exit()
def _generate_data(self): try: data_manager = ReportDataTableManager(self.element_id, self._logger) table_name = data_manager.generate_data(self.initial_measurement_time) except Exception, e: log_traceback(self._logger, traceback) print simplejson.dumps({'status': 'ERROR', 'message': "%s" % e}) sys.exit()
def process_reports(self): self._db.Query("""SELECT dashboard_element.element_id FROM dashboard_element WHERE dashboard_element.`type`='internal report' AND enabled_ind = 'Y' ORDER BY element_id""") elements = [row for row in self._db.record] for element in elements: data_manager = ReportDataTableManager(element['element_id'], self._logger) data_manager.check_table()