aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorbenadha <benawiadha@gmail.com>2021-01-30 11:27:32 +0700
committerbenadha <benawiadha@gmail.com>2021-01-30 11:27:32 +0700
commita5318a171e2e148a389732f06c0aec0ebc4c60e7 (patch)
treea80fbd01e48d0b26e13bd1d1e92042e88987558d /epy.py
parent85c2c24387152a6e6b76db5872a81fb430bac3b5 (diff)
downloadepy-a5318a171e2e148a389732f06c0aec0ebc4c60e7.tar.gz
Added chapter suffix in the end of MAXCHUNKS
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/epy.py b/epy.py
index 761bdd7..f88159b 100755
--- a/epy.py
+++ b/epy.py
@@ -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