aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorwustho <benawiadha@gmail.com>2020-04-18 05:29:57 +0700
committerwustho <benawiadha@gmail.com>2020-04-18 05:29:57 +0700
commit26d23c5910b52af542b9d8bf1ef015afe8d528e5 (patch)
treed5b0198ecd1fe1c39b591b60095d97328a415213 /epy.py
parentd26500361415fd319c3a252677835eebd871faf3 (diff)
downloadepy-26d23c5910b52af542b9d8bf1ef015afe8d528e5.tar.gz
Added errmsg().
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/epy.py b/epy.py
index d4b6334..78b3d18 100755
--- a/epy.py
+++ b/epy.py
@@ -677,6 +677,11 @@ def help():
return "Help", src, K["Help"]
+@text_win
+def errmsg(title, msg, key):
+ return title, msg, key
+
+
def bookmarks(ebookpath):
idx = 0
while True:
@@ -1156,11 +1161,11 @@ def reader(ebook, index, width, y, pctg, sect):
y = pgend(totlines, rows)
elif k in K["ToC"]:
if ebook.toc_entries == [[], [], []]:
- k = text_win(lambda: (
+ k = errmsg(
"Table of Contents",
"N/A: ToC is unavailable for this book.",
K["ToC"]
- ))()
+ )
continue
ntoc = find_curr_toc_id(toc_idx, toc_sect, toc_secid, index, y)
fllwd, _ = toc(toc_name, ntoc)