aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorwustho <benawiadha@gmail.com>2020-04-18 06:13:35 +0700
committerwustho <benawiadha@gmail.com>2020-04-18 06:13:35 +0700
commit36ab2138ff45137a8fd0c2ce8ff0d8e67b4c2148 (patch)
tree80c153516ffab6cec626d527b334531c679cd144 /epy.py
parent3349f99ed28b5c9884308fba969e7ec554a60415 (diff)
downloadepy-36ab2138ff45137a8fd0c2ce8ff0d8e67b4c2148.tar.gz
Added drop_whitspace=False in textwrap.wrap() in text_win() adn add File Info from Metadata.
Diffstat (limited to 'epy.py')
-rwxr-xr-xepy.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/epy.py b/epy.py
index 68efde1..d158f6e 100755
--- a/epy.py
+++ b/epy.py
@@ -407,7 +407,7 @@ def text_win(textfunc):
texts = []
for i in raw_texts.splitlines():
- texts += textwrap.wrap(i, wi - 6)
+ texts += textwrap.wrap(i, wi - 6, drop_whitespace=False)
textw.box()
textw.keypad(True)
@@ -660,7 +660,9 @@ def toc(src, index):
@text_win
def meta(ebook):
- mdata = ""
+ mdata = "[File Info]\nPATH: {}\nSIZE: {}\n \n[Book Info]\n".format(
+ ebook.path, os.stat(ebook.path).st_size
+ )
for i in ebook.get_meta():
data = re.sub("<[^>]*>", "", i[1])
mdata += i[0].upper() + ": " + data + "\n"