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

This commit is contained in:
Georg Brandl 2008-06-22 18:09:21 +00:00
parent ccc3c55d25
commit a8f2f59c7d
2 changed files with 6 additions and 4 deletions

View File

@ -114,6 +114,8 @@ Bugs fixed
* The LaTeX writer now translates line blocks with ``\raggedright``, * The LaTeX writer now translates line blocks with ``\raggedright``,
which plays nicer with tables. which plays nicer with tables.
* Fix bug with directories in the HTML builder static path.
Release 0.3 (May 6, 2008) Release 0.3 (May 6, 2008)
========================= =========================

View File

@ -574,12 +574,12 @@ class StandaloneHTMLBuilder(Builder):
if filename.startswith('.'): if filename.startswith('.'):
continue continue
fullname = path.join(staticdirname, filename) fullname = path.join(staticdirname, filename)
targetname = path.join(self.outdir, '_static', filename)
if path.isfile(fullname): if path.isfile(fullname):
shutil.copyfile(fullname, shutil.copyfile(fullname, targetname)
path.join(self.outdir, '_static', filename))
elif path.isdir(fullname): elif path.isdir(fullname):
shutil.copytree(fullname, shutil.rmtree(targetname)
path.join(self.outdir, '_static', filename)) shutil.copytree(fullname, targetname)
# add pygments style file # add pygments style file
f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w') f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w')
f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet()) f.write(PygmentsBridge('html', self.config.pygments_style).get_stylesheet())