getpelican/pelican — pull request #1056 by bmcorser (2013-08-21 23:40:03+00:00)
Title: Fix for THEME_STATIC_PATHS by copying sensitively

If more than one path is defined in THEME_STATIC_PATHS, the theme's
static directory in output is deleted and replaced by the following
path's files.

Using `shutil.rmtree` to remove the entire destination tree if overwrite
is `True` assumes that we didn't want anything at all that was there. We
should recurse through the directory and their subdirs instead, leaving
things put there by the previous path where they were.

I lazily copied almost verbatim the solution for recursively copying a
diectory from http://stackoverflow.com/a/1994840.

The reason for this is patch is that without it, my plugin is broken! It
also makes my code a lot less crazy:

https://github.com/bmcorser/pelicanfly/commit/a83f066