Mercurial > hg > documentViewer
comparison documentViewer.py @ 158:4f4fe4e56ffe
characterNormalization
author | abukhman |
---|---|
date | Tue, 24 Aug 2010 11:38:45 +0200 |
parents | de82ae2e9850 |
children | db9bcbbd5868 |
comparison
equal
deleted
inserted
replaced
157:de82ae2e9850 | 158:4f4fe4e56ffe |
---|---|
676 | 676 |
677 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) | 677 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) |
678 self.REQUEST.SESSION['docinfo'] = docinfo | 678 self.REQUEST.SESSION['docinfo'] = docinfo |
679 return docinfo | 679 return docinfo |
680 | 680 |
681 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None): | 681 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None, characterNormalization=None): |
682 """returns pageinfo with the given parameters""" | 682 """returns pageinfo with the given parameters""" |
683 pageinfo = {} | 683 pageinfo = {} |
684 current = getInt(current) | 684 current = getInt(current) |
685 pageinfo['current'] = current | 685 pageinfo['current'] = current |
686 rows = int(rows or self.thumbrows) | 686 rows = int(rows or self.thumbrows) |
699 pageinfo['numgroups'] = int(np / grpsize) | 699 pageinfo['numgroups'] = int(np / grpsize) |
700 if np % grpsize > 0: | 700 if np % grpsize > 0: |
701 pageinfo['numgroups'] += 1 | 701 pageinfo['numgroups'] += 1 |
702 pageinfo['viewMode'] = viewMode | 702 pageinfo['viewMode'] = viewMode |
703 pageinfo['tocMode'] = tocMode | 703 pageinfo['tocMode'] = tocMode |
704 #pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','') | 704 pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','') |
705 pageinfo['query'] = self.REQUEST.get('query',' ') | 705 pageinfo['query'] = self.REQUEST.get('query',' ') |
706 pageinfo['queryType'] = self.REQUEST.get('queryType',' ') | 706 pageinfo['queryType'] = self.REQUEST.get('queryType',' ') |
707 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') | 707 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') |
708 pageinfo['textPN'] = self.REQUEST.get('textPN','1') | 708 pageinfo['textPN'] = self.REQUEST.get('textPN','1') |
709 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') | 709 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') |
710 pageinfo['tocPageSize'] = self.REQUEST.get('tocPageSize', '30') | 710 pageinfo['tocPageSize'] = self.REQUEST.get('tocPageSize', '30') |
711 pageinfo['queryPageSize'] =self.REQUEST.get('queryPageSize', '10') | 711 pageinfo['queryPageSize'] =self.REQUEST.get('queryPageSize', '10') |
712 pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1') | 712 pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1') |
713 toc = int (pageinfo['tocPN']) | 713 toc = int (pageinfo['tocPN']) |
714 pageinfo['textPages'] =int (toc) | 714 pageinfo['textPages'] =int (toc) |
715 | 715 |
716 | |
717 | |
716 if 'tocSize_%s'%tocMode in docinfo: | 718 if 'tocSize_%s'%tocMode in docinfo: |
717 tocSize = int(docinfo['tocSize_%s'%tocMode]) | 719 tocSize = int(docinfo['tocSize_%s'%tocMode]) |
718 tocPageSize = int(pageinfo['tocPageSize']) | 720 tocPageSize = int(pageinfo['tocPageSize']) |
719 # cached toc | 721 # cached toc |
720 if tocSize%tocPageSize>0: | 722 if tocSize%tocPageSize>0: |