module documentation

Part of the astor library for Python AST manipulation. License: 3-clause BSD Copyright (c) 2015 Patrick Maupin Pretty-print strings for the decompiler We either return the repr() of the string, or try to format it as a triple-quoted string. This is a lot harder than you would think. This has lots of Python 2 / Python 3 ugliness.

Class special_unicode Undocumented
Function pretty_string There are a lot of reasons why we might not want to or be able to return a triple-quoted string. We can always punt back to the default normal string.
Function string_triplequote_repr Return string's python representation in triple quotes.
Variable mysplit Undocumented
Variable replacements Undocumented
Function _prep_triple_quotes Split the string up and force-feed some replacements to make sure it will round-trip OK
Function _properly_indented Undocumented
def pretty_string(s, embedded, current_line, uni_lit=False, min_trip_str=20, max_line=100): (source)

There are a lot of reasons why we might not want to or be able to return a triple-quoted string. We can always punt back to the default normal string.

def string_triplequote_repr(s): (source)

Return string's python representation in triple quotes.

mysplit = (source)

Undocumented

replacements: dict[str, str] = (source)

Undocumented

def _prep_triple_quotes(s, mysplit=mysplit, replacements=replacements): (source)

Split the string up and force-feed some replacements to make sure it will round-trip OK

def _properly_indented(s, line_indent): (source)

Undocumented