[Python-checkins] r64460 - in doctools/trunk: CHANGES sphinx/builder.py

georg.brandl python-checkins at python.org
Sun Jun 22 20:09:21 CEST 2008


Author: georg.brandl
Date: Sun Jun 22 20:09:21 2008
New Revision: 64460

Log:
Remove target directories in the static path before copying them again.


Modified:
   doctools/trunk/CHANGES
   doctools/trunk/sphinx/builder.py

Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES	(original)
+++ doctools/trunk/CHANGES	Sun Jun 22 20:09:21 2008
@@ -114,6 +114,8 @@
 * The LaTeX writer now translates line blocks with ``\raggedright``,
   which plays nicer with tables.
 
+* Fix bug with directories in the HTML builder static path.
+
 
 Release 0.3 (May 6, 2008)
 =========================

Modified: doctools/trunk/sphinx/builder.py
==============================================================================
--- doctools/trunk/sphinx/builder.py	(original)
+++ doctools/trunk/sphinx/builder.py	Sun Jun 22 20:09:21 2008
@@ -574,12 +574,12 @@
                 if filename.startswith('.'):
                     continue
                 fullname = path.join(staticdirname, filename)
+                targetname = path.join(self.outdir, '_static', filename)
                 if path.isfile(fullname):
-                    shutil.copyfile(fullname,
-                                    path.join(self.outdir, '_static', filename))
+                    shutil.copyfile(fullname, targetname)
                 elif path.isdir(fullname):
-                    shutil.copytree(fullname,
-                                    path.join(self.outdir, '_static', filename))
+                    shutil.rmtree(targetname)
+                    shutil.copytree(fullname, targetname)
         # add pygments style file
         f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w')
         f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet())


More information about the Python-checkins mailing list