From 5b47c960ff350556fa4bc02e62ad1d2e62695765 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Thu, 27 Feb 2014 23:40:21 -0500 Subject: add function to return image from a book --- web/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/utils.py b/web/utils.py index 7a6bf1a..3db0296 100644 --- a/web/utils.py +++ b/web/utils.py @@ -3,9 +3,10 @@ import sys def gen_html(book, page_number): - book = "../Bloy_-_Le_Sang_du_pauvre,_Stock,_1932.djvu" + book = "../Villiers_de_L'Isle-Adam_-_Tribulat_Bonhomet,_1908.djvu" d = parse_book(book, page=int(page_number), html=True) - words, coords = d[0] + if d[0]: + words, coords = zip(*d[0]) return (list(enumerate(coords)), list(enumerate(words))) -- cgit v1.2.3-70-g09d2