[IPython-dev] [PATCH] make dump_pager more smart (on Windows): rev.2

Alexander Belchenko bialix at ukr.net
Mon Oct 10 16:38:29 CDT 2005


Fernando Perez wrote:
>>Attached patch provide clearing prompt "---Return to continue, q to
>>quit--- " after hitting the key so this prompt don't mix with printed text.
> 
> Thanks, this one looks like a no-brainer to me.  Any caveats from our win32 
> experts, since I can't actually test it?  It looks pretty harmles on the 
> surface...

My first patch have the bug (that masked if after paging prompt blank 
line is printed): every comma in print worth one space. As result next 
line is have extra (wrong) spaces at start. I fix this by using 
Term.cout.write() method instead of print statement.

In addition I try to create seamless coloring when page_dumb() is used. 
Problem appears because prompt between pages break coloring, and after 
prompt tail of long string or docstring is not colored. For avoiding 
this behaviour I store last escape sequence in variable last_escape and 
add this one to the start of next portion of lines. On Windows it works 
correct.

Use attached patch instead of my first one.

Alexander
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: page_more.diff
Url: http://projects.scipy.org/pipermail/ipython-dev/attachments/20051011/b24996f0/attachment.pl 


More information about the IPython-dev mailing list