Message9405
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 |
|
Date |
User |
Action |
Args |
2015-01-15 23:09:08 | zyasoft | set | messageid: <1421363348.74.0.00823427781683.issue2209@psf.upfronthosting.co.za> |
2015-01-15 23:09:08 | zyasoft | set | recipients:
+ zyasoft, kanglecjr, girish946 |
2015-01-15 23:09:08 | zyasoft | link | issue2209 messages |
2015-01-15 23:09:08 | zyasoft | create | |
|