berkerpeksag / astor

Python AST read/write
https://pypi.org/project/astor/
BSD 3-Clause "New" or "Revised" License
810 stars 102 forks source link

Command line enhancements #78

Open pmaupin opened 7 years ago

pmaupin commented 7 years ago

Added a command line module Made a console entry point Added source diff capability

pmaupin commented 7 years ago

I added a command line utility named 'astor', and a way to add generic utilities underneath it. The first two utilities are 'astor rtrip' and 'astor diff', and you can also do things like 'astor cprofile rtrip'.

There is plenty of scope for improvement, but I think the UI is a reasonable start and will be easy to maintain backward compatibility with. I removed a few recent things I added to rtrip (such as the ability to use a different to_source function). Those will be easy enough to add back in after a release, and nobody else was using them anyway.

Anyway, I can try to help document this mess of stuff later in the week, but I'm really, truly, done coding for now, and have a lot of other stuff to do for the next couple of days.