Changeset 609:7962e6891d99 in documentViewer for MpiwgXmlTextServer.py


Ignore:
Timestamp:
Jan 15, 2013, 5:15:32 PM (11 years ago)
Author:
casties
Branch:
default
Message:

works with new notes and notesHandwritten.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MpiwgXmlTextServer.py

    r587 r609  
    9696       
    9797        field = ''
    98         if mode in ['pages', 'toc', 'figures', 'handwritten']:
     98        if mode in ['pages', 'toc', 'figures', 'notes', 'handwritten']:
    9999            # 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
    101104        else:
    102105            mode = None
     
    132135                    docinfo['numTextPages'] = getInt(getText(sys.find('countPages')))
    133136                    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')))
    135140                    docinfo['numTocEntries'] = getInt(getText(sys.find('countTocEntries')))
    136141                   
     
    162167                                   
    163168                    # toc
    164                     elif lt == 'toc' or lt == 'figures' or lt == 'handwritten':
     169                    elif lt in ['toc', 'figures', 'notes', 'notesHandwritten']:
    165170                        # contains tags with table of contents/figures
    166171                        # <item n="2.1." lv="2">CAP.I. <ref o="119">132</ref></item>
     
    661666        tocs = fulltoc[first:last]
    662667        tp = '<div>'
    663         label = {'figures': 'Figure', 'handwritten': 'Handwritten note'}.get(mode, 'Item')
     668        label = {'figures': 'Figure', 'notes': 'Note', 'handwritten': 'Handwritten note'}.get(mode, 'Item')
    664669        for toc in tocs:
    665670            pageurl = self.getLink('pn', toc['pn'])
    666671            tp += '<div class="tocline">'
    667672            content = toc['content']
     673            lvs = toc['level-string']
    668674            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)
    670678            else:
    671                 tp += '<div class="toc name">[%s %s]</div>'%(label, toc['level-string'])
     679                tp += '<div class="toc name">[%s]</div>'%(label)
    672680           
    673681            if toc.get('no', None):
Note: See TracChangeset for help on using the changeset viewer.