src/reportlab/platypus/doctemplate.py
branchpy33
changeset 3850 52c3600611ec
parent 3795 2a6c4b74219f
child 3884 3bc59a4c3c21
--- a/src/reportlab/platypus/doctemplate.py	Wed Nov 27 15:18:57 2013 +0000
+++ b/src/reportlab/platypus/doctemplate.py	Wed Nov 27 16:35:31 2013 +0000
@@ -35,20 +35,12 @@
 from reportlab.rl_config import defaultPageSize, verbose
 import reportlab.lib.sequencer
 from reportlab.pdfgen import canvas
-from reportlab.lib.utils import isSeq
+from reportlab.lib.utils import isSeq, encode_label, decode_label
 try:
     set
 except NameError:
     from sets import Set as set
 
-from base64 import encodestring, decodestring
-try:
-    import pickle as pickle
-except ImportError:
-    import pickle
-dumps = pickle.dumps
-loads = pickle.loads
-
 import sys
 import logging
 logger = logging.getLogger("reportlab.platypus")
@@ -332,10 +324,10 @@
         self.data.append(args)
 
     def onDrawText(self,*args):
-        return '<onDraw name="%s" label="%s" />' % (self.name,encodestring(dumps(args)).strip())
+        return '<onDraw name="%s" label="%s" />' % (self.name,encode_label(args))
 
     def __call__(self,canv,kind,label):
-        self.add(*loads(decodestring(label)))
+        self.add(*decode_label(label))
 
     def attachToPageTemplate(self,pt):
         if pt.onPage:
@@ -374,7 +366,7 @@
         pass
 
     def onDrawStr(self,value,*args):
-        return onDrawStr(value,self,encodestring(dumps(args)).strip())
+        return onDrawStr(value,self,encode_label(args))
 
 class BaseDocTemplate:
     """