def emit(self, record):
        """Emit message to a dialog info box.

        Only show the last (self.height) lines; note that lines can wrap
        at self.width, so a single line could actually be multiple
        lines.

        """
        for line in self.format(record).splitlines():
            # check for lines that would wrap
            cur_out = line
            while self.width > len(cur_out):
                # find first space before self.width chars into cur_out
                last_space_pos = cur_out.rfind(' ', 0, self.width)

                if last_space_pos == -1:
                    # no spaces, just cut them off at whatever
                    self.lines.append(cur_out[0:self.width])
                    cur_out = cur_out[self.width:]
                else:
                    # cut off at last space
                    self.lines.append(cur_out[0:last_space_pos])
                    cur_out = cur_out[last_space_pos + 1:]
            if cur_out != '':
                self.lines.append(cur_out)

        # show last 16 lines
        content = '\n'.join(self.lines[-self.height:])

        # add the padding around the box
        self.d.infobox(
            content, self.height + self.PADDING_HEIGHT,
            self.width + self.PADDING_WIDTH)
dataset/ETHPy150Open letsencrypt/letsencrypt/certbot/log.py/DialogHandler.emit/swapped operands of `>`