Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

            def encode_label(args):
        return base64_encodestring(pickle_dumps(args)).strip()
        


src/r/e/reportlab-3.1.8/src/reportlab/platypus/tableofcontents.py   reportlab(Download)
from reportlab.lib import enums
from reportlab.lib.units import cm
from reportlab.lib.utils import commasplit, escapeOnce, encode_label, decode_label, strTypes
from reportlab.lib.styles import ParagraphStyle, _baseFontName
from reportlab.platypus.paragraph import Paragraph
                lastTexts = texts
                texts = texts[i:]
            label = encode_label(list(pageNumbers))
            texts[-1] = '%s<onDraw name="drawIndexEntryEnd" label="%s"/>' % (texts[-1], label)
            for text in texts:

src/r/e/reportlab-3.1.8/src/reportlab/platypus/paraparser.py   reportlab(Download)
 
from reportlab.lib.abag import ABag
from reportlab.lib.utils import ImageReader, isPy3, annotateException, encode_label, asUnicode, asBytes, uniChr
from reportlab.lib.colors import toColor, white, black, red, Color
from reportlab.lib.fonts import tt2ps, ps2tt
            except:
                raise ValueError('index tag offset is %r not an int' % offset)
        defn.label = encode_label((label,format,offset))
        defn.name = name
        defn.kind='index'

src/r/e/reportlab-3.1.8/src/reportlab/platypus/doctemplate.py   reportlab(Download)
import reportlab.lib.sequencer
from reportlab.pdfgen import canvas
from reportlab.lib.utils import isSeq, encode_label, decode_label, annotateException, strTypes
try:
    set
    def onDrawText(self,*args):
        return '<onDraw name="%s" label="%s" />' % (self.name,encode_label(args))
 
    def __call__(self,canv,kind,label):
        self.add(*decode_label(label))
    def onDrawStr(self,value,*args):
        return onDrawStr(value,self,encode_label(args))
 
class BaseDocTemplate:
    """

src/r/e/reportlab-3.1.8/tests/test_utils.py   reportlab(Download)
setOutDir(__name__)
import unittest
from reportlab.lib.utils import FmtSelfDict, encode_label, decode_label
 
class FmtTestCase(unittest.TestCase):
    def testLabelCoding(self):
        a = (1,2,[3,4],"a"), [1,2,"4",b'4']
        assert a == decode_label(encode_label(a))
 
def makeSuite():