Browse files

Stopped the collectstatic management from being wastful with file han…

…dlers. Refs r17519.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
jezdez committed Feb 14, 2012
1 parent bd13cfa commit 803de60c088e7a439b5549575e1e3a082ae26d54
@@ -107,7 +107,7 @@ def collect(self):
prefixed_path = os.path.join(storage.prefix, path)
prefixed_path = path
- found_files[prefixed_path] =
+ found_files[prefixed_path] = (storage, path)
handler(path, prefixed_path, storage)
# Here we check if the storage backend has a post_process
@@ -198,7 +198,8 @@ def post_process(self, paths, dry_run=False, **options):
# use the original, local file, not the copied-but-unprocessed
# file, which might be somewhere far away, like S3
- with paths[name] as original_file:
+ storage, path = paths[name]
+ with as original_file:
# generate the hash with the original content, even for
# adjustable files.
@@ -281,8 +281,8 @@ StaticFilesStorage
.. versionadded:: 1.4
This method is called by the :djadmin:`collectstatic` management command
- after each run and gets passed the paths of found files, as well as the
- command line options.
+ after each run and gets passed the local storages and paths of found
+ files as a dictionary, as well as the command line options.
The :class:``
uses this behind the scenes to replace the paths with their hashed

0 comments on commit 803de60

Please sign in to comment.