Changeset 591:5850689ecfac in documentViewer
- Timestamp:
- Nov 16, 2012, 12:41:02 PM (12 years ago)
- Branch:
- default
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r590 r591 63 63 pn = default 64 64 65 return pn 66 67 return default 68 69 def getPfForPn(docinfo, pn, default=None): 70 """returns image file name for image number or default""" 71 if 'imgFileIndexes' in docinfo: 72 pn = docinfo['imgFileIndexes'].get(pn, default) 65 73 return pn 66 74 … … 105 113 layer_text_pundit = PageTemplateFile('zpt/layer_text_pundit', globals()) 106 114 layer_image_annotator = PageTemplateFile('zpt/layer_image_annotator', globals()) 115 layer_image_ocrsearch = PageTemplateFile('zpt/layer_image_ocrsearch', globals()) 107 116 layer_index_extended = PageTemplateFile('zpt/layer_index_extended', globals()) 108 117 # toc templates … … 778 787 # save list of image names and numbers 779 788 imgNames = {} 789 imgIndexes = {} 780 790 for f in dir: 781 791 fn = f.findtext('name') 782 pn = f.findtext('index') 783 imgNames[fn] = getInt(pn) 792 pn = getInt(f.findtext('index')) 793 imgNames[fn] = pn 794 imgIndexes[pn] = fn 784 795 785 796 docinfo['imgFileNames'] = imgNames 797 docinfo['imgFileIndexes'] = imgIndexes 786 798 return docinfo 787 799 … … 849 861 else: 850 862 pn = getInt(pn, 1) 863 pf = getPfForPn(docinfo, pn) 864 pageinfo['pf'] = pf 851 865 852 866 pageinfo['pn'] = pn … … 891 905 892 906 # cache search results 893 pageinfo['resultPageSize'] = getInt(self.REQUEST.get('resultPageSize', 10))894 907 query = self.REQUEST.get('query',None) 895 908 pageinfo['query'] = query 896 if query: 909 if query and viewMode == 'text': 910 pageinfo['resultPageSize'] = getInt(self.REQUEST.get('resultPageSize', 10)) 897 911 queryType = self.REQUEST.get('queryType', 'fulltextMorph') 898 912 pageinfo['queryType'] = queryType … … 911 925 912 926 def getPageBatch(self, start=1, rows=10, cols=2, pageFlowLtr=True, pageZero=False, minIdx=1, maxIdx=0): 913 """returns dict with array of page information sfor one screenfull of thumbnails"""927 """returns dict with array of page information for one screenfull of thumbnails""" 914 928 batch = {} 915 929 grpsize = rows * cols -
version.txt
r587 r591 1 DocumentViewer 2.2. 81 DocumentViewer 2.2.9
Note: See TracChangeset
for help on using the changeset viewer.