Message9405

Author zyasoft
Recipients girish946, kanglecjr, zyasoft
Date 2015-01-15.23:09:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421363348.74.0.00823427781683.issue2209@psf.upfronthosting.co.za>
In-reply-to
Content
A simple pager in JLine 1:

import sys

def page_news():
    news = []
    with open("NEWS") as f:
        for row in f:
            news.append(row)

    reader = sys._jy_console.reader
    reader.usePagination = True
    reader.printColumns(news)

It's not very good, including the lack of screen redraw and moving back (similar to more vs less), but it seems to mostly comparable to what we get in CPython on Windows when using help.

There's a spurious extra >>> that's drawn after completing the paging:

>>> >>>

with the cursor positioned on the first > of the second group. I will see if it is possible to redraw the line properly (redrawLine doesn't do it).

Switching to JLine 2 (#2092) might make this work better, but that's a longer term proposition we have postponed to 2.7.x, x>0
History
Date User Action Args
2015-01-15 23:09:08zyasoftsetmessageid: <1421363348.74.0.00823427781683.issue2209@psf.upfronthosting.co.za>
2015-01-15 23:09:08zyasoftsetrecipients: + zyasoft, kanglecjr, girish946
2015-01-15 23:09:08zyasoftlinkissue2209 messages
2015-01-15 23:09:08zyasoftcreate