def render_to_terminal(self): if self.can_be_displayed: text_to_render = self.render() characters_to_be_erased = self.last_render_length self.last_render_length = len(text_to_render) text_to_render = "%s%s" % (characters_to_be_erased * self.BACKSPACE, text_to_render) print_text(text_to_render, flush=True)
def print_styled_text(text, options, *style_attributes): if should_colorize(options): add_trailing_nl = False if text[-1] == '\n': text = text[:-1] add_trailing_nl = True text = styled_text(text, *style_attributes) if add_trailing_nl: text += '\n' print_text(text)
def print_styled_text(text, options, *style_attributes): if should_colorize(options): text = styled_text(text, *style_attributes) print_text(text)
def flush_text_line(text_line): print_text(text_line + '\n', flush=True)
def flush_text_line(text_line): print_text(text_line + "\n", flush=True)