src/reportlab/platypus/doctemplate.py
branchpy33
changeset 4020 13ff3d55b5c2
parent 4018 c69c31436936
child 4067 712e1822ca31
equal deleted inserted replaced
4019:dcbcae8fbb8f 4020:13ff3d55b5c2
   668         else:
   668         else:
   669             raise TypeError("argument pt should be string or integer or list")
   669             raise TypeError("argument pt should be string or integer or list")
   670 
   670 
   671     def handle_nextFrame(self,fx,resume=0):
   671     def handle_nextFrame(self,fx,resume=0):
   672         '''On endFrame change to the frame with name or index fx'''
   672         '''On endFrame change to the frame with name or index fx'''
   673         if isinstance(fx,str):
   673         if isinstance(fx,strTypes):
   674             for f in self.pageTemplate.frames:
   674             for f in self.pageTemplate.frames:
   675                 if f.id == fx:
   675                 if f.id == fx:
   676                     self._nextFrameIndex = self.pageTemplate.frames.index(f)
   676                     self._nextFrameIndex = self.pageTemplate.frames.index(f)
   677                     return
   677                     return
   678             raise ValueError("can't find frame('%s') in %r(%s) which has frames %r"%(fx,self.pageTemplate,self.pageTemplate.id,[(f,f.id) for f in self.pageTemplate.frames]))
   678             raise ValueError("can't find frame('%s') in %r(%s) which has frames %r"%(fx,self.pageTemplate,self.pageTemplate.id,[(f,f.id) for f in self.pageTemplate.frames]))
  1028         '''called after a flowable has been rendered'''
  1028         '''called after a flowable has been rendered'''
  1029         pass
  1029         pass
  1030 
  1030 
  1031     _allowedLifetimes = 'page','frame','build','forever'
  1031     _allowedLifetimes = 'page','frame','build','forever'
  1032     def docAssign(self,var,expr,lifetime):
  1032     def docAssign(self,var,expr,lifetime):
  1033         if not isinstance(expr,str): expr=str(expr)
  1033         if not isinstance(expr,strTypes): expr=str(expr)
  1034         expr=expr.strip()
  1034         expr=expr.strip()
  1035         var=var.strip()
  1035         var=var.strip()
  1036         self.docExec('%s=(%s)'%(var.strip(),expr.strip()),lifetime)
  1036         self.docExec('%s=(%s)'%(var.strip(),expr.strip()),lifetime)
  1037 
  1037 
  1038     def docExec(self,stmt,lifetime):
  1038     def docExec(self,stmt,lifetime):