Created
January 30, 2014 17:26
-
-
Save jobelenus/8713919 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from compressor.conf import settings | |
class DynamicManifestStorageMixin(object): | |
""" | |
Use this Mixin to dynamically name the manifest file which will prevent | |
problems surrounding CDN edges/TTL and purge commands taking minutes | |
""" | |
def get_available_name(self, name): | |
""" | |
Determine filename to save | |
""" | |
dir_name, file_name = os.path.split(name) | |
file_root, file_ext = os.path.splitext(file_name) | |
if file_name == settings.COMPRESS_OFFLINE_MANIFEST: | |
file_name = self._get_dynamic_name() | |
return os.path.join(dir_name, file_name) | |
def _get_dynamic_name(self): | |
return '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment