Minor updates to the conditions.
This commit is contained in:
@@ -18,6 +18,7 @@ class Compressor(object):
|
|||||||
self.output_prefix = output_prefix
|
self.output_prefix = output_prefix
|
||||||
self.split_content = []
|
self.split_content = []
|
||||||
self._parser = None
|
self._parser = None
|
||||||
|
self.charset = settings.DEFAULT_CHARSET
|
||||||
|
|
||||||
def split_contents(self):
|
def split_contents(self):
|
||||||
raise NotImplementedError('split_contents must be defined in a subclass')
|
raise NotImplementedError('split_contents must be defined in a subclass')
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class YUICompressorFilter(FilterBase):
|
|||||||
arguments = ''
|
arguments = ''
|
||||||
if self.type == 'js':
|
if self.type == 'js':
|
||||||
arguments = settings.COMPRESS_YUI_JS_ARGUMENTS
|
arguments = settings.COMPRESS_YUI_JS_ARGUMENTS
|
||||||
if self.type == 'css':
|
elif self.type == 'css':
|
||||||
arguments = settings.COMPRESS_YUI_CSS_ARGUMENTS
|
arguments = settings.COMPRESS_YUI_CSS_ARGUMENTS
|
||||||
|
|
||||||
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, self.type, arguments)
|
command = '%s --type=%s %s' % (settings.COMPRESS_YUI_BINARY, self.type, arguments)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class CompressorNode(template.Node):
|
|||||||
return content
|
return content
|
||||||
if self.kind == 'css':
|
if self.kind == 'css':
|
||||||
compressor = CssCompressor(content)
|
compressor = CssCompressor(content)
|
||||||
if self.kind == 'js':
|
elif self.kind == 'js':
|
||||||
compressor = JsCompressor(content)
|
compressor = JsCompressor(content)
|
||||||
cachekey = "%s.%s" % (compressor.cachekey, self.mode)
|
cachekey = "%s.%s" % (compressor.cachekey, self.mode)
|
||||||
output = self.cache_get(cachekey)
|
output = self.cache_get(cachekey)
|
||||||
@@ -56,8 +56,10 @@ class CompressorNode(template.Node):
|
|||||||
try:
|
try:
|
||||||
if self.mode == OUTPUT_FILE:
|
if self.mode == OUTPUT_FILE:
|
||||||
output = compressor.output()
|
output = compressor.output()
|
||||||
else:
|
elif self.mode == OUTPUT_INLINE:
|
||||||
output = compressor.output_inline()
|
output = compressor.output_inline()
|
||||||
|
else:
|
||||||
|
output = content
|
||||||
self.cache_set(cachekey, output)
|
self.cache_set(cachekey, output)
|
||||||
except:
|
except:
|
||||||
from traceback import format_exc
|
from traceback import format_exc
|
||||||
|
|||||||
Reference in New Issue
Block a user