def display(self):
        """ Write results to an output stream """
        total = 0
        count = 0
        for i, result in enumerate(self._results):
            if total == 0:
                self.pre_write()
            self.write(result)
            count += 1
            total += 1
            if (
                count >= self.pagesize
                and self.pagesize > 0
                and i < len(self._results) - 1
            ):
                self.wait()
                count = 0
        if total == 0:
            self._ostream.write("No results\n")
        else:
            self.post_write()
Write results to an output stream