Removed 0 from multiBuild stuff prior to further changes;
authorandy_robinson
Mon, 26 Nov 2001 21:49:01 +0000
changeset 1440 243d35446390
parent 1439 13fe2f565cf5
child 1441 c096915ab6dd
Removed 0 from multiBuild stuff prior to further changes; ensured test suite really does run silently when making manuals.
reportlab/lib/abag.py
reportlab/lib/tocindex.py
reportlab/platypus/doctemplate.py
reportlab/platypus/tableofcontents.py
reportlab/test/test_charts_textlabels.py
reportlab/test/test_docs_build.py
reportlab/test/test_hello.py
reportlab/test/test_platypus_breaking.py
reportlab/test/test_platypus_paragraphs.py
reportlab/test/test_platypus_toc.py
reportlab/tools/docco/docpy.py
reportlab/tools/docco/graphdocpy.py
--- a/reportlab/lib/abag.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/lib/abag.py	Mon Nov 26 21:49:01 2001 +0000
@@ -1,12 +1,13 @@
 #copyright ReportLab Inc. 2000
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/abag.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/lib/abag.py,v 1.4 2001/01/19 11:45:16 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/lib/abag.py,v 1.5 2001/11/26 21:49:01 andy_robinson Exp $
 
 class ABag:
 	"""
-	A trivial BAG class for holding attributes.
+	'Attribute Bag' - a trivial BAG class for holding attributes.
 
+	You may initialize with keyword arguments.
 	a = ABag(k0=v0,....,kx=vx,....) ==> getattr(a,'kx')==vx
 
 	c = a.clone(ak0=av0,.....) copy with optional additional attributes.
--- a/reportlab/lib/tocindex.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/lib/tocindex.py	Mon Nov 26 21:49:01 2001 +0000
@@ -2,8 +2,8 @@
 #copyright ReportLab Inc. 2000
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/tocindex.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/lib/tocindex.py,v 1.7 2001/03/16 14:51:50 rgbecker Exp $
-__version__=''' $Id: tocindex.py,v 1.7 2001/03/16 14:51:50 rgbecker Exp $ '''
+#$Header: /tmp/reportlab/reportlab/lib/tocindex.py,v 1.8 2001/11/26 21:49:01 andy_robinson Exp $
+__version__=''' $Id: tocindex.py,v 1.8 2001/11/26 21:49:01 andy_robinson Exp $ '''
 __doc__=''
 """
 This module will contain standard Table of Contents and Index objects.
@@ -15,7 +15,7 @@
 
 from reportlab.platypus import Flowable, BaseDocTemplate, Paragraph, \
      PageBreak, Frame, PageTemplate, NextPageTemplate
-from reportlab.platypus.doctemplate import IndexingFlowable0
+from reportlab.platypus.doctemplate import IndexingFlowable
 from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
 from reportlab.platypus import tables
 from reportlab.lib import enums
@@ -60,7 +60,7 @@
 
 
 
-class TableOfContents0(IndexingFlowable0):
+class TableOfContents0(IndexingFlowable):
     """This creates a formatted table of contents.  It presumes
     a correct block of data is passed in.  The data block contains
     a list of (level, text, pageNumber) triplets.  You can supply
@@ -211,7 +211,7 @@
     story = [Paragraph("This is a demo of the table of contents object",
                        styles['Heading1'])]
 
-    toc = TableOfContents0()  # empty on first pass
+    toc = TableOfContents()  # empty on first pass
     #toc.addEntries(TOCData)  # init with random page numbers
     story.append(toc)
 
@@ -259,17 +259,17 @@
 
         if hasattr(flowable, 'style'):
             if flowable.style.name == 'Heading1':
-                self.notify0('TOCEntry', (0, flowable.getPlainText(), self.page))
+                self.notify('TOCEntry', (0, flowable.getPlainText(), self.page))
                 self.canv.bookmarkPage(str(self._uniqueKey))
                 self.canv.addOutlineEntry(flowable.getPlainText()[0:10], str(self._uniqueKey), 0)
 
             elif flowable.style.name == 'Heading2':
-                self.notify0('TOCEntry', (1, flowable.getPlainText(), self.page))
+                self.notify('TOCEntry', (1, flowable.getPlainText(), self.page))
                 self.canv.bookmarkPage(str(self._uniqueKey))
                 self.canv.addOutlineEntry(flowable.getPlainText(), str(self._uniqueKey), 1)
 
             elif flowable.style.name == 'Heading3':
-                self.notify0('TOCEntry', (2, flowable.getPlainText(), self.page))
+                self.notify('TOCEntry', (2, flowable.getPlainText(), self.page))
                 self.canv.bookmarkPage(str(self._uniqueKey))
                 self.canv.addOutlineEntry(flowable.getPlainText(), str(self._uniqueKey), 2)
 
@@ -290,4 +290,4 @@
     #change this to depth=3 for a BIG document
     story = getSampleStory(depth=2)
 
-    doc.multiBuild0(story, 'tocindex.pdf')
+    doc.multiBuild(story, 'tocindex.pdf')
--- a/reportlab/platypus/doctemplate.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/platypus/doctemplate.py	Mon Nov 26 21:49:01 2001 +0000
@@ -1,9 +1,9 @@
 #copyright ReportLab Inc. 2000
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/doctemplate.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/platypus/doctemplate.py,v 1.48 2001/11/19 11:33:19 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/platypus/doctemplate.py,v 1.49 2001/11/26 21:49:01 andy_robinson Exp $
 
-__version__=''' $Id: doctemplate.py,v 1.48 2001/11/19 11:33:19 rgbecker Exp $ '''
+__version__=''' $Id: doctemplate.py,v 1.49 2001/11/26 21:49:01 andy_robinson Exp $ '''
 
 __doc__="""
 This module contains the core structure of platypus.
@@ -44,7 +44,7 @@
 	pass
 
 
-class IndexingFlowable0(Flowable):
+class IndexingFlowable(Flowable):
 	"""Abstract interface definition for flowables which might
 	hold references to other pages or themselves be targets
 	of cross-references.  XRefStart, XRefDest, Table of Contents,
@@ -562,7 +562,7 @@
 
 		self._endBuild()
 
-	def _allSatisfied0(self):
+	def _allSatisfied(self):
 		"""Called by multi-build - are all cross-references resolved?"""
 		allHappy = 1
 		for f in self._indexingFlowables:
@@ -571,18 +571,18 @@
 				break
 		return allHappy
 
-	def notify0(self, kind, stuff):
+	def notify(self, kind, stuff):
 		""""Forward to any listeners"""
 		for l in self._indexingFlowables:
 			l.notify(kind, stuff)
 
-	def pageRef0(self, label):
+	def pageRef(self, label):
 		"""hook to register a page number"""
 		if _verbose: print "pageRef called with label '%s' on page %d" % (
 			label, self.page)
 		self._pageRefs[label] = self.page
 
-	def multiBuild0(self, story,
+	def multiBuild(self, story,
 				   filename=None,
 				   canvasmaker=canvas.Canvas,
 				   maxPasses = 10):
@@ -595,7 +595,7 @@
 				self._indexingFlowables.append(thing)
 		#print 'scanned story, found these indexing flowables:\n'
 		#print self._indexingFlowables
-
+		
 		passes = 0
 		while 1:
 			passes = passes + 1
@@ -607,7 +607,7 @@
 			# work with a copy of the story, since it is consumed
 			tempStory = story[:]
 			self.build(tempStory, filename, canvasmaker)
-			#self.notify0('debug',None)
+			#self.notify('debug',None)
 
 			#clean up so multi-build does not go wrong - the frame
 			#packer might have tacked an attribute onto some
@@ -621,7 +621,7 @@
 			for fl in self._indexingFlowables:
 				fl.afterBuild()
 
-			happy = self._allSatisfied0()
+			happy = self._allSatisfied()
 
 			if happy:
 				## print 'OK'
--- a/reportlab/platypus/tableofcontents.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/platypus/tableofcontents.py	Mon Nov 26 21:49:01 2001 +0000
@@ -1,27 +1,27 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/tableofcontents.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/platypus/tableofcontents.py,v 1.2 2001/04/05 09:30:12 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/platypus/tableofcontents.py,v 1.3 2001/11/26 21:49:01 andy_robinson Exp $
 """
-This module defines a single TableOfContents0() class that can be used to
+This module defines a single TableOfContents() class that can be used to
 create automatically a table of tontents for Platypus documents like
 this:
 
     story = []
-    toc = TableOfContents0()
+    toc = TableOfContents()
     story.append(toc)
     # some heading paragraphs here...
     doc = MyTemplate(path)
-    doc.multiBuild0(story)
+    doc.multiBuild(story)
 
 The data needed to create the table is a list of (level, text, pageNum)
 triplets, plus some paragraph styles for each level of the table itself.
 The triplets will usually be created in a document template's method
-like afterFlowable(), making notification calls using the notify0()
+like afterFlowable(), making notification calls using the notify()
 method with appropriate data like this:
 
     (level, text, pageNum) = ...
-    self.notify0('TOCEntry', (level, text, pageNum))
+    self.notify('TOCEntry', (level, text, pageNum))
 
 As the table of contents need at least two passes over the Platypus
 story which is why the moultiBuild0() method must be called.
@@ -39,7 +39,7 @@
 from reportlab.lib.units import cm
 from reportlab.lib.styles import ParagraphStyle
 from reportlab.platypus.paragraph import Paragraph
-from reportlab.platypus.doctemplate import IndexingFlowable0
+from reportlab.platypus.doctemplate import IndexingFlowable
 from reportlab.platypus.tables import TableStyle, Table
 
 
@@ -91,7 +91,7 @@
     TableStyle([('VALIGN', (0,0), (-1,-1), 'TOP')])
 
 
-class TableOfContents0(IndexingFlowable0):
+class TableOfContents(IndexingFlowable):
     """This creates a formatted table of contents.
 
     It presumes a correct block of data is passed in.
@@ -128,7 +128,7 @@
         return (self._entries == self._lastEntries)
 
 
-    # Shouldn't that be notify0??
+    # Shouldn't that be notify??
     def notify(self, kind, stuff):
         """The notification hook called to register all kinds of events.
 
--- a/reportlab/test/test_charts_textlabels.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/test/test_charts_textlabels.py	Mon Nov 26 21:49:01 2001 +0000
@@ -1,7 +1,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/test/test_charts_textlabels.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/test/test_charts_textlabels.py,v 1.1 2001/06/07 15:27:03 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/test/test_charts_textlabels.py,v 1.2 2001/11/26 21:49:01 andy_robinson Exp $
 """
 Tests for the text Label class.
 """
@@ -270,7 +270,7 @@
         tempfile.tempdir = os.curdir
         path = join(tempfile.tempdir, pdfPath)
         doc = MyDocTemplate(path)
-        doc.multiBuild0(story)
+        doc.multiBuild(story)
 
 
 def makeSuite():
--- a/reportlab/test/test_docs_build.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/test/test_docs_build.py	Mon Nov 26 21:49:01 2001 +0000
@@ -28,7 +28,7 @@
         if os.path.isfile('graphics_reference.pdf'):
             os.remove('graphics_reference.pdf')
         
-        os.system("python genAll.py -quiet")
+        os.system("python genAll.py -s")
 
         assert os.path.isfile('userguide.pdf'), 'genAll.py failed to generate userguide.pdf!'
         assert os.path.isfile('graphguide.pdf'), 'genAll.py failed to generate graphguide.pdf!'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportlab/test/test_hello.py	Mon Nov 26 21:49:01 2001 +0000
@@ -0,0 +1,34 @@
+#!/bin/env python
+#copyright ReportLab Inc. 2000
+#see license.txt for license details
+#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/pdfgen/test/test_hello.py?cvsroot=reportlab
+#$Header: /tmp/reportlab/reportlab/test/test_hello.py,v 1.1 2001/11/26 21:49:01 andy_robinson Exp $
+__version__=''' $Id'''
+__doc__="""most basic test possible that makes a PDF.
+
+Useful if you want to test that a really minimal PDF is healthy,
+since the output is about the smallest thing we can make."""
+
+from reportlab.test import unittest
+from reportlab.pdfgen.canvas import Canvas
+
+def run():
+    c = Canvas('test_hello.pdf')
+    c.setFont('Helvetica-Bold', 36)
+    c.drawString(100,700, 'Hello World')
+    c.save()
+
+
+class HelloTestCase(unittest.TestCase):
+    "Simplest test that makes PDF"
+    def test(self):
+        run()
+
+def makeSuite():
+    suite = unittest.TestSuite()
+    suite.addTest(HelloTestCase('test'))
+    return suite
+
+if __name__ == "__main__": #NORUNTESTS
+    unittest.TextTestRunner().run(makeSuite())
+
--- a/reportlab/test/test_platypus_breaking.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/test/test_platypus_breaking.py	Mon Nov 26 21:49:01 2001 +0000
@@ -1,7 +1,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/test/test_platypus_paragraphs.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/test/test_platypus_breaking.py,v 1.2 2001/11/19 11:31:43 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/test/test_platypus_breaking.py,v 1.3 2001/11/26 21:49:01 andy_robinson Exp $
 """Tests pageBreakBefore, frameBreakBefore, keepWithNext...
 """
 
@@ -71,28 +71,30 @@
 
 	story.append(Paragraph("""
 		Subsequent pages test pageBreakBefore, frameBreakBefore and
-		keepTogether attributes.  Generated at %s """ % time.ctime(time.time()),
+		keepTogether attributes.  Generated at %s.  The number in brackets
+		at the end of each paragraph is its position in the story. (%d)""" % (
+			time.ctime(time.time()), len(story)),
 						   bt))
 
 
 	for i in range(10):
-		story.append(Paragraph('Heading 1 always starts a new page', h1))
+		story.append(Paragraph('Heading 1 always starts a new page (%d)' % len(story), h1))
 		for j in range(3):
 			story.append(Paragraph('Heading1 paragraphs should always'
 							'have a page break before.	Heading 2 on the other hand'
-							'should always have a FRAME break before', bt))
-			story.append(Paragraph('Heading 2 always starts a new frame', h2))
+							'should always have a FRAME break before (%d)' % len(story), bt))
+			story.append(Paragraph('Heading 2 always starts a new frame (%d)' % len(story), h2))
 			story.append(Paragraph('Heading1 paragraphs should always'
 							'have a page break before.	Heading 2 on the other hand'
-							'should always have a FRAME break before', bt))
+							'should always have a FRAME break before (%d)' % len(story), bt))
 			for j in range(3):
-				story.append(Paragraph(randomText(theme=PYTHON, sentences=2), bt))
-				story.append(Paragraph('I should never be at the bottom of a frame', h3))
-				story.append(Paragraph(randomText(theme=PYTHON, sentences=1), bt))
+				story.append(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt))
+				story.append(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h3))
+				story.append(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt))
 
 
 	doc = MyDocTemplate('test_platypus_breaking.pdf')
-	doc.multiBuild0(story)
+	doc.multiBuild(story)
 
 class BreakingTestCase(unittest.TestCase):
 	"Test multi-page splitting of paragraphs (eyeball-test)."
--- a/reportlab/test/test_platypus_paragraphs.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/test/test_platypus_paragraphs.py	Mon Nov 26 21:49:01 2001 +0000
@@ -1,7 +1,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/test/test_platypus_paragraphs.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/test/test_platypus_paragraphs.py,v 1.6 2001/04/05 09:30:12 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/test/test_platypus_paragraphs.py,v 1.7 2001/11/26 21:49:01 andy_robinson Exp $
 """Tests for the reportlab.platypus.paragraphs module.
 """
 
@@ -25,7 +25,7 @@
 from reportlab.platypus.doctemplate \
      import PageTemplate, BaseDocTemplate
 from reportlab.platypus import tableofcontents
-from reportlab.platypus.tableofcontents import TableOfContents0
+from reportlab.platypus.tableofcontents import TableOfContents
 from reportlab.platypus.tables import TableStyle, Table
 from reportlab.platypus.paragraph import *
 from reportlab.platypus.paragraph import _getFragWords
@@ -71,7 +71,7 @@
         story.append(Paragraph(description, bt))
 
         doc = MyDocTemplate('test_paragraphs_splitting.pdf')
-        doc.multiBuild0(story)
+        doc.multiBuild(story)
 
 
 class FragmentTestCase(unittest.TestCase):
--- a/reportlab/test/test_platypus_toc.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/test/test_platypus_toc.py	Mon Nov 26 21:49:01 2001 +0000
@@ -1,7 +1,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/test/test_platypus_toc.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/test/test_platypus_toc.py,v 1.6 2001/04/05 09:30:12 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/test/test_platypus_toc.py,v 1.7 2001/11/26 21:49:01 andy_robinson Exp $
 """Tests for the Platypus TableOfContents class.
 
 Currently there is only one such test. Most such tests, like this
@@ -24,9 +24,9 @@
 from reportlab.platypus.doctemplate \
      import PageTemplate, BaseDocTemplate
 from reportlab.platypus import tableofcontents
-from reportlab.platypus.tableofcontents import TableOfContents0
+from reportlab.platypus.tableofcontents import TableOfContents
 from reportlab.platypus.tables import TableStyle, Table
-
+from reportlab.lib import randomtext
 
 def myMainPageFrame(canvas, doc):
     "The page frame used for all PDF documents."
@@ -64,7 +64,7 @@
                 level = int(styleName[7:])
                 text = flowable.getPlainText()
                 pageNum = self.page 
-                self.notify0('TOCEntry', (level, text, pageNum))
+                self.notify('TOCEntry', (level, text, pageNum))
 
                 # Add PDF outline entries (not really needed/tested here).
                 key = str(hash(flowable))
@@ -89,6 +89,9 @@
 
     return style
 
+def makeBodyStyle():
+    "Body text style - the default will do"
+    return ParagraphStyle('body')
 
 def makeTocHeaderStyle(level, delta, epsilon, fontName='Times-Roman'):
     "Make a header style for different levels."
@@ -110,7 +113,7 @@
 
 
 class TocTestCase(unittest.TestCase):
-    "Test TableOfContents0 class (eyeball-test)."
+    "Test TableOfContents class (eyeball-test)."
     
     def test1(self):
         """Test story with TOC and a cascaded header hierarchy.
@@ -149,18 +152,22 @@
         description = '<font color=red>%s</font>' % self.test1.__doc__
         story.append(XPreformatted(description, bt))
 
-        toc = TableOfContents0()
+        toc = TableOfContents()
         toc.levelStyles = tocLevelStyles
         story.append(toc)
 
         for i in range(maxLevels):
             story.append(Paragraph('HEADER, LEVEL %d' % i,
                                    headerLevelStyles[i]))
+            #now put some body stuff in.
+            txt = randomtext.randomText(randomtext.PYTHON, 5)
+            para = Paragraph(txt, makeBodyStyle())
+            story.append(para)
 
         tempfile.tempdir = os.curdir
         path = join(tempfile.tempdir, 'test_platypus_toc.pdf')
         doc = MyDocTemplate(path)
-        doc.multiBuild0(story)
+        doc.multiBuild(story)
         
 
 def makeSuite():
--- a/reportlab/tools/docco/docpy.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/tools/docco/docpy.py	Mon Nov 26 21:49:01 2001 +0000
@@ -2,7 +2,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/docpy.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/tools/docco/docpy.py,v 1.2 2001/09/06 09:36:06 dinu_gherman Exp $
+#$Header: /tmp/reportlab/reportlab/tools/docco/docpy.py,v 1.3 2001/11/26 21:49:01 andy_robinson Exp $
 
 """Generate documentation from live Python objects.
 
@@ -48,7 +48,7 @@
 from reportlab.platypus.paragraph import Paragraph
 from reportlab.platypus.flowables \
      import Flowable, Preformatted,Spacer, Image, KeepTogether, PageBreak
-from reportlab.platypus.tableofcontents import TableOfContents0
+from reportlab.platypus.tableofcontents import TableOfContents
 from reportlab.platypus.xpreformatted import XPreformatted
 from reportlab.platypus.frames import Frame
 from reportlab.platypus.doctemplate \
@@ -128,7 +128,7 @@
             if name7 == 'Heading':
                 # Register TOC entries.
                 headLevel = int(f.style.name[7:])
-                self.notify0('TOCEntry', (headLevel, flowable.getPlainText(), self.page))
+                self.notify('TOCEntry', (headLevel, flowable.getPlainText(), self.page))
 
                 # Add PDF outline entries.
                 c = self.canv
@@ -821,7 +821,7 @@
         self.story.append(PageBreak())
 
         # Table of contents
-        toc = TableOfContents0()
+        toc = TableOfContents()
         self.story.append(toc)
         self.story.append(PageBreak())
 
@@ -836,7 +836,7 @@
         
         if self.outPath:
             doc = MyTemplate(self.outPath)
-            doc.multiBuild0(self.story)
+            doc.multiBuild(self.story)
 
 
     def beginPackage(self, name):
--- a/reportlab/tools/docco/graphdocpy.py	Mon Nov 26 20:48:09 2001 +0000
+++ b/reportlab/tools/docco/graphdocpy.py	Mon Nov 26 21:49:01 2001 +0000
@@ -2,7 +2,7 @@
 #copyright ReportLab Inc. 2000-2001
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/graphdocpy.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/tools/docco/graphdocpy.py,v 1.10 2001/10/12 14:59:29 rgbecker Exp $
+#$Header: /tmp/reportlab/reportlab/tools/docco/graphdocpy.py,v 1.11 2001/11/26 21:49:01 andy_robinson Exp $
 
 """Generate documentation for reportlab.graphics classes.
 
@@ -35,7 +35,7 @@
 from reportlab.pdfgen import canvas
 from reportlab.platypus.flowables import Flowable, Spacer
 from reportlab.platypus.paragraph import Paragraph
-from reportlab.platypus.tableofcontents import TableOfContents0
+from reportlab.platypus.tableofcontents import TableOfContents
 from reportlab.platypus.flowables \
      import Flowable, Preformatted,Spacer, Image, KeepTogether, PageBreak
 from reportlab.platypus.xpreformatted import XPreformatted
@@ -124,7 +124,7 @@
             if f.style.name[:7] == 'Heading':
                 # Register TOC entries.
                 headLevel = int(f.style.name[7:])
-                self.notify0('TOCEntry', (headLevel, flowable.getPlainText(), self.page))
+                self.notify('TOCEntry', (headLevel, flowable.getPlainText(), self.page))
 
                 # Add PDF outline entries.
                 c = self.canv
@@ -261,7 +261,7 @@
         self.story.append(PageBreak())
 
         # Table of contents
-        toc = TableOfContents0()
+        toc = TableOfContents()
         self.story.append(toc)
         self.story.append(PageBreak())
 
@@ -278,7 +278,7 @@
         
         if self.outPath:
             doc = MyTemplate(self.outPath)
-            doc.multiBuild0(self.story)
+            doc.multiBuild(self.story)
 
         
     def beginModule(self, name, doc, imported):
@@ -991,7 +991,7 @@
 
     # On -s set silent mode.
     isSilent = hasOpt('-s')
-
+    
     # On -f set the appropriate DocBuilder to use or a default one.
     builderClassName = optsDict.get('-f', 'GraphPdf') + 'DocBuilder0'
     if builderClassName in ('PdfDocBuilder0', 'HtmlDocBuilder0'):
@@ -1028,7 +1028,8 @@
         import shutil, reportlab
         dst = os.path.join(os.path.dirname(reportlab.__file__),'docs','graphics_reference.pdf')
         shutil.copyfile('reportlab.graphics.pdf', dst)
-        print 'copied to '+dst
+        if not isSilent:
+            print 'copied to '+dst
 
 def makeSuite():
     "standard test harness support - run self as separate process"