Exemplo n.º 1
0
 def drawIndexEntryEnd(canvas, kind, label):
     '''Callback to draw dots and page numbers after each entry.'''
     if not isStrType(label): label = label.decoce('utf-8')
     style = self.getLevelStyle(leveloffset)
     pages = decode_label(label)
     drawPageNumbers(canvas, style, pages, availWidth, availHeight,
                     self.dot)
Exemplo n.º 2
0
 def drawIndexEntryEnd(canvas, kind, label):
     """Callback to draw dots and page numbers after each entry."""
     if not isStrType(label):
         label = label.decoce("utf-8")
     style = self.getLevelStyle(leveloffset)
     pages = decode_label(label)
     drawPageNumbers(canvas, style, pages, availWidth, availHeight, self.dot)
Exemplo n.º 3
0
    def __call__(self,canv,kind,label):
        try:
            terms, format, offset = decode_label(label)
        except:
            terms = label
            format = offset = None
        if format is None:
            formatFunc = self.formatFunc
        else:
            formatFunc = self.getFormatFunc(format)
        if offset is None:
            offset = self.offset

        terms = commasplit(terms)
        pns = formatFunc(canv.getPageNumber()-offset)
        key = 'ix_%s_%s_p_%s' % (self.name, label, pns)

        info = canv._curr_tx_info
        canv.bookmarkHorizontal(key, info['cur_x'], info['cur_y'] + info['leading'])
        self.addEntry(terms, pns, key)
Exemplo n.º 4
0
    def __call__(self,canv,kind,label):
        try:
            terms, format, offset = decode_label(label)
        except:
            terms = label
            format = offset = None
        if format is None:
            formatFunc = self.formatFunc
        else:
            formatFunc = self.getFormatFunc(format)
        if offset is None:
            offset = self.offset

        terms = commasplit(terms)
        cPN = canv.getPageNumber()
        pns = formatFunc(cPN-offset)
        key = 'ix_%s_%s_p_%s' % (self.name, label, pns)

        info = canv._curr_tx_info
        canv.bookmarkHorizontal(key, info['cur_x'], info['cur_y'] + info['leading'])
        self.addEntry(terms, (cPN,pns), key)
Exemplo n.º 5
0
 def testLabelCoding(self):
     a = (1,2,[3,4],"a"), [1,2,"4",b'4']
     assert a == decode_label(encode_label(a))
Exemplo n.º 6
0
 def __call__(self,canv,kind,label):
     self.add(*decode_label(label))
Exemplo n.º 7
0
 def testLabelCoding(self):
     a = (1,2,[3,4],"a"), [1,2,"4",b'4']
     assert a == decode_label(encode_label(a))
Exemplo n.º 8
0
 def drawIndexEntryEnd(canvas, kind, label):
     '''Callback to draw dots and page numbers after each entry.'''
     style = self.getLevelStyle(leveloffset)
     pages = decode_label(label)
     drawPageNumbers(canvas, style, pages, availWidth, availHeight, self.dot)
Exemplo n.º 9
0
 def drawIndexEntryEnd(canvas, kind, label):
     '''Callback to draw dots and page numbers after each entry.'''
     style = self.getLevelStyle(leveloffset)
     pages = [(p[1], k) for p, k in sorted(decode_label(label))]
     drawPageNumbers(canvas, style, pages, availWidth, availHeight,
                     self.dot)
Exemplo n.º 10
0
 def __call__(self,canv,kind,label):
     v = decode_label(label)
     self.add(*v)
Exemplo n.º 11
0
 def drawIndexEntryEnd(canvas, kind, label):
     """Callback to draw dots and page numbers after each entry."""
     style = self.getLevelStyle(leveloffset)
     pages = [(p[1], k) for p, k in sorted(decode_label(label))]
     drawPageNumbers(canvas, style, pages, availWidth, availHeight, self.dot)