aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwustho <benawiadha@gmail.com>2020-04-16 07:33:48 +0700
committerwustho <benawiadha@gmail.com>2020-04-16 07:33:48 +0700
commitbd1863509bee8035579427f2cc40bdf20c03b0cb (patch)
tree7bec222b2b93cfc57888bee35eb1ecaab6c6a5b8
parentef4a10df4a8db41b9762baba2608867dcef61702 (diff)
downloadepy-bd1863509bee8035579427f2cc40bdf20c03b0cb.tar.gz
Simpler WINKEYS and added curses.KEY_RESIZE to WINKEYS.
-rwxr-xr-xepy.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/epy.py b/epy.py
index 1e27da4..d33faa7 100755
--- a/epy.py
+++ b/epy.py
@@ -401,7 +401,7 @@ def text_win(textfunc):
y = 0
elif key_textw in K["EndOfCh"]:
y = pgend(totlines, padhi)
- elif key_textw in {curses.KEY_RESIZE}|WINKEYS - key:
+ elif key_textw in WINKEYS - key:
return key_textw
pad.refresh(y, 0, 6, 5, rows - 5, cols - 5)
key_textw = textw.getch()
@@ -482,7 +482,7 @@ def choice_win(listgen):
index = 0
elif key_chwin in K["EndOfCh"]:
index = totlines - 1
- elif key_chwin in {curses.KEY_RESIZE}|WINKEYS - key:
+ elif key_chwin in WINKEYS - key:
return key_chwin
countstring = ""
@@ -538,7 +538,7 @@ def parse_keys():
global WINKEYS
for i in K.keys():
K[i] = K[i]|{ord(CFG["Keys"][i])}
- WINKEYS = K["Metadata"]|K["Help"]|K["ToC"]|K["DefineWord"]
+ WINKEYS = {curses.KEY_RESIZE}|K["Metadata"]|K["Help"]|K["ToC"]
def savestate(file, index, width, pos, pctg):
@@ -1052,7 +1052,7 @@ def reader(ebook, index, width, y, pctg, sect):
ntoc = find_curr_toc_id(toc_idx, toc_sect, toc_secid, index, y)
fllwd = toc(toc_name, ntoc)
if fllwd is not None:
- if fllwd in {curses.KEY_RESIZE}|K["Help"]|K["Metadata"]:
+ if fllwd in WINKEYS:
k = fllwd
continue
if index == toc_idx[fllwd]:
@@ -1064,11 +1064,11 @@ def reader(ebook, index, width, y, pctg, sect):
return toc_idx[fllwd] - index, width, 0, None, toc_sect[fllwd]
elif k in K["Metadata"]:
k = meta(ebook)
- if k in {curses.KEY_RESIZE}|K["Help"]|K["ToC"]:
+ if k in WINKEYS:
continue
elif k in K["Help"]:
k = help()
- if k in {curses.KEY_RESIZE}|K["Metadata"]|K["ToC"]:
+ if k in WINKEYS:
continue
elif k in K["Enlarge"] and (width + count) < cols - 2:
width += count
@@ -1154,7 +1154,7 @@ def reader(ebook, index, width, y, pctg, sect):
word = input_prompt("define:")
if word is not None:
defin = define_word(word)
- if defin in {curses.KEY_RESIZE}|WINKEYS:
+ if defin in WINKEYS:
k = defin
continue
elif k in K["MarkPosition"]: