def _style_toot_historytheme(toot, ind=_indent): out = [] out.append( _style_name_line(toot['account'], fg('green'), fg('yellow')) ) out.append( _style_id_line(toot, fg('blue'), fg('cyan'), fg('red'), attr('dim')) ) if toot['spoiler_text']: out.append( stylize( '\n'.join(_ts_wrapper.wrap(_format_spoiler(toot))), fg('red')) ) out.append( get_content(toot) ) out.append( _style_media_list(toot, fg('magenta'), prefix=ind+ind) ) for line in out: tw_indent(line, ind) return '\n'.join(out)
def indent(s, n): ''' A shortcut for ``textwrap.indent`` that always uses spaces. ''' return tw_indent(s, n * ' ')
def indent(text: str, count: int): ''' Indent text with the specified number of spaces. ''' return tw_indent(text, ' ' * count)