diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2014-02-27 17:54:33 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2014-02-27 17:54:33 -0500 |
| commit | 3e343111fc525f093f8bd98707000eb44f08a97f (patch) | |
| tree | 05ff6ec804088471cbbf0e61206ee23f586f3b7f /parsedjvutext.py | |
| parent | 7d51499ee70c2795ba897981e7ce4f69ce61dd28 (diff) | |
| download | ocr-layer-curation-3e343111fc525f093f8bd98707000eb44f08a97f.tar.gz | |
fix small bug
Diffstat (limited to 'parsedjvutext.py')
| -rw-r--r-- | parsedjvutext.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/parsedjvutext.py b/parsedjvutext.py index 4211de1..301b449 100644 --- a/parsedjvutext.py +++ b/parsedjvutext.py @@ -1,6 +1,5 @@ import sys from bs4 import BeautifulSoup -import subprocess import djvu from djvu.decode import Context from itertools import chain @@ -42,7 +41,7 @@ def parse_book(djvubook, page=None, html=False): if type(page) is int: toparse = [document.pages[page - 1]] elif isinstance(page, collections.Iterable): - toparse = page + toparse = [document.pages[p - 1] for p in page] else: toparse = document.pages @@ -50,4 +49,4 @@ def parse_book(djvubook, page=None, html=False): if page.text.sexpr) if __name__ == "__main__": - book = parse_book(sys.argv[1]) + book = parse_book(sys.argv[1], page=[10,11], html=True) |
