[Urwid] docgen_tutorial.py that also creates scripts

Ian Ward ian at excess.org
Fri Aug 11 23:03:06 EDT 2006


Derek Peschel wrote:
> On Fri, Aug 11, 2006 at 01:45:04AM -0400, Ian Ward wrote:
>> I've incorporated most of your changes - whitespace differences have 
>> been discarded, and I made a couple small changes.  I disabled the 
>> creation of source files that are obviously incomplete, later it would 
>> be nice to revisit that part of the tutorial and expand it.
> 
> I'm still looking at the diffs, but it's nice to know you agree with most
> of my changes.  By "whitespace differences" do you mean spaces/tabs, returns,
> or both?  And do you have your own rules for uses of whitespace?

Just a few places where your editor cleaned up trailing whitespace in 
the source file.  Those changes make it hard to read the diff.  I just 
used diff -b and patch -l to remove them.

> If I knew your code was consistent with _some_ style, and I could adapt my
> patches to it, I'd be happy.  Plus I'm interested to know what an automated
> code reformatter would have to deal with, though no one has answered my
> question about whether there _are_ any good reformatters.  The alternative
> is for me to keep using my style, though if we are both reformatting the
> same code then at least one of us is doing extra work.  The other alternative
> (not a solution, but better than nothing) is for me to use the same editor
> and settings as you.

I'm going to try to follow the style PEP that Rebecca pointed out
( http://www.python.org/dev/peps/pep-0008/ ), with a few exceptions:

I use real tabs for indentation (there should be no spaces used between 
the beginning of the line and the first non-whitespace character).

Continued lines should have an extra tab, not necessarily aligned 
perfectly with a parenthesis or similar in the preceding line.

I prefer the UTF-8 encoding (though this is tricky to get right with old 
versions of Python.. see graphics.py in the next release to see what I mean)

> Another thing -- I see you're using CVS, so what do you think of having
> some kind of template and makefile that puts the project version number
> in certain files and keeps it up to date?  I was specifically thinking that
> the tutorial could say "Urwid 0.9.5 Tutorial", both in the title and in the
> text, and similarly for the reference.  My only reason for asking is that
> I have 0.9.4 development directories I haven't finished dealing with yet,
> and once or twice I have needed to look at old and new HTML files at the
> same time.

Yes, I will do that.

Ian




More information about the Urwid mailing list