Mercurial > hg > documentViewer
changeset 61:f3d2f240692c
fixed bug in calculation of group numbers
author | casties |
---|---|
date | Thu, 14 Jun 2007 18:07:21 +0200 |
parents | 346e94770901 |
children | 8a16ea8db858 |
files | documentViewer.py version.txt |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/documentViewer.py Fri Jun 08 20:12:29 2007 +0200 +++ b/documentViewer.py Thu Jun 14 18:07:21 2007 +0200 @@ -18,6 +18,7 @@ import cgi import urllib import logging +import math import urlparse @@ -440,7 +441,7 @@ dom=self.getPresentationInfoXML(url) docinfo['author']=getTextFromNode(dom.xpath("//author")[0]) docinfo['title']=getTextFromNode(dom.xpath("//title")[0]) - docinfo['year']=getTextFromNode(dom.xpath("//date")[0]) + #docinfo['year']=getTextFromNode(dom.xpath("//date")[0]) return docinfo def getDocinfoFromImagePath(self,path,docinfo=None): @@ -495,7 +496,8 @@ pageinfo['cols'] = cols grpsize = cols * rows pageinfo['groupsize'] = grpsize - start = getInt(start, default=(int(current / grpsize) * grpsize +1)) + start = getInt(start, default=(math.ceil(float(current)/float(grpsize))*grpsize-(grpsize-1))) + # int(current / grpsize) * grpsize +1)) pageinfo['start'] = start pageinfo['end'] = start + grpsize if docinfo is not None: