Exemplo n.º 1
0
    def generate_data(self, initial_measurement_time):
        self._report_name = self._data['name']
        self._table_name = self._get_sql_formatted_string(self._report_name)

        if self._table_name is None:
            raise Exception("Error: The following reserved word '%s' cannot be used as table name." % self._report_name)
        elif not self._table_name:
            raise Exception("Error: Table name is empty.")

        if not self.check_table_exists(self._table_name):
            raise Exception("Error: Table `%s` does not exists" % self._table_name)

        from report import Report
        report = Report('composite', None, initial_measurement_time)

        report.set_logger(self._logger)
        report.init(self._id)
        report._composite_manager = self

        report.update(None)
        return self._table_name