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 |
Undocumented |
Function | pretty |
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 |
Return string's python representation in triple quotes. |
Variable | mysplit |
Undocumented |
Variable | replacements |
Undocumented |
Function | _prep |
Split the string up and force-feed some replacements to make sure it will round-trip OK |
Function | _properly |
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.