From 551c084727b5f9c3c4f0fd6988195dc832bc0a2b Mon Sep 17 00:00:00 2001 From: Johannes Linke Date: Fri, 4 Dec 2015 20:02:14 +0100 Subject: [PATCH] Remove support for CSSTidy. ref #664 --- README.rst | 4 +--- compressor/conf.py | 2 -- compressor/filters/csstidy.py | 10 ---------- compressor/tests/test_filters.py | 21 --------------------- docs/settings.txt | 21 ++++----------------- 5 files changed, 5 insertions(+), 53 deletions(-) delete mode 100644 compressor/filters/csstidy.py diff --git a/README.rst b/README.rst index 83c6893..a2b4400 100644 --- a/README.rst +++ b/README.rst @@ -50,7 +50,7 @@ default. As an alternative Django Compressor provides a BeautifulSoup_ and a html5lib_ based parser, as well as an abstract base class that makes it easy to write a custom parser. -Django Compressor also comes with built-in support for `CSS Tidy`_, +Django Compressor also comes with built-in support for `YUI CSS and JS`_ compressor, `yUglify CSS and JS`_ compressor, the Google's `Closure Compiler`_, a Python port of Douglas Crockford's JSmin_, a Python port of the YUI CSS Compressor cssmin_ and a filter to convert (some) images into @@ -72,7 +72,6 @@ The in-development version of Django Compressor can be installed with .. _BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ .. _lxml: http://lxml.de/ .. _html5lib: http://code.google.com/p/html5lib/ -.. _CSS Tidy: http://csstidy.sourceforge.net/ .. _YUI CSS and JS: http://developer.yahoo.com/yui/compressor/ .. _yUglify CSS and JS: https://github.com/yui/yuglify .. _Closure Compiler: http://code.google.com/closure/compiler/ @@ -81,4 +80,3 @@ The in-development version of Django Compressor can be installed with .. _data URIs: http://en.wikipedia.org/wiki/Data_URI_scheme .. _django-compressor.readthedocs.org: http://django-compressor.readthedocs.org/en/latest/ .. _github.com/django-compressor/django-compressor: https://github.com/django-compressor/django-compressor - diff --git a/compressor/conf.py b/compressor/conf.py index a546115..4f32e46 100644 --- a/compressor/conf.py +++ b/compressor/conf.py @@ -38,8 +38,6 @@ class CompressorConf(AppConf): CACHEABLE_PRECOMPILERS = () CLOSURE_COMPILER_BINARY = 'java -jar compiler.jar' CLOSURE_COMPILER_ARGUMENTS = '' - CSSTIDY_BINARY = 'csstidy' - CSSTIDY_ARGUMENTS = '--template=highest' YUI_BINARY = 'java -jar yuicompressor.jar' YUI_CSS_ARGUMENTS = '' YUI_JS_ARGUMENTS = '' diff --git a/compressor/filters/csstidy.py b/compressor/filters/csstidy.py deleted file mode 100644 index 4b7e4c7..0000000 --- a/compressor/filters/csstidy.py +++ /dev/null @@ -1,10 +0,0 @@ -from compressor.conf import settings -from compressor.filters import CompilerFilter - - -class CSSTidyFilter(CompilerFilter): - command = "{binary} {infile} {args} {outfile}" - options = ( - ("binary", settings.COMPRESS_CSSTIDY_BINARY), - ("args", settings.COMPRESS_CSSTIDY_ARGUMENTS), - ) diff --git a/compressor/tests/test_filters.py b/compressor/tests/test_filters.py index 9d40697..06bfedb 100644 --- a/compressor/tests/test_filters.py +++ b/compressor/tests/test_filters.py @@ -20,7 +20,6 @@ from compressor.filters.css_default import CssAbsoluteFilter from compressor.filters.jsmin import JSMinFilter from compressor.filters.template import TemplateFilter from compressor.filters.closure import ClosureCompilerFilter -from compressor.filters.csstidy import CSSTidyFilter from compressor.filters.yuglify import YUglifyCSSFilter, YUglifyJSFilter from compressor.filters.yui import YUICSSFilter, YUIJSFilter from compressor.filters.cleancss import CleanCSSFilter @@ -31,22 +30,6 @@ def blankdict(*args, **kwargs): return defaultdict(lambda: '', *args, **kwargs) -@unittest.skipIf(find_command(settings.COMPRESS_CSSTIDY_BINARY) is None, - 'CSStidy binary %r not found' % settings.COMPRESS_CSSTIDY_BINARY) -class CssTidyTestCase(TestCase): - def test_tidy(self): - content = textwrap.dedent("""\ - /* Some comment */ - font,th,td,p{ - color: black; - } - """) - ret = CSSTidyFilter(content).input() - self.assertIsInstance(ret, six.text_type) - self.assertEqual( - "font,th,td,p{color:#000;}", CSSTidyFilter(content).input()) - - @override_settings(COMPRESS_CACHEABLE_PRECOMPILERS=('text/css',)) class PrecompilerTestCase(TestCase): def setUp(self): @@ -440,10 +423,6 @@ class SpecializedFiltersTest(TestCase): filter = ClosureCompilerFilter('') self.assertEqual(filter.options, (('binary', six.text_type('java -jar compiler.jar')), ('args', six.text_type('')))) - def test_csstidy_filter(self): - filter = CSSTidyFilter('') - self.assertEqual(filter.options, (('binary', six.text_type('csstidy')), ('args', six.text_type('--template=highest')))) - def test_yuglify_filters(self): filter = YUglifyCSSFilter('') self.assertEqual(filter.command, '{binary} {args} --type=css') diff --git a/docs/settings.txt b/docs/settings.txt index e0cb6f2..c1e55e6 100644 --- a/docs/settings.txt +++ b/docs/settings.txt @@ -87,18 +87,6 @@ Backend settings feature, and the ``'content'`` in case you're using multiple servers to serve your content. - - ``compressor.filters.csstidy.CSSTidyFilter`` - - A filter that passes the CSS content to the CSSTidy_ tool. - - .. attribute:: COMPRESS_CSSTIDY_BINARY - - The CSSTidy binary filesystem path. - - .. attribute:: COMPRESS_CSSTIDY_ARGUMENTS - - The arguments passed to CSSTidy. - - ``compressor.filters.datauri.CssDataUriFilter`` A filter for embedding media as `data: URIs`_ in the CSS. @@ -155,7 +143,6 @@ Backend settings The arguments passed to clean-css. - .. _CSSTidy: http://csstidy.sourceforge.net/ .. _`data: URIs`: http://en.wikipedia.org/wiki/Data_URI_scheme .. _cssmin: http://pypi.python.org/pypi/cssmin/ .. _rCSSmin: http://opensource.perlig.de/rcssmin/ @@ -280,8 +267,8 @@ Backend settings .. note:: Depending on the implementation, some precompilers might not support outputting to something else than ``stdout``, so you'll need to omit the - ``{outfile}`` parameter when working with those. For instance, if you - are using the Ruby version of lessc, you'll need to set up the + ``{outfile}`` parameter when working with those. For instance, if you + are using the Ruby version of lessc, you'll need to set up the precompiler like this:: ('text/less', 'lessc {infile}'), @@ -453,11 +440,11 @@ Caching settings and the ``django.core.context_processors.request`` context processor. .. _RequestContext: http://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.RequestContext - + .. attribute:: COMPRESS_CACHE_KEY_FUNCTION :Default: ``'compressor.cache.simple_cachekey'`` - + The function to use when generating the cache key. The function must take one argument which is the partial key based on the source's hex digest. It must return the full key as a string.