Commit c3a7984b by Timothée Peignier

make packager play nicely with exotic or not so exotic storage

parent 6b6644e9
import os import os
import urlparse import urlparse
from django.core.files.base import ContentFile
from pipeline.conf import settings from pipeline.conf import settings
from pipeline.compilers import Compiler from pipeline.compilers import Compiler
from pipeline.compressors import Compressor from pipeline.compressors import Compressor
...@@ -79,9 +81,7 @@ class Packager(object): ...@@ -79,9 +81,7 @@ class Packager(object):
return self.compressor.compile_templates(package['templates']) return self.compressor.compile_templates(package['templates'])
def save_file(self, path, content): def save_file(self, path, content):
file = storage.open(path, 'wb') storage.save(path, ContentFile(content))
file.write(content)
file.close()
return path return path
def create_packages(self, config): def create_packages(self, config):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment