Minor style changes.

This commit is contained in:
Jannis Leidel
2011-05-13 11:59:42 +02:00
parent c5a369f185
commit 64f5b6df61

View File

@@ -122,17 +122,16 @@ class Compressor(object):
return content
attrs = self.parser.elem_attribs(elem)
mimetype = attrs.get("type", None)
if mimetype is not None:
if mimetype:
command = self.all_mimetypes.get(mimetype)
if command is None:
if mimetype not in ("text/css", "text/javascript"):
error = ("Couldn't find any precompiler in "
"COMPRESS_PRECOMPILERS setting for "
"mimetype '%s'." % mimetype)
raise CompressorError(error)
raise CompressorError("Couldn't find any precompiler in "
"COMPRESS_PRECOMPILERS setting for "
"mimetype '%s'." % mimetype)
else:
content = CompilerFilter(content, filter_type=self.type,
command=command, filename=filename).output(**kwargs)
return CompilerFilter(content, filter_type=self.type,
command=command, filename=filename).output(**kwargs)
return content
def filter(self, content, method, **kwargs):