Part of nevow.scripts.xmlgettext View Source View In Hierarchy
Allow pulldom to read at most one line at a time, to get accurate line number reporting. Otherwise it always reports everything is on the last line read in a single chunk.
Delay reporting newlines to next read, to avoid line numbers always being off by one.
Not the prettiest code I've written :-(