[Synopsis-changes] Synopsis/Synopsis/Synopsis/dist/command build_doc.py,1.7,1.8

Stefan Seefeld stefan at synopsis.fresco.org
Wed Nov 26 06:11:54 UTC 2003


Update of /cvs/synopsis/Synopsis/Synopsis/dist/command
In directory frida:/tmp/cvs-serv11295/Synopsis/dist/command

Modified Files:
	build_doc.py 
Log Message:
more work on document generation

Index: build_doc.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/dist/command/build_doc.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -d -r1.7 -r1.8
--- build_doc.py	25 Nov 2003 22:13:16 -0000	1.7
+++ build_doc.py	26 Nov 2003 06:11:51 -0000	1.8
@@ -19,16 +19,18 @@ class build_doc(build.build):
    def run(self):
       """Run this command, i.e. do the actual document generation."""
 
-      #self.manual()
-      self.tutorial()
+      self.build_lib = '.'
+
+      self.build_manual()
+      self.build_tutorial()
     
-   def manual(self):
+   def build_manual(self):
       """Build the manual."""
         
       self.announce("building reference manual")
       srcdir = os.path.abspath('doc/Manual/')
       tempdir = os.path.abspath(os.path.join(self.build_temp,
-                                               'share/doc/Synopsis/Manual'))
+                                             'share/doc/Synopsis/Manual'))
       cwd = os.getcwd()
       mkpath(tempdir, 0777, self.verbose, self.dry_run)
       spawn(['make', '-s', '-f', srcdir + '/Makefile', '-C', tempdir,
@@ -41,46 +43,30 @@ class build_doc(build.build):
       mkpath(os.path.join(builddir, 'html'), 0777, self.verbose, self.dry_run)
       copytree(os.path.join(tempdir, 'html'),
                os.path.join(builddir, 'html', 'Manual'))
+      mkpath(os.path.join(builddir, 'print'), 0777, self.verbose, self.dry_run)
+      copy_file(os.path.join(tempdir, 'Manual.pdf'),
+                os.path.join(builddir, 'print', 'Manual.pdf'))
 
-   def tutorial(self):
+   def build_tutorial(self):
       """Build the tutorial."""
 
       srcdir = os.path.abspath('doc/Tutorial/')
       tempdir = os.path.abspath(os.path.join(self.build_temp,
                                              'share/doc/Synopsis/Tutorial'))
-      builddir = os.path.abspath(os.path.join(self.build_lib,
-                                              'share/doc/Synopsis/print'))
+      cwd = os.getcwd()
+      mkpath(tempdir, 0777, self.verbose, self.dry_run)
+      spawn(['make', '-s', '-f', srcdir + '/Makefile', '-C', tempdir,
+             'srcdir=%s'%srcdir, 'topdir=%s'%cwd])
 
+
+      builddir = os.path.abspath(os.path.join(self.build_lib,
+                                              'share/doc/Synopsis'))
       if os.path.isdir(os.path.join(builddir, 'html', 'Tutorial')):
          rmtree(os.path.join(builddir, 'html', 'Tutorial'), 1)
-
-      xsltproc = find_executable('xsltproc')
-      if not xsltproc:
-         self.announce("cannot build html tutorial without 'xsltproc'")
-      else:
-         self.announce("building html tutorial")
-         command = [xsltproc, '--novalid',
-                    '-o', os.path.join(tempdir, 'html'),
-                    os.path.join(srcdir, 'html.xsl'),
-                    os.path.join(srcdir, 'synopsis.xml')]
-         if self.verbose:
-            print string.join(command)
-         if not self.dry_run:
-            mkpath(tempdir, 0777, self.verbose, self.dry_run)
-            spawn(command)
-            copytree(os.path.join(tempdir, 'html'),
-                     os.path.join(builddir, 'html', 'Tutorial'))
-
-      docbook2pdf = find_executable('docbook2pdf')
-      if not docbook2pdf:
-         self.announce("cannot build pdf docs without 'docbook2pdf'")
-      else:
-         self.announce("building pdf manual")
-         command = [docbook2pdf, '-o', os.path.join(tempdir, 'synopsis.pdf'),
-                    os.path.join(srcdir, 'synopsis.xml')]
-         if self.verbose:
-            print string.join(command)
-         if not self.dry_run:
-            spawn(command)
-         copy_file(os.path.join(tempdir, 'synopsis.pdf'), builddir)
+      mkpath(os.path.join(builddir, 'html'), 0777, self.verbose, self.dry_run)
+      copytree(os.path.join(tempdir, 'html'),
+               os.path.join(builddir, 'html', 'Tutorial'))
+      mkpath(os.path.join(builddir, 'print'), 0777, self.verbose, self.dry_run)
+      copy_file(os.path.join(tempdir, 'Tutorial.pdf'),
+                os.path.join(builddir, 'print', 'Tutorial.pdf'))
 





More information about the Synopsis-changes mailing list