Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #42 from antonagestam/fix-missing-etag
Browse files Browse the repository at this point in the history
bugfix + version bump
  • Loading branch information
antonagestam committed Apr 14, 2014
2 parents c8bbe7c + 1150480 commit 504803c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.pyc
.coverage
.DS_Store
.coveragerc.swp
12 changes: 7 additions & 5 deletions collectfast/management/commands/collectstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,16 @@ def copy_file(self, path, prefixed_path, source_storage):
storage_lookup = self.get_lookup(normalized_path)
local_etag = self.get_file_hash(source_storage, path)

# Compare checksums and skip copying if matching
if storage_lookup.etag == local_etag:
self.log("Skipping '%s' based on matching ETags" % path,
level=2)
# Compare hashes and skip copying if matching
if (hasattr(storage_lookup, 'etag') and
storage_lookup.etag == local_etag):
self.log(
"Skipping '%s' based on matching file hashes" % path,
level=2)
self.num_skipped_files += 1
return False
else:
self.log("ETag didn't match", level=2)
self.log("Hashes did not match", level=2)
except Exception as e:
# Ignore errors and let super Command handle it
self.stdout.write(smart_str(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

setup(
name='Collectfast',
version='0.1.14',
description='Collectstatic on Steroids',
version='0.2.0',
long_description=open('README.md').read(),
author='Anton Agestam',
author_email='[email protected]',
Expand Down

0 comments on commit 504803c

Please sign in to comment.