Commit 9be0f293 by Timothée Peignier

Fix compressor calls

parent cd14104f
......@@ -243,7 +243,7 @@ class SubProcessCompressor(CompressorBase):
else:
argument_list.extend(flattening_arg)
pipe = subprocess.Popen(argument_list, shell=True, stdout=subprocess.PIPE,
pipe = subprocess.Popen(argument_list, stdout=subprocess.PIPE,
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
if content:
content = smart_bytes(content)
......
......@@ -6,5 +6,5 @@ from pipeline.compressors import SubProcessCompressor
class ClosureCompressor(SubProcessCompressor):
def compress_js(self, js):
command = '%s %s' % (settings.CLOSURE_BINARY, settings.CLOSURE_ARGUMENTS)
command = (settings.CLOSURE_BINARY, settings.CLOSURE_ARGUMENTS)
return self.execute_command(command, js)
......@@ -6,5 +6,5 @@ from pipeline.compressors import SubProcessCompressor
class CSSMinCompressor(SubProcessCompressor):
def compress_css(self, css):
command = "%s %s" % (settings.CSSMIN_BINARY, settings.CSSMIN_ARGUMENTS)
command = (settings.CSSMIN_BINARY, settings.CSSMIN_ARGUMENTS)
return self.execute_command(command, css)
......@@ -10,8 +10,9 @@ class CSSTidyCompressor(SubProcessCompressor):
def compress_css(self, css):
output_file = tempfile.NamedTemporaryFile(suffix='.pipeline')
command = '%s - %s %s' % (
command = (
settings.CSSTIDY_BINARY,
"-",
settings.CSSTIDY_ARGUMENTS,
output_file.name
)
......
......@@ -6,7 +6,7 @@ from pipeline.compressors import SubProcessCompressor
class UglifyJSCompressor(SubProcessCompressor):
def compress_js(self, js):
command = '%s %s' % (settings.UGLIFYJS_BINARY, settings.UGLIFYJS_ARGUMENTS)
command = (settings.UGLIFYJS_BINARY, settings.UGLIFYJS_ARGUMENTS)
if self.verbose:
command += ' --verbose'
return self.execute_command(command, js)
......@@ -6,7 +6,11 @@ from pipeline.compressors import SubProcessCompressor
class YuglifyCompressor(SubProcessCompressor):
def compress_common(self, content, compress_type, arguments):
command = '%s --type=%s %s' % (settings.YUGLIFY_BINARY, compress_type, arguments)
command = (
settings.YUGLIFY_BINARY,
"--type={}".format(compress_type),
arguments
)
return self.execute_command(command, content)
def compress_js(self, js):
......
......@@ -6,7 +6,11 @@ from pipeline.compressors import SubProcessCompressor
class YUICompressor(SubProcessCompressor):
def compress_common(self, content, compress_type, arguments):
command = '%s --type=%s %s' % (settings.YUI_BINARY, compress_type, arguments)
command = (
settings.YUI_BINARY,
"--type={}".format(compress_type),
arguments
)
return self.execute_command(command, content)
def compress_js(self, js):
......
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