diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py
index a1d7875..360d0d3 100644
|
a
|
b
|
class ManifestFilesMixin(HashedFilesMixin):
|
| 300 | 300 | manifest_version = '1.0' # the manifest format standard |
| 301 | 301 | manifest_name = 'staticfiles.json' |
| 302 | 302 | |
| 303 | | def __init__(self, *args, **kwargs): |
| | 303 | def __init__(self, manifest_storage=None, *args, **kwargs): |
| 304 | 304 | super(ManifestFilesMixin, self).__init__(*args, **kwargs) |
| | 305 | if manifest_storage is None: |
| | 306 | manifest_storage = self |
| | 307 | self.manifest_storage = manifest_storage |
| 305 | 308 | self.hashed_files = self.load_manifest() |
| 306 | 309 | |
| 307 | 310 | def read_manifest(self): |
| 308 | 311 | try: |
| 309 | | with self.open(self.manifest_name) as manifest: |
| | 312 | with self.manifest_storage.open(self.manifest_name) as manifest: |
| 310 | 313 | return manifest.read().decode('utf-8') |
| 311 | 314 | except IOError: |
| 312 | 315 | return None |
| … |
… |
class ManifestFilesMixin(HashedFilesMixin):
|
| 336 | 339 | |
| 337 | 340 | def save_manifest(self): |
| 338 | 341 | payload = {'paths': self.hashed_files, 'version': self.manifest_version} |
| 339 | | if self.exists(self.manifest_name): |
| 340 | | self.delete(self.manifest_name) |
| | 342 | if self.manifest_storage.exists(self.manifest_name): |
| | 343 | self.manifest_storage.delete(self.manifest_name) |
| 341 | 344 | contents = json.dumps(payload).encode('utf-8') |
| 342 | | self._save(self.manifest_name, ContentFile(contents)) |
| | 345 | self.manifest_storage._save(self.manifest_name, ContentFile(contents)) |
| 343 | 346 | |
| 344 | 347 | |
| 345 | 348 | class _MappingCache(object): |