Mercurial > hg > documentViewer
changeset 456:b27a7d2f06ff elementtree
even toc pagination works
author | casties |
---|---|
date | Fri, 15 Jul 2011 21:45:52 +0200 |
parents | 0a53fea83df7 |
children | 9fb231ad0bd2 |
files | MpdlXmlTextServer.py |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/MpdlXmlTextServer.py Fri Jul 15 21:34:41 2011 +0200 +++ b/MpdlXmlTextServer.py Fri Jul 15 21:45:52 2011 +0200 @@ -544,14 +544,16 @@ viewMode= pageinfo['viewMode'] tocMode = pageinfo['tocMode'] tocPN = int(pageinfo['tocPN']) + pn = tocPN fulltoc = ET.fromstring(tocxml) if fulltoc: # paginate - #start = (pn - 1) * pagesize * 2 - #end = start + pagesize * 2 - #tocdivs = fulltoc[start:end] + start = (pn - 1) * pagesize * 2 + len = pagesize * 2 + del fulltoc[:start] + del fulltoc[len:] tocdivs = fulltoc # check all a-tags