reportlab/platypus/doctemplate.py
changeset 2466 0edb3b4ab6ff
parent 2460 dc28c1738ea9
child 2488 8bc9673fffa6
equal deleted inserted replaced
2465:5731db58d73c 2466:0edb3b4ab6ff
   398             self._emptyPages = self._emptyPages + 1
   398             self._emptyPages = self._emptyPages + 1
   399         else:
   399         else:
   400             self._emptyPages = 0
   400             self._emptyPages = 0
   401         if self._emptyPages >= self._emptyPagesAllowed:
   401         if self._emptyPages >= self._emptyPagesAllowed:
   402             if 1:
   402             if 1:
   403                 raise LayoutError("More than %d pages generated without content - halting layout.  Likely that a flowable is too large for any frame." % self._emptyPagesAllowed)
   403                 ident = "More than %d pages generated without content - halting layout.  Likely that a flowable is too large for any frame." % self._emptyPagesAllowed
       
   404                 #leave to keep apart from the raise
       
   405                 raise LayoutError(ident)
   404             else:
   406             else:
   405                 pass    #attempt to restore to good state
   407                 pass    #attempt to restore to good state
   406         else:
   408         else:
   407             if self._onProgress:
   409             if self._onProgress:
   408                 self._onProgress('PAGE', self.canv.getPageNumber())
   410                 self._onProgress('PAGE', self.canv.getPageNumber())
   605                 if n:
   607                 if n:
   606                     if self.frame.add(S[0], self.canv, trySplit=0):
   608                     if self.frame.add(S[0], self.canv, trySplit=0):
   607                         self._curPageFlowableCount = self._curPageFlowableCount + 1
   609                         self._curPageFlowableCount = self._curPageFlowableCount + 1
   608                         self.afterFlowable(S[0])
   610                         self.afterFlowable(S[0])
   609                     else:
   611                     else:
   610                         raise LayoutError("Splitting error(n==%d) on page %d in\n%s" % (n,self.page,f.identity(30)))
   612                         ident = "Splitting error(n==%d) on page %d in\n%s" % (n,self.page,f.identity(30))
       
   613                         #leave to keep apart from the raise
       
   614                         raise LayoutError(ident)
   611                     del S[0]
   615                     del S[0]
   612                     for f in xrange(n-1):
   616                     for f in xrange(n-1):
   613                         flowables.insert(f,S[f])    # put split flowables back on the list
   617                         flowables.insert(f,S[f])    # put split flowables back on the list
   614                 else:
   618                 else:
   615                     if hasattr(f,'_postponed'):
   619                     if hasattr(f,'_postponed'):
   616                         raise LayoutError("Flowable %s too large on page %d" % (f.identity(30), self.page))
   620                         ident = "Flowable %s too large on page %d" % (f.identity(30), self.page)
       
   621                         #leave to keep apart from the raise
       
   622                         raise LayoutError(ident)
   617                     # this ought to be cleared when they are finally drawn!
   623                     # this ought to be cleared when they are finally drawn!
   618                     f._postponed = 1
   624                     f._postponed = 1
   619                     flowables.insert(0,f)           # put the flowable back
   625                     flowables.insert(0,f)           # put the flowable back
   620                     self.handle_frameEnd()
   626                     self.handle_frameEnd()
   621 
   627