diff options
author | benadha <benawiadha@gmail.com> | 2021-01-30 11:27:32 +0700 |
---|---|---|
committer | benadha <benawiadha@gmail.com> | 2021-01-30 11:27:32 +0700 |
commit | a5318a171e2e148a389732f06c0aec0ebc4c60e7 (patch) | |
tree | a80fbd01e48d0b26e13bd1d1e92042e88987558d /epy.py | |
parent | 85c2c24387152a6e6b76db5872a81fb430bac3b5 (diff) | |
download | epy-a5318a171e2e148a389732f06c0aec0ebc4c60e7.tar.gz |
Added chapter suffix in the end of MAXCHUNKS
Diffstat (limited to 'epy.py')
-rwxr-xr-x | epy.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -645,12 +645,12 @@ class HTMLtoLines(HTMLParser): class Board: - MAXCHUNKS = 32000 # lines + MAXCHUNKS = 32000-2 # lines def __init__(self, totlines, width): self.chunks = [self.MAXCHUNKS*(i+1)-1 for i in range(totlines // self.MAXCHUNKS)] self.chunks += [] if totlines % self.MAXCHUNKS == 0 else [totlines % self.MAXCHUNKS + (0 if self.chunks == [] else self.chunks[-1])] # -1 - self.pad = curses.newpad(min([self.MAXCHUNKS, totlines]), width) + self.pad = curses.newpad(min([self.MAXCHUNKS+2, totlines]), width) self.pad.keypad(True) # self.current_chunk = 0 self.y = 0 @@ -705,6 +705,12 @@ class Board: except curses.error: pass + # if chunkidx < len(self.chunks)-1: + # try: + # self.pad.addstr(self.MAXCHUNKS+1, (self.width - len(ch_suffix))//2 + 1, ch_suffix) + # except curses.error: + # pass + def chgat(self, y, x, n, attr): chunkidx = self.find_chunkidx(y) start_chunk = 0 if chunkidx == 0 else self.chunks[chunkidx-1]+1 |