Changeset 609:7962e6891d99 in documentViewer for MpiwgXmlTextServer.py
- Timestamp:
- Jan 15, 2013, 5:15:32 PM (11 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MpiwgXmlTextServer.py
r587 r609 96 96 97 97 field = '' 98 if mode in ['pages', 'toc', 'figures', ' handwritten']:98 if mode in ['pages', 'toc', 'figures', 'notes', 'handwritten']: 99 99 # translate mode to field param 100 field = '&field=%s'%mode 100 if mode == 'handwritten': 101 field = '&field=notesHandwritten' 102 else: 103 field = '&field=%s'%mode 101 104 else: 102 105 mode = None … … 132 135 docinfo['numTextPages'] = getInt(getText(sys.find('countPages'))) 133 136 docinfo['numFigureEntries'] = getInt(getText(sys.find('countFigures'))) 134 docinfo['numHandwritten'] = getInt(getText(sys.find('countHandwritten'))) 137 docinfo['numHandwritten'] = getInt(getText(sys.find('countNotesHandwritten'))) 138 docinfo['numNotes'] = getInt(getText(sys.find('countNotes'))) 139 docinfo['numPlaces'] = getInt(getText(sys.find('countPlaces'))) 135 140 docinfo['numTocEntries'] = getInt(getText(sys.find('countTocEntries'))) 136 141 … … 162 167 163 168 # toc 164 elif lt == 'toc' or lt == 'figures' or lt == 'handwritten':169 elif lt in ['toc', 'figures', 'notes', 'notesHandwritten']: 165 170 # contains tags with table of contents/figures 166 171 # <item n="2.1." lv="2">CAP.I. <ref o="119">132</ref></item> … … 661 666 tocs = fulltoc[first:last] 662 667 tp = '<div>' 663 label = {'figures': 'Figure', ' handwritten': 'Handwritten note'}.get(mode, 'Item')668 label = {'figures': 'Figure', 'notes': 'Note', 'handwritten': 'Handwritten note'}.get(mode, 'Item') 664 669 for toc in tocs: 665 670 pageurl = self.getLink('pn', toc['pn']) 666 671 tp += '<div class="tocline">' 667 672 content = toc['content'] 673 lvs = toc['level-string'] 668 674 if content: 669 tp += '<div class="toc name">[%s] %s</div>'%(toc['level-string'], toc['content']) 675 tp += '<div class="toc name">[%s] %s</div>'%(lvs, toc['content']) 676 elif lvs: 677 tp += '<div class="toc name">[%s %s]</div>'%(label, lvs) 670 678 else: 671 tp += '<div class="toc name">[%s %s]</div>'%(label, toc['level-string'])679 tp += '<div class="toc name">[%s]</div>'%(label) 672 680 673 681 if toc.get('no', None):
Note: See TracChangeset
for help on using the changeset viewer.