Commit 8793b3a9 by Timothée Peignier

improve csstidy compressor

parent 63b266eb
......@@ -2,13 +2,9 @@ import os
import warnings
import tempfile
from django.conf import settings
from compress.conf import settings
from compress.compressors import CompressorBase
BINARY = getattr(settings, 'CSSTIDY_BINARY', 'csstidy')
ARGUMENTS = getattr(settings, 'CSSTIDY_ARGUMENTS', '--template=highest')
warnings.simplefilter('ignore', RuntimeWarning)
......@@ -20,7 +16,10 @@ class CSSTidyCompressor(CompressorBase):
output_file = tempfile.NamedTemporaryFile(mode='w+b')
command = '%s %s %s %s' % (BINARY, tmp_file.name, ARGUMENTS, output_file.name)
command = '%s %s %s %s' % (
settings.COMPRESS_CSSTIDY_BINARY, tmp_file.name,
settings.COMPRESS_CSSTIDY_ARGUMENTS, output_file.name
)
command_output = os.popen(command).read()
......
......@@ -29,6 +29,9 @@ COMPRESS_COMPILERS = getattr(settings, 'COMPRESS_COMPILERS', [])
COMPRESS_CSS = getattr(settings, 'COMPRESS_CSS', {})
COMPRESS_JS = getattr(settings, 'COMPRESS_JS', {})
COMPRESS_CSSTIDY_BINARY = '/usr/local/bin/csstidy'
COMPRESS_CSSTIDY_ARGUMENTS = '--template=highest'
COMPRESS_YUI_BINARY = getattr(settings, 'COMPRESS_YUI_BINARY', '/usr/local/bin/yuicompressor')
COMPRESS_YUI_CSS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_CSS_ARGUMENTS', '')
COMPRESS_YUI_JS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_JS_ARGUMENTS', '')
......
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