PEP8 cleanup
This commit is contained in:
@@ -7,8 +7,8 @@ from django.core.files.base import ContentFile
|
|||||||
from django.template import Context
|
from django.template import Context
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.utils.encoding import smart_unicode
|
from django.utils.encoding import smart_unicode
|
||||||
from django.utils.safestring import mark_safe
|
|
||||||
from django.utils.importlib import import_module
|
from django.utils.importlib import import_module
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
from compressor.cache import get_hexdigest, get_mtime
|
from compressor.cache import get_hexdigest, get_mtime
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ class Compressor(object):
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
return True, CompilerFilter(content, filter_type=self.type,
|
return True, CompilerFilter(content, filter_type=self.type,
|
||||||
command=filter_or_command, filename=filename).input(
|
command=filter_or_command, filename=filename).input(
|
||||||
**kwargs)
|
**kwargs)
|
||||||
try:
|
try:
|
||||||
precompiler_class = getattr(mod, cls_name)
|
precompiler_class = getattr(mod, cls_name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
@@ -223,7 +223,7 @@ class Compressor(object):
|
|||||||
else:
|
else:
|
||||||
return True, precompiler_class(content, attrs,
|
return True, precompiler_class(content, attrs,
|
||||||
filter_type=self.type, filename=filename).input(
|
filter_type=self.type, filename=filename).input(
|
||||||
**kwargs)
|
**kwargs)
|
||||||
return False, content
|
return False, content
|
||||||
|
|
||||||
def filter(self, content, method, **kwargs):
|
def filter(self, content, method, **kwargs):
|
||||||
|
@@ -148,7 +148,7 @@ class CompressorTestCase(TestCase):
|
|||||||
original_precompilers = settings.COMPRESS_PRECOMPILERS
|
original_precompilers = settings.COMPRESS_PRECOMPILERS
|
||||||
settings.COMPRESS_ENABLED = True
|
settings.COMPRESS_ENABLED = True
|
||||||
settings.COMPRESS_PRECOMPILERS = (
|
settings.COMPRESS_PRECOMPILERS = (
|
||||||
('text/foobar', 'compressor.tests.base.TestPrecompiler'),
|
('text/foobar', 'compressor.tests.base.TestPrecompiler'),
|
||||||
)
|
)
|
||||||
css = '<style type="text/foobar">p { border:10px solid red;}</style>'
|
css = '<style type="text/foobar">p { border:10px solid red;}</style>'
|
||||||
css_node = CssCompressor(css)
|
css_node = CssCompressor(css)
|
||||||
@@ -160,7 +160,7 @@ class CompressorTestCase(TestCase):
|
|||||||
original_precompilers = settings.COMPRESS_PRECOMPILERS
|
original_precompilers = settings.COMPRESS_PRECOMPILERS
|
||||||
settings.COMPRESS_ENABLED = True
|
settings.COMPRESS_ENABLED = True
|
||||||
settings.COMPRESS_PRECOMPILERS = (
|
settings.COMPRESS_PRECOMPILERS = (
|
||||||
('text/foobar', 'compressor.tests.base.NonexistentFilter'),
|
('text/foobar', 'compressor.tests.base.NonexistentFilter'),
|
||||||
)
|
)
|
||||||
css = '<style type="text/foobar">p { border:10px solid red;}</style>'
|
css = '<style type="text/foobar">p { border:10px solid red;}</style>'
|
||||||
css_node = CssCompressor(css)
|
css_node = CssCompressor(css)
|
||||||
|
Reference in New Issue
Block a user