PythonTidy

Chuck Rhode CRhode at LacusVeris.com
Wed Dec 6 12:53:24 EST 2006


Thomas Heller wrote this on Tue, Dec 05, 2006 at 07:06:30PM +0100.  My
reply is below.

> There is still one major issue.  pythonTidy uses open(input-file,
> "rb") to open the Python module to tidy up.  That does not work on
> Windows, at least if the file has (as it should) "\r\n" newlines.

Thank you for challenging my parochial world view.  

I have posted yet another version of PythonTidy:

  http://www.lacusveris.com/PythonTidy/PythonTidy-1.5.python

This one is omnivorous wrt to newlines.

> For output, PythonTidy generates "\n" line endings, this should also
> be changed on Windows.

When OVERRIDE_NEWLINE = None, the first newline encountered on input
is the one used throughout the output; otherwise, you can set it to
what you want, e.g, OVERRIDE_NEWLINE = '\n'.

> PythonTidy outputs strings with single quotes, while my own style is
> to use double quotes (I don't think that pep8 prefers one over the
> other).  Is it possible to customize this?

Here is a new global:  DOUBLE_QUOTED_STRINGS = True.

-- 
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather:  http://LacusVeris.com/WX
.. 30° — Wind WNW 15 mph — Sky overcast.



More information about the Python-list mailing list