Commit 9be0f293 by Timothée Peignier

Fix compressor calls

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