[New-bugs-announce] [issue9621] Graphviz output for 2to3 fixer patterns
report at bugs.python.org
Mon Aug 16 17:39:59 CEST 2010
New submission from Matt Bond <gmattbond at gmail.com>:
As part of my GSoC project working on 2to3, I've created a script which will allow compiled fixer patterns to be visualized using graphviz. This would be useful for debugging and understanding exactly how patterns are matched. I've written using the 2to3 sandbox as my base.
The script is named pat2dot and is found in the scripts directory. The script currently relies on an external graphviz library (I provided bindings for the GvGen library with this patch), they are separated enough from the rest of the code that it would be trivial to create a class that would work using a different graphviz library. Additionally, since the code is never called within 2to3 proper, this dependency will only appear if you wish to use pat2dot, and will not affect any other usages of lib2to3.
Usage of the script is `python pat2dot.py fixername` where fixername is any fixer provided in 2to3, as named by 2to3's -l option.
components: 2to3 (2.x to 3.0 conversion tool)
nosy: facundobatista, gmattbond, loewis
title: Graphviz output for 2to3 fixer patterns
versions: Python 2.6
Added file: http://bugs.python.org/file18544/2to3-graph.diff
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce