Changeset 508:d5a47f82e755 in documentViewer for documentViewer.py
- Timestamp:
- Feb 27, 2012, 8:26:52 PM (12 years ago)
- Branch:
- elementtree
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r507 r508 175 175 return self.template.fulltextclient.getTextPage(**args) 176 176 177 def getSearchResults(self, **args): 178 """loads list of search results and stores XML in docinfo""" 179 return self.template.fulltextclient.getSearchResults(**args) 180 181 def getResultsPage(self, **args): 182 """returns one page of the search results""" 183 return self.template.fulltextclient.getResultsPage(**args) 184 177 185 def getToc(self, **args): 178 """ returns the full table of contents (in internal format)"""186 """loads table of contents and stores XML in docinfo""" 179 187 return self.template.fulltextclient.getToc(**args) 180 188 … … 248 256 if tocMode != "thumbs": 249 257 # get table of contents 250 docinfo =self.getToc(mode=tocMode, docinfo=docinfo)258 self.getToc(mode=tocMode, docinfo=docinfo) 251 259 252 260 # auto viewMode: text if there is a text else images … … 254 262 if docinfo.get('textURL', None) or docinfo.get('textURLPath', None): 255 263 viewMode = "text" 256 viewLayer = "dict" 264 if viewLayer is None: 265 viewLayer = "dict" 257 266 else: 258 267 viewMode = "images" … … 263 272 viewLayer = "dict" 264 273 265 # stringify viewLayer266 if isinstance(viewLayer, list):267 logging.debug("index_html: viewLayer is list:%s"%viewLayer)268 viewLayer = ','.join([t for t in viewLayer if t])269 270 274 pageinfo = self.getPageinfo(start=start, current=pn, docinfo=docinfo, viewMode=viewMode, viewLayer=viewLayer, tocMode=tocMode) 271 275 … … 675 679 pageinfo = {} 676 680 pageinfo['viewMode'] = viewMode 681 # split viewLayer if necessary 682 if isinstance(viewLayer,basestring): 683 viewLayer = viewLayer.split(',') 684 685 if isinstance(viewLayer, list): 686 logging.debug("getPageinfo: viewLayer is list:%s"%viewLayer) 687 # save (unique) list in viewLayers 688 seen = set() 689 viewLayers = [l for l in viewLayer if l and l not in seen and not seen.add(l)] 690 pageinfo['viewLayers'] = viewLayers 691 # stringify viewLayer 692 viewLayer = ','.join(viewLayers) 693 else: 694 #create list 695 pageinfo['viewLayers'] = [viewLayer] 696 677 697 pageinfo['viewLayer'] = viewLayer 678 698 pageinfo['tocMode'] = tocMode
Note: See TracChangeset
for help on using the changeset viewer.