Changeset 518:91051b36b9cc in documentViewer for documentViewer.py
- Timestamp:
- Mar 12, 2012, 6:01:14 PM (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r516 r518 257 257 self.digilibBaseUrl = self.findDigilibUrl() or "http://digilib.mpiwg-berlin.mpg.de/digitallibrary" 258 258 259 docinfo = self.getDocinfo(mode=mode,url=url) 260 261 if tocMode != "thumbs": 262 # get table of contents 263 self.getToc(mode=tocMode, docinfo=docinfo) 264 259 docinfo = self.getDocinfo(mode=mode,url=url,tocMode=tocMode) 260 265 261 # auto viewMode: text if there is a text else images 266 262 if viewMode=="auto": … … 430 426 431 427 432 def getDocinfo(self, mode, url ):428 def getDocinfo(self, mode, url, tocMode=None): 433 429 """returns docinfo depending on mode""" 434 430 logging.debug("getDocinfo: mode=%s, url=%s"%(mode,url)) … … 484 480 if texttool: 485 481 docinfo = self.getDocinfoFromTexttool(docinfo, texttool) 486 # document info from full text482 # document info (including toc) from full text 487 483 if docinfo.get('textURLPath', None): 488 docinfo = self.getTextInfo( docinfo=docinfo)484 docinfo = self.getTextInfo(mode=tocMode, docinfo=docinfo) 489 485 490 486 # bib info … … 730 726 np = int(docinfo.get('numPages', 0)) 731 727 if np == 0: 732 # numPages unknown - maybe we can get it from text page 733 logging.warn("getPageInfo: numPages=0 trying getTextPage!") 734 if docinfo.get('textURLPath', None): 735 # cache text page as well 736 pageinfo['textPage'] = self.getTextPage(mode=viewLayer, pn=current, docinfo=docinfo, pageinfo=pageinfo) 737 np = int(docinfo.get('numPages', 0)) 738 728 # try numTextPages 729 np = docinfo.get('numTextPages', 0) 730 if np != 0: 731 docinfo['numPages'] = np 732 739 733 # cache table of contents 740 734 pageinfo['tocPageSize'] = getInt(self.REQUEST.get('tocPageSize', 30))
Note: See TracChangeset
for help on using the changeset viewer.