src/reportlab/graphics/testshapes.py
changeset 4567 5612ef8ef0a8
parent 4551 d357e2acc856
child 4708 cdb9ddeac15a
equal deleted inserted replaced
4566:c674840eeb28 4567:5612ef8ef0a8
    17 
    17 
    18 import os, sys, base64
    18 import os, sys, base64
    19 
    19 
    20 from reportlab.lib import colors
    20 from reportlab.lib import colors
    21 from reportlab.lib.units import cm
    21 from reportlab.lib.units import cm
    22 from reportlab.lib.utils import asNative
    22 from reportlab.lib.utils import asNative, base64_decodebytes
    23 from reportlab.pdfgen.canvas import Canvas
    23 from reportlab.pdfgen.canvas import Canvas
    24 from reportlab.pdfbase.pdfmetrics import stringWidth
    24 from reportlab.pdfbase.pdfmetrics import stringWidth
    25 from reportlab.platypus import Flowable
    25 from reportlab.platypus import Flowable
    26 from reportlab.graphics.shapes import *
    26 from reportlab.graphics.shapes import *
    27 from reportlab.graphics.renderPDF import _PDFRenderer
    27 from reportlab.graphics.renderPDF import _PDFRenderer
   454 
   454 
   455 def smallArrow():
   455 def smallArrow():
   456     '''create a small PIL image'''
   456     '''create a small PIL image'''
   457     from reportlab.graphics.renderPM import _getImage
   457     from reportlab.graphics.renderPM import _getImage
   458     from reportlab.lib.utils import getBytesIO
   458     from reportlab.lib.utils import getBytesIO
   459     b = base64.decodestring(b'''R0lGODdhCgAHAIMAAP/////29v/d3f+ysv9/f/9VVf9MTP8iIv8ICP8AAAAAAAAAAAAAAAAAAAAA
   459     b = base64_decodebytes(b'''R0lGODdhCgAHAIMAAP/////29v/d3f+ysv9/f/9VVf9MTP8iIv8ICP8AAAAAAAAAAAAAAAAAAAAA
   460 AAAAACwAAAAACgAHAAAIMwABCBxIsKABAQASFli4MAECAgEAJJhIceKBAQkyasx4YECBjx8TICAQ
   460 AAAAACwAAAAACgAHAAAIMwABCBxIsKABAQASFli4MAECAgEAJJhIceKBAQkyasx4YECBjx8TICAQ
   461 AIDJkwYEAFgZEAA7''')
   461 AIDJkwYEAFgZEAA7''')
   462     return _getImage().open(getBytesIO(b))
   462     return _getImage().open(getBytesIO(b))
   463 
   463 
   464 def getDrawing14():
   464 def getDrawing14():