module documentation
Part of the astor library for Python AST manipulation. License: 3-clause BSD Copyright (c) 2015 Patrick Maupin Pretty-print source -- post-process for the decompiler The goals of the initial cut of this engine are: 1) Do a passable, if not PEP8, job of line-wrapping. 2) Serve as an example of an interface to the decompiler for anybody who wants to do a better job. :)
Function | add |
Attempt to add parentheses around the line in order to make it splittable. |
Function | count |
Undocumented |
Function | delimiter |
Split a line into alternating groups. The first group cannot have a line feed inserted, the next one can, etc. |
Function | get |
Split a line into groups by assignment (including augmented assignment) |
Function | pretty |
Prettify the source. |
Function | split |
Split a group into two subgroups. The first will be appended to the current line, the second will start the new line. |
Function | split |
Split inputs according to lines. If a line is short enough, just yield it. Otherwise, fix it. |
Function | wrap |
We have a line that is too long, so we're going to try to wrap it. |
Variable | begin |
Undocumented |
Variable | end |
Undocumented |
Variable | ops |
Undocumented |
Variable | statements |
Undocumented |
Split a line into alternating groups. The first group cannot have a line feed inserted, the next one can, etc.
Split a group into two subgroups. The first will be appended to the current line, the second will start the new line. Note that the first group must always contain at least one item. The original group may be destroyed.