def publish_status(self, target, temp, heater_percent, cooler_percent):

        # Get timestamp in epoch seconds
        timestamp = int(time.time())
        # Append new status
        status = [target, temp, heater_percent, cooler_percent, timestamp]
        self._datapoints.append(status)
        # Drop datapoints older than required for chart
        earliest = timestamp - self._past_seconds
        self._datapoints = [d for d in self._datapoints
                            if d[4] >= earliest]

        # Divine polling frequency using the difference between timestamps of
        # the most recent 2 datapoints. Use this to set an appropriate x label
        # interval.
        if len(self._datapoints) >= 2:
            freq_seconds = self._datapoints[-1][4] - self._datapoints[-2][4]
            if freq_seconds > 0:
                self._chart_config.x_labels_major_every = (
                    self._x_label_seconds / freq_seconds)

        # Draw chart
        chart = pygal.Line(self._chart_config)
        chart.x_labels = [
            datetime.fromtimestamp(d[4]).strftime('%b-%d %H:%M:%S')
            for d in self._datapoints]
        chart.add('Target', [d[0] for d in self._datapoints])
        chart.add('Actual', [d[1] for d in self._datapoints])
        # TODO: Add heating and cooling as bars once pygal supports bars and
        # lines on a single chart.
        #chart.add('Heating', [d[2] for d in self._datapoints], secondary=True)
        #chart.add('Cooling', [d[3] for d in self._datapoints], secondary=True)
        try:
            getattr(chart, self._outputter)(filename=self._out_file)
        except __HOLE__ as err:
            raise OutputError(err)
dataset/ETHPy150Open amorphic/braubuddy/braubuddy/output/imagefile.py/ImageFileOutput.publish_status