def on_output(self, value):
self.output_count += 1
if self.head != -1 and self.output_count > self.head:
self.on_finish()
return
if self.silent:
return
if not self.debug or self.compat_debug:
print(value, end='', flush=True)
else:
self.logging_pad.addstr(self.logging_loc, self.logging_x, str(value))
self.logging_pad.refresh(self.logging_loc - min(self.logging_loc, curses.LINES -
self.debug_lines - 1), 0, self.debug_lines, 0,
curses.LINES - 1, curses.COLS - 1)
# FIXME: This should count the number of newlines instead
if str(value).endswith('\n'):
self.logging_loc += 1
self.logging_x = 1
else:
self.logging_x += len(value)
评论列表
文章目录