]> review.fuel-infra Code Review - packages/trusty/python-django-compressor.git/commitdiff
Add python-compressor package to MOS 8.0 repository 10/11210/1 8.0 pre_1529660_master
authorIvan Udovichenko <iudovichenko@mirantis.com>
Sun, 6 Sep 2015 19:08:11 +0000 (15:08 -0400)
committerIvan Udovichenko <iudovichenko@mirantis.com>
Sun, 6 Sep 2015 19:08:23 +0000 (15:08 -0400)
Change-Id: I9b6fe5af278cf2aaaca8536837f4ec337258ee77
Version: 1.5-2~u14.04+mos1
Source: http://http.debian.net/debian/pool/main/p/python-django-compressor/python-django-compressor_1.5-2.dsc

177 files changed:
debian/changelog
debian/control
debian/docs
debian/gbp.conf [new file with mode: 0644]
debian/patches/remove-failed-test.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/rules
debian/watch [new file with mode: 0644]
django-compressor/PKG-INFO [deleted file]
django-compressor/compressor/js.py [deleted file]
django-compressor/compressor/templates/compressor/js_file.html [deleted file]
django-compressor/compressor/utils/staticfiles.py [deleted file]
django-compressor/django_compressor.egg-info/PKG-INFO [deleted file]
django-compressor/django_compressor.egg-info/SOURCES.txt [deleted file]
django-compressor/django_compressor.egg-info/dependency_links.txt [deleted file]
django-compressor/django_compressor.egg-info/not-zip-safe [deleted file]
django-compressor/django_compressor.egg-info/requires.txt [deleted file]
django-compressor/django_compressor.egg-info/top_level.txt [deleted file]
django-compressor/setup.cfg [deleted file]
django-compressor/tox.ini [deleted file]
python-django-compressor/.gitignore [new file with mode: 0644]
python-django-compressor/.travis.yml [new file with mode: 0644]
python-django-compressor/AUTHORS [moved from django-compressor/AUTHORS with 98% similarity]
python-django-compressor/LICENSE [moved from django-compressor/LICENSE with 100% similarity]
python-django-compressor/MANIFEST.in [moved from django-compressor/MANIFEST.in with 100% similarity]
python-django-compressor/Makefile [moved from django-compressor/Makefile with 100% similarity]
python-django-compressor/README.rst [moved from django-compressor/README.rst with 92% similarity]
python-django-compressor/compressor/__init__.py [moved from django-compressor/compressor/__init__.py with 50% similarity]
python-django-compressor/compressor/base.py [moved from django-compressor/compressor/base.py with 98% similarity]
python-django-compressor/compressor/cache.py [moved from django-compressor/compressor/cache.py with 92% similarity]
python-django-compressor/compressor/conf.py [moved from django-compressor/compressor/conf.py with 98% similarity]
python-django-compressor/compressor/contrib/__init__.py [moved from django-compressor/compressor/contrib/__init__.py with 100% similarity]
python-django-compressor/compressor/contrib/jinja2ext.py [moved from django-compressor/compressor/contrib/jinja2ext.py with 100% similarity]
python-django-compressor/compressor/contrib/sekizai.py [moved from django-compressor/compressor/contrib/sekizai.py with 100% similarity]
python-django-compressor/compressor/css.py [moved from django-compressor/compressor/css.py with 97% similarity]
python-django-compressor/compressor/exceptions.py [moved from django-compressor/compressor/exceptions.py with 100% similarity]
python-django-compressor/compressor/filters/__init__.py [moved from django-compressor/compressor/filters/__init__.py with 100% similarity]
python-django-compressor/compressor/filters/base.py [moved from django-compressor/compressor/filters/base.py with 89% similarity]
python-django-compressor/compressor/filters/cleancss.py [new file with mode: 0644]
python-django-compressor/compressor/filters/closure.py [moved from django-compressor/compressor/filters/closure.py with 100% similarity]
python-django-compressor/compressor/filters/css_default.py [moved from django-compressor/compressor/filters/css_default.py with 90% similarity]
python-django-compressor/compressor/filters/cssmin/__init__.py [moved from django-compressor/compressor/filters/cssmin/__init__.py with 100% similarity]
python-django-compressor/compressor/filters/cssmin/cssmin.py [moved from django-compressor/compressor/filters/cssmin/cssmin.py with 100% similarity]
python-django-compressor/compressor/filters/cssmin/rcssmin.py [moved from django-compressor/compressor/filters/cssmin/rcssmin.py with 100% similarity]
python-django-compressor/compressor/filters/csstidy.py [moved from django-compressor/compressor/filters/csstidy.py with 100% similarity]
python-django-compressor/compressor/filters/datauri.py [moved from django-compressor/compressor/filters/datauri.py with 100% similarity]
python-django-compressor/compressor/filters/jsmin/__init__.py [moved from django-compressor/compressor/filters/jsmin/__init__.py with 100% similarity]
python-django-compressor/compressor/filters/jsmin/rjsmin.py [moved from django-compressor/compressor/filters/jsmin/rjsmin.py with 100% similarity]
python-django-compressor/compressor/filters/jsmin/slimit.py [moved from django-compressor/compressor/filters/jsmin/slimit.py with 100% similarity]
python-django-compressor/compressor/filters/template.py [moved from django-compressor/compressor/filters/template.py with 100% similarity]
python-django-compressor/compressor/filters/yuglify.py [moved from django-compressor/compressor/filters/yuglify.py with 100% similarity]
python-django-compressor/compressor/filters/yui.py [moved from django-compressor/compressor/filters/yui.py with 100% similarity]
python-django-compressor/compressor/finders.py [moved from django-compressor/compressor/finders.py with 100% similarity]
python-django-compressor/compressor/js.py [new file with mode: 0644]
python-django-compressor/compressor/management/__init__.py [moved from django-compressor/compressor/management/__init__.py with 100% similarity]
python-django-compressor/compressor/management/commands/__init__.py [moved from django-compressor/compressor/management/commands/__init__.py with 100% similarity]
python-django-compressor/compressor/management/commands/compress.py [moved from django-compressor/compressor/management/commands/compress.py with 89% similarity]
python-django-compressor/compressor/management/commands/mtime_cache.py [moved from django-compressor/compressor/management/commands/mtime_cache.py with 100% similarity]
python-django-compressor/compressor/models.py [moved from django-compressor/compressor/models.py with 100% similarity]
python-django-compressor/compressor/offline/__init__.py [moved from django-compressor/compressor/offline/__init__.py with 100% similarity]
python-django-compressor/compressor/offline/django.py [moved from django-compressor/compressor/offline/django.py with 80% similarity]
python-django-compressor/compressor/offline/jinja2.py [moved from django-compressor/compressor/offline/jinja2.py with 100% similarity]
python-django-compressor/compressor/parser/__init__.py [moved from django-compressor/compressor/parser/__init__.py with 87% similarity]
python-django-compressor/compressor/parser/base.py [moved from django-compressor/compressor/parser/base.py with 100% similarity]
python-django-compressor/compressor/parser/beautifulsoup.py [moved from django-compressor/compressor/parser/beautifulsoup.py with 100% similarity]
python-django-compressor/compressor/parser/default_htmlparser.py [moved from django-compressor/compressor/parser/default_htmlparser.py with 100% similarity]
python-django-compressor/compressor/parser/html5lib.py [moved from django-compressor/compressor/parser/html5lib.py with 100% similarity]
python-django-compressor/compressor/parser/lxml.py [moved from django-compressor/compressor/parser/lxml.py with 100% similarity]
python-django-compressor/compressor/signals.py [moved from django-compressor/compressor/signals.py with 100% similarity]
python-django-compressor/compressor/storage.py [moved from django-compressor/compressor/storage.py with 100% similarity]
python-django-compressor/compressor/templates/compressor/css_file.html [moved from django-compressor/compressor/templates/compressor/css_file.html with 100% similarity]
python-django-compressor/compressor/templates/compressor/css_inline.html [moved from django-compressor/compressor/templates/compressor/css_inline.html with 100% similarity]
python-django-compressor/compressor/templates/compressor/js_file.html [new file with mode: 0644]
python-django-compressor/compressor/templates/compressor/js_inline.html [moved from django-compressor/compressor/templates/compressor/js_inline.html with 100% similarity]
python-django-compressor/compressor/templatetags/__init__.py [moved from django-compressor/compressor/templatetags/__init__.py with 100% similarity]
python-django-compressor/compressor/templatetags/compress.py [moved from django-compressor/compressor/templatetags/compress.py with 100% similarity]
python-django-compressor/compressor/test_settings.py [moved from django-compressor/compressor/test_settings.py with 64% similarity]
python-django-compressor/compressor/tests/__init__.py [moved from django-compressor/compressor/tests/__init__.py with 100% similarity]
python-django-compressor/compressor/tests/precompiler.py [moved from django-compressor/compressor/tests/precompiler.py with 72% similarity]
python-django-compressor/compressor/tests/static/css/datauri.css [moved from django-compressor/compressor/tests/static/css/datauri.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/filename with spaces.css [new file with mode: 0644]
python-django-compressor/compressor/tests/static/css/nonasc.css [moved from django-compressor/compressor/tests/static/css/nonasc.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/one.css [moved from django-compressor/compressor/tests/static/css/one.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/two.css [moved from django-compressor/compressor/tests/static/css/two.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/url/2/url2.css [moved from django-compressor/compressor/tests/static/css/url/2/url2.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/url/nonasc.css [moved from django-compressor/compressor/tests/static/css/url/nonasc.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/url/test.css [moved from django-compressor/compressor/tests/static/css/url/test.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/url/url1.css [moved from django-compressor/compressor/tests/static/css/url/url1.css with 100% similarity]
python-django-compressor/compressor/tests/static/css/utf-8_with-BOM.css [new file with mode: 0644]
python-django-compressor/compressor/tests/static/img/add.png [moved from django-compressor/compressor/tests/static/img/add.png with 100% similarity]
python-django-compressor/compressor/tests/static/img/python.png [moved from django-compressor/compressor/tests/static/img/python.png with 100% similarity]
python-django-compressor/compressor/tests/static/js/nonasc-latin1.js [moved from django-compressor/compressor/tests/static/js/nonasc-latin1.js with 100% similarity]
python-django-compressor/compressor/tests/static/js/nonasc.js [moved from django-compressor/compressor/tests/static/js/nonasc.js with 100% similarity]
python-django-compressor/compressor/tests/static/js/one.coffee [moved from django-compressor/compressor/tests/static/js/one.coffee with 100% similarity]
python-django-compressor/compressor/tests/static/js/one.js [moved from django-compressor/compressor/tests/static/js/one.js with 100% similarity]
python-django-compressor/compressor/tests/static/js/three.js [new file with mode: 0644]
python-django-compressor/compressor/tests/static/js/two.js [new file with mode: 0644]
python-django-compressor/compressor/tests/test_base.py [moved from django-compressor/compressor/tests/test_base.py with 78% similarity]
python-django-compressor/compressor/tests/test_filters.py [moved from django-compressor/compressor/tests/test_filters.py with 69% similarity]
python-django-compressor/compressor/tests/test_jinja2ext.py [moved from django-compressor/compressor/tests/test_jinja2ext.py with 99% similarity]
python-django-compressor/compressor/tests/test_offline.py [moved from django-compressor/compressor/tests/test_offline.py with 95% similarity]
python-django-compressor/compressor/tests/test_parsers.py [moved from django-compressor/compressor/tests/test_parsers.py with 100% similarity]
python-django-compressor/compressor/tests/test_signals.py [moved from django-compressor/compressor/tests/test_signals.py with 100% similarity]
python-django-compressor/compressor/tests/test_storages.py [moved from django-compressor/compressor/tests/test_storages.py with 100% similarity]
python-django-compressor/compressor/tests/test_templates/basic/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/basic/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super/base.html [moved from django-compressor/compressor/tests/test_templates/test_block_super/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_block_super/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_base_compressed/base.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_base_compressed/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_base_compressed/base2.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_base_compressed/base2.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_base_compressed/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_base_compressed/test_compressor_offline.html with 53% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_extra/base.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_extra/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_extra/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_extra/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_multiple/base.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_multiple/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_multiple/base2.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_multiple/base2.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_multiple/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_multiple/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_multiple_cached/base.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_multiple_cached/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_multiple_cached/base2.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_multiple_cached/base2.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_block_super_multiple_cached/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_block_super_multiple_cached/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_complex/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_complex/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_condition/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_condition/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_duplicate/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_duplicate/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_error_handling/buggy_extends.html [moved from django-compressor/compressor/tests/test_templates/test_error_handling/buggy_extends.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_error_handling/buggy_template.html [moved from django-compressor/compressor/tests/test_templates/test_error_handling/buggy_template.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_error_handling/missing_extends.html [moved from django-compressor/compressor/tests/test_templates/test_error_handling/missing_extends.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_error_handling/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_error_handling/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_error_handling/with_coffeescript.html [moved from django-compressor/compressor/tests/test_templates/test_error_handling/with_coffeescript.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_inline_non_ascii/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_inline_non_ascii/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_static_templatetag/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_static_templatetag/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_templatetag/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_templatetag/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates/test_with_context/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates/test_with_context/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/basic/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/basic/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super/base.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_extra/base.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_extra/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_extra/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_extra/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple/base.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple/base2.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple/base2.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/base.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/base.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/base2.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/base2.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_coffin/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_coffin/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_complex/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_complex/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_condition/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_condition/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/buggy_extends.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/buggy_extends.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/buggy_template.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/buggy_template.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/missing_extends.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/missing_extends.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/with_coffeescript.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_error_handling/with_coffeescript.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_inline_non_ascii/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_inline_non_ascii/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_jingo/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_jingo/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_static_templatetag/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_static_templatetag/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_templatetag/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_templatetag/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templates_jinja2/test_with_context/test_compressor_offline.html [moved from django-compressor/compressor/tests/test_templates_jinja2/test_with_context/test_compressor_offline.html with 100% similarity]
python-django-compressor/compressor/tests/test_templatetags.py [moved from django-compressor/compressor/tests/test_templatetags.py with 100% similarity]
python-django-compressor/compressor/utils/__init__.py [moved from django-compressor/compressor/utils/__init__.py with 100% similarity]
python-django-compressor/compressor/utils/decorators.py [moved from django-compressor/compressor/utils/decorators.py with 100% similarity]
python-django-compressor/compressor/utils/staticfiles.py [new file with mode: 0644]
python-django-compressor/compressor/utils/stringformat.py [moved from django-compressor/compressor/utils/stringformat.py with 100% similarity]
python-django-compressor/docs/Makefile [moved from django-compressor/docs/Makefile with 100% similarity]
python-django-compressor/docs/behind-the-scenes.txt [moved from django-compressor/docs/behind-the-scenes.txt with 100% similarity]
python-django-compressor/docs/changelog.txt [moved from django-compressor/docs/changelog.txt with 91% similarity]
python-django-compressor/docs/conf.py [moved from django-compressor/docs/conf.py with 100% similarity]
python-django-compressor/docs/contributing.txt [moved from django-compressor/docs/contributing.txt with 97% similarity]
python-django-compressor/docs/django-sekizai.txt [moved from django-compressor/docs/django-sekizai.txt with 60% similarity]
python-django-compressor/docs/index.txt [moved from django-compressor/docs/index.txt with 100% similarity]
python-django-compressor/docs/jinja2.txt [moved from django-compressor/docs/jinja2.txt with 94% similarity]
python-django-compressor/docs/make.bat [moved from django-compressor/docs/make.bat with 100% similarity]
python-django-compressor/docs/quickstart.txt [moved from django-compressor/docs/quickstart.txt with 89% similarity]
python-django-compressor/docs/remote-storages.txt [moved from django-compressor/docs/remote-storages.txt with 88% similarity]
python-django-compressor/docs/scenarios.txt [moved from django-compressor/docs/scenarios.txt with 100% similarity]
python-django-compressor/docs/settings.txt [moved from django-compressor/docs/settings.txt with 94% similarity]
python-django-compressor/docs/usage.txt [moved from django-compressor/docs/usage.txt with 98% similarity]
python-django-compressor/requirements/tests.txt [moved from django-compressor/requirements/tests.txt with 100% similarity]
python-django-compressor/setup.cfg [new file with mode: 0644]
python-django-compressor/setup.py [moved from django-compressor/setup.py with 100% similarity]
python-django-compressor/tox.ini [new file with mode: 0644]

index d3adf52e55b08aff1fe56b9e1c013537dbca9438..32e02f630eb38eb988fdf253c77bd514d87af6d0 100644 (file)
@@ -1,61 +1,42 @@
-python-django-compressor (1.4-0u~u14.04+mos2) mos7.0; urgency=medium
-    * Satisfy global requirements [1]
-    * [1] https://github.com/openstack/requirements/blob/stable/kilo/global-requirements.txt#L25
-    * Remove watch file
-    * Update python version
+python-django-compressor (1.5-2~u14.04+mos1) mos8.0; urgency=medium
 
- -- Ivan Udovichenko <iudovichenko@mirantis.com>  Thu, 16 Apr 2015 23:11:22 +0300
+  * Source: http://http.debian.net/debian/pool/main/p/python-django-compressor/python-django-compressor_1.5-2.dsc
 
-python-django-compressor (1.4-0u~u14.04+mos1) mos6.1; urgency=medium
+ -- Ivan Udovichenko <iudovichenko@mirantis.com>  Sun, 06 Sep 2015 15:08:03 -0400
 
-    * Adjust the package revision in order to avoid breaking packages
-      depending on python-django-compressor (>= 1.4)
+python-django-compressor (1.5-2) unstable; urgency=medium
 
- -- Vasyl Saienko <vsaienko@mirantis.com>  Wed, 15 Apr 2015 17:35:32 +0200
+  * More robust watch file thanks to James Page (Closes: #796249).
 
-python-django-compressor (1.4-0~u14.04+mos1) mos6.1; urgency=medium
+ -- Thomas Goirand <zigo@debian.org>  Fri, 28 Aug 2015 15:52:25 +0000
 
-  * Adjust the package revision according to the versioning policy
-    stated in the separate-mos-from-linux blueprint.
+python-django-compressor (1.5-1) unstable; urgency=medium
 
- -- Alexei Sheplyakov <asheplyakov@mirantis.com>  Thu, 09 Apr 2015 14:35:32 +0300
-
-python-django-compressor (1.4-0ubuntu1~cloud0~mos6.1) trusty; urgency=low
-
-  * Build python-django-compressor for Ubuntu 14.04
-
- -- Sergey Kolekonov <skolekonov@mirantis.com>  Thu, 26 Feb 2015 13:13:11 +0300
-
-python-django-compressor (1.4-0ubuntu1~cloud0) precise-juno; urgency=low
-
-  * Update version for MOS
-
- -- Sergey Otpouschennikov  <sotpuschennikov@mirantis.com>  Tue, 13 Aug 2013 15:40:41 +0300
-
-python-django-compressor (1.3-1ubuntu3) trusty; urgency=medium
-
-  * d/control: Drop python-beautifulsoup from BD's (LP: #1252627), its
-    only required to run tests and is a optional parser at runtime.
-  * d/rules: Correct path for django-admin.py so tests actually run,
-    even if the result is ignored.
+  * New upstream release.
+  * Added Python 3 support.
+  * Removed django 1.7 patche.
+  * Added patch to not run a unit test that fails:
+    - compressor.tests.test_base.JsAsyncDeferTestCase
+  * Fixed PyPi watch file.
 
- -- James Page <james.page@ubuntu.com>  Fri, 07 Mar 2014 13:09:39 +0000
+ -- Thomas Goirand <zigo@debian.org>  Tue, 04 Aug 2015 08:17:03 +0000
 
-python-django-compressor (1.3-1ubuntu2) trusty; urgency=medium
+python-django-compressor (1.4-2) unstable; urgency=medium
 
-  * Rebuild to drop files installed into /usr/share/pyshared.
+  * Fixed Django 1.7 compat in test_settings.py. (Closes: #755622)
+  * Added build-depends: csstidy, python-coffin, python-jingo
+  * Runs the unit tests correctly now.
 
- -- Matthias Klose <doko@ubuntu.com>  Sun, 23 Feb 2014 13:51:17 +0000
+ -- Thomas Goirand <zigo@debian.org>  Mon, 08 Sep 2014 17:31:54 +0000
 
-python-django-compressor (1.3-1ubuntu1) trusty; urgency=medium
+python-django-compressor (1.4-1) unstable; urgency=medium
 
-  * Drop use of external discover-runner as this is included in
-    django >= 1.6 (LP: #1252627):
-    - d/patches/django-1.6-compat.patch: Patch out use of discover_runner.
-    - d/control: Drop BD on python-django-discover-runner, version BD on
-      python-django >= 1.6. 
+  * New upstream release.
+  * Ran wrap-and-sort.
+  * Standards-Version is now 3.9.5.
+  * Do not run useless dh_helper (builds faster).
 
- -- James Page <james.page@ubuntu.com>  Wed, 08 Jan 2014 10:32:15 +0000
+ -- Thomas Goirand <zigo@debian.org>  Thu, 26 Jun 2014 15:08:13 +0800
 
 python-django-compressor (1.3-1) unstable; urgency=low
 
index 5c2dabe8e3f3a49ed6cdb3c6587eb3a91f625f58..d9711499bcf3063ed3ea132eaa49846bfbe7d5a3 100644 (file)
@@ -1,32 +1,71 @@
 Source: python-django-compressor
 Section: python
 Priority: optional
-Maintainer: MOS Horizon Team <mos-horizon@mirantis.com>
+Maintainer: PKG OpenStack <openstack-devel@lists.alioth.debian.org>
+Uploaders: Thomas Goirand <zigo@debian.org>,
 Build-Depends: debhelper (>= 9),
- openstack-pkg-tools,
- python-all (>= 2.7.1),
- python-setuptools
-Build-Depends-Indep: python-appconf,
- python-coverage,
- python-django (>= 1.6),
- python-html5lib,
- python-jinja2,
- python-lxml,
- python-mock,
- python-nose,
- python-unittest2
-Standards-Version: 3.9.4
+               dh-python,
+               openstack-pkg-tools,
+               python-all,
+               python-setuptools,
+               python3-all,
+               python3-setuptools
+Build-Depends-Indep: csstidy,
+                     python-appconf,
+                     python-bs4,
+                     python-coffin,
+                     python-coverage,
+                     python-django,
+                     python-django-discover-runner,
+                     python-html5lib,
+                     python-jingo,
+                     python-jinja2,
+                     python-lxml,
+                     python-mock,
+                     python-nose,
+                     python-unittest2,
+                     python3-appconf,
+                     python3-bs4,
+                     python3-coffin,
+                     python3-coverage,
+                     python3-django,
+                     python3-django-discover-runner,
+                     python3-html5lib,
+                     python3-jingo,
+                     python3-jinja2,
+                     python3-lxml,
+                     python3-mock,
+                     python3-nose,
+                     python3-unittest2
+Standards-Version: 3.9.6
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/python-django-compressor.git;a=summary
+Vcs-Git: git://anonscm.debian.org/openstack/python-django-compressor.git
 Homepage: http://pypi.python.org/pypi/django_compressor/
 
 Package: python-compressor
 Architecture: all
-Pre-Depends: dpkg (>= 1.15.6~)
 Depends: python-appconf,
python-django (>= 1.1),
- ${misc:Depends},
- ${python:Depends}
        python-django,
        ${misc:Depends},
        ${python:Depends}
 Provides: ${python:Provides}
-Description: Compresses linked and inline JavaScript or CSS into single cached files
+Description: Compresses linked, inline JS or CSS into single cached files - Python 2.7
  Django Compressor combines and compresses linked and inline Javascript or CSS
  in a Django templates into cacheable static files by using the compress
  template tag.
+ .
+ This package contains the Python 2.7 module.
+
+Package: python3-compressor
+Architecture: all
+Depends: python3-appconf,
+         python3-django,
+         ${misc:Depends},
+         ${python3:Depends}
+Provides: ${python:Provides}
+Description: Compresses linked, inline JS or CSS into single cached files - Python 3.x
+ Django Compressor combines and compresses linked and inline Javascript or CSS
+ in a Django templates into cacheable static files by using the compress
+ template tag.
+ .
+ This package contains the Python 3.x module.
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a1320b1b4ab22e9be9bbc9d5777c0e31aa4011d5 100644 (file)
@@ -0,0 +1 @@
+README.rst
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644 (file)
index 0000000..7bf5959
--- /dev/null
@@ -0,0 +1,8 @@
+[DEFAULT]
+upstream-branch = master
+debian-branch = debian/unstable
+upstream-tag = %(version)s
+compression = xz
+
+[buildpackage]
+export-dir = ../build-area/
diff --git a/debian/patches/remove-failed-test.patch b/debian/patches/remove-failed-test.patch
new file mode 100644 (file)
index 0000000..6f835f3
--- /dev/null
@@ -0,0 +1,43 @@
+Description: Removes failed test
+ This unit test is failing, so removing it to build the package.
+Author: Thomas Goirand <zigo@debian.org>
+Forwarded: no
+Last-Update: 2015-08-04
+
+--- python-django-compressor-1.5.orig/compressor/tests/test_base.py
++++ python-django-compressor-1.5/compressor/tests/test_base.py
+@@ -288,34 +288,6 @@ class CacheBackendTestCase(CompressorTes
+         self.assertEqual(cache.__class__, locmem.LocMemCache)
+-class JsAsyncDeferTestCase(SimpleTestCase):
+-    def setUp(self):
+-        self.js = """\
+-            <script src="/static/js/one.js" type="text/javascript"></script>
+-            <script src="/static/js/two.js" type="text/javascript" async></script>
+-            <script src="/static/js/three.js" type="text/javascript" defer></script>
+-            <script type="text/javascript">obj.value = "value";</script>
+-            <script src="/static/js/one.js" type="text/javascript" async></script>
+-            <script src="/static/js/two.js" type="text/javascript" async></script>
+-            <script src="/static/js/three.js" type="text/javascript"></script>"""
+-
+-    def test_js_output(self):
+-        def extract_attr(tag):
+-            if tag.has_attr('async'):
+-                return 'async'
+-            if tag.has_attr('defer'):
+-                return 'defer'
+-        js_node = JsCompressor(self.js)
+-        output = [None, 'async', 'defer', None, 'async', None]
+-        if six.PY3:
+-            scripts = make_soup(js_node.output()).find_all('script')
+-            attrs = [extract_attr(i) for i in scripts]
+-        else:
+-            scripts = make_soup(js_node.output()).findAll('script')
+-            attrs = [s.get('async') or s.get('defer') for s in scripts]
+-        self.assertEqual(output, attrs)
+-
+-
+ class CacheTestCase(SimpleTestCase):
+     def setUp(self):
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..5943615
--- /dev/null
@@ -0,0 +1 @@
+remove-failed-test.patch
index b4db7a3ab97d0b63cd43ab14667289383f1d8c85..46c1c969e5224043911977438099920ecd81c542 100755 (executable)
@@ -1,32 +1,49 @@
 #!/usr/bin/make -f
 
-#export DH_VERBOSE=1
+PYTHONS:=$(shell pyversions -vr)
+PYTHON3S:=$(shell py3versions -vr)
 
 UPSTREAM_GIT = git://github.com/jezdez/django_compressor.git
 
 include /usr/share/openstack-pkg-tools/pkgos.make
 
 %:
-       dh $@  --with python2
+       dh $@ --buildsystem=python_distutils --with python2,python3
 
-PYDEF=$(shell pyversions -d)
+override_dh_clean:
+       dh_clean
+       rm -rf .coverage
 
-ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
 override_dh_auto_test:
-       PYTHONPATH=$PYTHONPATH:. python /usr/lib/$(PYDEF)/dist-packages/django/bin/django-admin.py test --settings=compressor.test_settings compressor || true
+ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
+       PYTHON=python2 PYTHONPATH=. python-coverage run --branch --source=compressor /usr/bin/django-admin test --settings=compressor.test_settings compressor
        rm -rf $(CURDIR)/compressor/tests/static/CACHE
+       # TODO: make unit tests to work.
+#      PYTHON=python3 PYTHONPATH=. python3-coverage run --branch --source=compressor /usr/bin/django-admin test --settings=compressor.test_settings compressor
+#      rm -rf $(CURDIR)/compressor/tests/static/CACHE
 endif
 
 override_dh_auto_build:
 
 override_dh_install:
-       set -e ; for i in `pyversions -s` ; do \
-               $$i setup.py install --install-layout=deb --root=debian/python-compressor ; \
-               rm -f $(CURDIR)/debian/usr/lib/$$i/dist-packages/compressor/tests/static/CACHE/css/* ; \
-               rm -f $(CURDIR)/debian/usr/lib/$$i/dist-packages/compressor/tests/static/CACHE/js/* ; \
+       set -e ; for pyvers in $(PYTHONS); do \
+               python$$pyvers setup.py install --install-layout=deb \
+                       --root $(CURDIR)/debian/python-compressor; \
        done
-       find debian/python-compressor -iname '*.pyc' -delete
-
-override_dh_usrlocal:
-       rm -f $(CURDIR)/debian/usr/share/pyshared/compressor/tests/static/CACHE/css/*
-       rm -f $(CURDIR)/debian/usr/share/pyshared/compressor/tests/static/CACHE/js/*
+       set -e ; for pyvers in $(PYTHON3S); do \
+               python$$pyvers setup.py install --install-layout=deb \
+                       --root $(CURDIR)/debian/python3-compressor; \
+       done
+       rm -f $(CURDIR)/debian/usr/lib/python*/dist-packages/compressor/tests/static/CACHE/css/*
+       rm -f $(CURDIR)/debian/usr/lib/python*/dist-packages/compressor/tests/static/CACHE/js/*
+       find debian -iname '*.pyc' -delete
+
+# Commands not to run
+override_dh_installcatalogs:
+override_dh_installemacsen override_dh_installifupdown:
+override_dh_installinfo override_dh_installmenu override_dh_installmime:
+override_dh_installmodules override_dh_installlogcheck:
+override_dh_installpam override_dh_installppp override_dh_installudev override_dh_installwm:
+override_dh_installxfonts override_dh_gconf override_dh_icons override_dh_perl:
+override_dh_installlogrotate override_dh_installgsettings override_dh_bugfiles override_dh_ucf:
+override_dh_installexamples override_dh_installman override_dh_installcron override_dh_installdebconf:
diff --git a/debian/watch b/debian/watch
new file mode 100644 (file)
index 0000000..44f770e
--- /dev/null
@@ -0,0 +1,3 @@
+version=3
+opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
+http://pypi.debian.net/django_compressor/django_compressor-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
diff --git a/django-compressor/PKG-INFO b/django-compressor/PKG-INFO
deleted file mode 100644 (file)
index 6b41def..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-Metadata-Version: 1.1
-Name: django_compressor
-Version: 1.4
-Summary: Compresses linked and inline JavaScript or CSS into single cached files.
-Home-page: http://django-compressor.readthedocs.org/en/latest/
-Author: Jannis Leidel
-Author-email: jannis@leidel.info
-License: MIT
-Description: Django Compressor
-        =================
-        
-        .. image:: https://coveralls.io/repos/django-compressor/django-compressor/badge.png?branch=develop 
-          :target: https://coveralls.io/r/django-compressor/django-compressor?branch=develop
-        
-        .. image:: https://pypip.in/v/django_compressor/badge.png
-                :target: https://pypi.python.org/pypi/django_compressor
-        
-        .. image:: https://pypip.in/d/django_compressor/badge.png
-                :target: https://pypi.python.org/pypi/django_compressor
-        
-        .. image:: https://secure.travis-ci.org/django-compressor/django-compressor.png?branch=develop
-            :alt: Build Status
-            :target: http://travis-ci.org/django-compressor/django-compressor
-        
-        Django Compressor combines and compresses linked and inline Javascript
-        or CSS in a Django template into cacheable static files by using the
-        ``compress`` template tag.
-        
-        HTML in between ``{% compress js/css %}`` and ``{% endcompress %}`` is
-        parsed and searched for CSS or JS. These styles and scripts are subsequently
-        processed with optional, configurable compilers and filters.
-        
-        The default filter for CSS rewrites paths to static files to be absolute
-        and adds a cache busting timestamp. For Javascript the default filter
-        compresses it using ``jsmin``.
-        
-        As the final result the template tag outputs a ``<script>`` or ``<link>``
-        tag pointing to the optimized file. These files are stored inside a folder
-        and given a unique name based on their content. Alternatively it can also
-        return the resulting content to the original template directly.
-        
-        Since the file name is dependent on the content these files can be given
-        a far future expiration date without worrying about stale browser caches.
-        
-        The concatenation and compressing process can also be jump started outside
-        of the request/response cycle by using the Django management command
-        ``manage.py compress``.
-        
-        Configurability & Extendibility
-        -------------------------------
-        
-        Django Compressor is highly configurable and extendible. The HTML parsing
-        is done using lxml_ or if it's not available Python's built-in HTMLParser by
-        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`_,
-        `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
-        `data URIs`_.
-        
-        If your setup requires a different compressor or other post-processing
-        tool it will be fairly easy to implement a custom filter. Simply extend
-        from one of the available base classes.
-        
-        More documentation about the usage and settings of Django Compressor can be
-        found on `django-compressor.readthedocs.org`_.
-        
-        The source code for Django Compressor can be found and contributed to on
-        `github.com/django-compressor/django-compressor`_. There you can also file tickets.
-        
-        The in-development version of Django Compressor can be installed with
-        ``pip install http://github.com/django-compressor/django-compressor/tarball/develop``.
-        
-        .. _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/
-        .. _JSMin: http://www.crockford.com/javascript/jsmin.html
-        .. _cssmin: https://github.com/zacharyvoase/cssmin
-        .. _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
-        
-        
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Framework :: Django
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Topic :: Internet :: WWW/HTTP
diff --git a/django-compressor/compressor/js.py b/django-compressor/compressor/js.py
deleted file mode 100644 (file)
index b087804..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-from compressor.conf import settings
-from compressor.base import Compressor, SOURCE_HUNK, SOURCE_FILE
-
-
-class JsCompressor(Compressor):
-
-    def __init__(self, content=None, output_prefix="js", context=None):
-        super(JsCompressor, self).__init__(content, output_prefix, context)
-        self.filters = list(settings.COMPRESS_JS_FILTERS)
-        self.type = output_prefix
-
-    def split_contents(self):
-        if self.split_content:
-            return self.split_content
-        for elem in self.parser.js_elems():
-            attribs = self.parser.elem_attribs(elem)
-            if 'src' in attribs:
-                basename = self.get_basename(attribs['src'])
-                filename = self.get_filename(basename)
-                content = (SOURCE_FILE, filename, basename, elem)
-                self.split_content.append(content)
-            else:
-                content = self.parser.elem_content(elem)
-                self.split_content.append((SOURCE_HUNK, content, None, elem))
-        return self.split_content
diff --git a/django-compressor/compressor/templates/compressor/js_file.html b/django-compressor/compressor/templates/compressor/js_file.html
deleted file mode 100644 (file)
index 09d6a9b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<script type="text/javascript" src="{{ compressed.url }}"></script>
\ No newline at end of file
diff --git a/django-compressor/compressor/utils/staticfiles.py b/django-compressor/compressor/utils/staticfiles.py
deleted file mode 100644 (file)
index 28026f2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-from __future__ import absolute_import, unicode_literals
-
-from django.core.exceptions import ImproperlyConfigured
-
-from compressor.conf import settings
-
-INSTALLED = ("staticfiles" in settings.INSTALLED_APPS or
-             "django.contrib.staticfiles" in settings.INSTALLED_APPS)
-
-if INSTALLED:
-    if "django.contrib.staticfiles" in settings.INSTALLED_APPS:
-        from django.contrib.staticfiles import finders
-    else:
-        try:
-            from staticfiles import finders  # noqa
-        except ImportError:
-            # Old (pre 1.0) and incompatible version of staticfiles
-            INSTALLED = False
-
-    if (INSTALLED and "compressor.finders.CompressorFinder"
-            not in settings.STATICFILES_FINDERS):
-        raise ImproperlyConfigured(
-            "When using Django Compressor together with staticfiles, "
-            "please add 'compressor.finders.CompressorFinder' to the "
-            "STATICFILES_FINDERS setting.")
-else:
-    finders = None  # noqa
diff --git a/django-compressor/django_compressor.egg-info/PKG-INFO b/django-compressor/django_compressor.egg-info/PKG-INFO
deleted file mode 100644 (file)
index 19e5fea..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-Metadata-Version: 1.1
-Name: django-compressor
-Version: 1.4
-Summary: Compresses linked and inline JavaScript or CSS into single cached files.
-Home-page: http://django-compressor.readthedocs.org/en/latest/
-Author: Jannis Leidel
-Author-email: jannis@leidel.info
-License: MIT
-Description: Django Compressor
-        =================
-        
-        .. image:: https://coveralls.io/repos/django-compressor/django-compressor/badge.png?branch=develop 
-          :target: https://coveralls.io/r/django-compressor/django-compressor?branch=develop
-        
-        .. image:: https://pypip.in/v/django_compressor/badge.png
-                :target: https://pypi.python.org/pypi/django_compressor
-        
-        .. image:: https://pypip.in/d/django_compressor/badge.png
-                :target: https://pypi.python.org/pypi/django_compressor
-        
-        .. image:: https://secure.travis-ci.org/django-compressor/django-compressor.png?branch=develop
-            :alt: Build Status
-            :target: http://travis-ci.org/django-compressor/django-compressor
-        
-        Django Compressor combines and compresses linked and inline Javascript
-        or CSS in a Django template into cacheable static files by using the
-        ``compress`` template tag.
-        
-        HTML in between ``{% compress js/css %}`` and ``{% endcompress %}`` is
-        parsed and searched for CSS or JS. These styles and scripts are subsequently
-        processed with optional, configurable compilers and filters.
-        
-        The default filter for CSS rewrites paths to static files to be absolute
-        and adds a cache busting timestamp. For Javascript the default filter
-        compresses it using ``jsmin``.
-        
-        As the final result the template tag outputs a ``<script>`` or ``<link>``
-        tag pointing to the optimized file. These files are stored inside a folder
-        and given a unique name based on their content. Alternatively it can also
-        return the resulting content to the original template directly.
-        
-        Since the file name is dependent on the content these files can be given
-        a far future expiration date without worrying about stale browser caches.
-        
-        The concatenation and compressing process can also be jump started outside
-        of the request/response cycle by using the Django management command
-        ``manage.py compress``.
-        
-        Configurability & Extendibility
-        -------------------------------
-        
-        Django Compressor is highly configurable and extendible. The HTML parsing
-        is done using lxml_ or if it's not available Python's built-in HTMLParser by
-        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`_,
-        `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
-        `data URIs`_.
-        
-        If your setup requires a different compressor or other post-processing
-        tool it will be fairly easy to implement a custom filter. Simply extend
-        from one of the available base classes.
-        
-        More documentation about the usage and settings of Django Compressor can be
-        found on `django-compressor.readthedocs.org`_.
-        
-        The source code for Django Compressor can be found and contributed to on
-        `github.com/django-compressor/django-compressor`_. There you can also file tickets.
-        
-        The in-development version of Django Compressor can be installed with
-        ``pip install http://github.com/django-compressor/django-compressor/tarball/develop``.
-        
-        .. _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/
-        .. _JSMin: http://www.crockford.com/javascript/jsmin.html
-        .. _cssmin: https://github.com/zacharyvoase/cssmin
-        .. _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
-        
-        
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Framework :: Django
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Topic :: Internet :: WWW/HTTP
diff --git a/django-compressor/django_compressor.egg-info/SOURCES.txt b/django-compressor/django_compressor.egg-info/SOURCES.txt
deleted file mode 100644 (file)
index 445ff9c..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-AUTHORS
-LICENSE
-MANIFEST.in
-Makefile
-README.rst
-setup.cfg
-setup.py
-tox.ini
-compressor/__init__.py
-compressor/base.py
-compressor/cache.py
-compressor/conf.py
-compressor/css.py
-compressor/exceptions.py
-compressor/finders.py
-compressor/js.py
-compressor/models.py
-compressor/signals.py
-compressor/storage.py
-compressor/test_settings.py
-compressor/contrib/__init__.py
-compressor/contrib/jinja2ext.py
-compressor/contrib/sekizai.py
-compressor/filters/__init__.py
-compressor/filters/base.py
-compressor/filters/closure.py
-compressor/filters/css_default.py
-compressor/filters/csstidy.py
-compressor/filters/datauri.py
-compressor/filters/template.py
-compressor/filters/yuglify.py
-compressor/filters/yui.py
-compressor/filters/cssmin/__init__.py
-compressor/filters/cssmin/cssmin.py
-compressor/filters/cssmin/rcssmin.py
-compressor/filters/jsmin/__init__.py
-compressor/filters/jsmin/rjsmin.py
-compressor/filters/jsmin/slimit.py
-compressor/management/__init__.py
-compressor/management/commands/__init__.py
-compressor/management/commands/compress.py
-compressor/management/commands/mtime_cache.py
-compressor/offline/__init__.py
-compressor/offline/django.py
-compressor/offline/jinja2.py
-compressor/parser/__init__.py
-compressor/parser/base.py
-compressor/parser/beautifulsoup.py
-compressor/parser/default_htmlparser.py
-compressor/parser/html5lib.py
-compressor/parser/lxml.py
-compressor/templates/compressor/css_file.html
-compressor/templates/compressor/css_inline.html
-compressor/templates/compressor/js_file.html
-compressor/templates/compressor/js_inline.html
-compressor/templatetags/__init__.py
-compressor/templatetags/compress.py
-compressor/tests/__init__.py
-compressor/tests/precompiler.py
-compressor/tests/test_base.py
-compressor/tests/test_filters.py
-compressor/tests/test_jinja2ext.py
-compressor/tests/test_offline.py
-compressor/tests/test_parsers.py
-compressor/tests/test_signals.py
-compressor/tests/test_storages.py
-compressor/tests/test_templatetags.py
-compressor/tests/static/css/datauri.css
-compressor/tests/static/css/nonasc.css
-compressor/tests/static/css/one.css
-compressor/tests/static/css/two.css
-compressor/tests/static/css/url/nonasc.css
-compressor/tests/static/css/url/test.css
-compressor/tests/static/css/url/url1.css
-compressor/tests/static/css/url/2/url2.css
-compressor/tests/static/img/add.png
-compressor/tests/static/img/python.png
-compressor/tests/static/js/nonasc-latin1.js
-compressor/tests/static/js/nonasc.js
-compressor/tests/static/js/one.coffee
-compressor/tests/static/js/one.js
-compressor/tests/test_templates/basic/test_compressor_offline.html
-compressor/tests/test_templates/test_block_super/base.html
-compressor/tests/test_templates/test_block_super/test_compressor_offline.html
-compressor/tests/test_templates/test_block_super_base_compressed/base.html
-compressor/tests/test_templates/test_block_super_base_compressed/base2.html
-compressor/tests/test_templates/test_block_super_base_compressed/test_compressor_offline.html
-compressor/tests/test_templates/test_block_super_extra/base.html
-compressor/tests/test_templates/test_block_super_extra/test_compressor_offline.html
-compressor/tests/test_templates/test_block_super_multiple/base.html
-compressor/tests/test_templates/test_block_super_multiple/base2.html
-compressor/tests/test_templates/test_block_super_multiple/test_compressor_offline.html
-compressor/tests/test_templates/test_block_super_multiple_cached/base.html
-compressor/tests/test_templates/test_block_super_multiple_cached/base2.html
-compressor/tests/test_templates/test_block_super_multiple_cached/test_compressor_offline.html
-compressor/tests/test_templates/test_complex/test_compressor_offline.html
-compressor/tests/test_templates/test_condition/test_compressor_offline.html
-compressor/tests/test_templates/test_duplicate/test_compressor_offline.html
-compressor/tests/test_templates/test_error_handling/buggy_extends.html
-compressor/tests/test_templates/test_error_handling/buggy_template.html
-compressor/tests/test_templates/test_error_handling/missing_extends.html
-compressor/tests/test_templates/test_error_handling/test_compressor_offline.html
-compressor/tests/test_templates/test_error_handling/with_coffeescript.html
-compressor/tests/test_templates/test_inline_non_ascii/test_compressor_offline.html
-compressor/tests/test_templates/test_static_templatetag/test_compressor_offline.html
-compressor/tests/test_templates/test_templatetag/test_compressor_offline.html
-compressor/tests/test_templates/test_with_context/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/basic/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_block_super/base.html
-compressor/tests/test_templates_jinja2/test_block_super/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_block_super_extra/base.html
-compressor/tests/test_templates_jinja2/test_block_super_extra/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_block_super_multiple/base.html
-compressor/tests/test_templates_jinja2/test_block_super_multiple/base2.html
-compressor/tests/test_templates_jinja2/test_block_super_multiple/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/base.html
-compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/base2.html
-compressor/tests/test_templates_jinja2/test_block_super_multiple_cached/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_coffin/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_complex/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_condition/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_error_handling/buggy_extends.html
-compressor/tests/test_templates_jinja2/test_error_handling/buggy_template.html
-compressor/tests/test_templates_jinja2/test_error_handling/missing_extends.html
-compressor/tests/test_templates_jinja2/test_error_handling/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_error_handling/with_coffeescript.html
-compressor/tests/test_templates_jinja2/test_inline_non_ascii/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_jingo/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_static_templatetag/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_templatetag/test_compressor_offline.html
-compressor/tests/test_templates_jinja2/test_with_context/test_compressor_offline.html
-compressor/utils/__init__.py
-compressor/utils/decorators.py
-compressor/utils/staticfiles.py
-compressor/utils/stringformat.py
-django_compressor.egg-info/PKG-INFO
-django_compressor.egg-info/SOURCES.txt
-django_compressor.egg-info/dependency_links.txt
-django_compressor.egg-info/not-zip-safe
-django_compressor.egg-info/requires.txt
-django_compressor.egg-info/top_level.txt
-docs/Makefile
-docs/behind-the-scenes.txt
-docs/changelog.txt
-docs/conf.py
-docs/contributing.txt
-docs/django-sekizai.txt
-docs/index.txt
-docs/jinja2.txt
-docs/make.bat
-docs/quickstart.txt
-docs/remote-storages.txt
-docs/scenarios.txt
-docs/settings.txt
-docs/usage.txt
-requirements/tests.txt
\ No newline at end of file
diff --git a/django-compressor/django_compressor.egg-info/dependency_links.txt b/django-compressor/django_compressor.egg-info/dependency_links.txt
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/django-compressor/django_compressor.egg-info/not-zip-safe b/django-compressor/django_compressor.egg-info/not-zip-safe
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/django-compressor/django_compressor.egg-info/requires.txt b/django-compressor/django_compressor.egg-info/requires.txt
deleted file mode 100644 (file)
index 0868509..0000000
+++ /dev/null
@@ -1 +0,0 @@
-django-appconf >= 0.4
\ No newline at end of file
diff --git a/django-compressor/django_compressor.egg-info/top_level.txt b/django-compressor/django_compressor.egg-info/top_level.txt
deleted file mode 100644 (file)
index 7b710e8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-compressor
diff --git a/django-compressor/setup.cfg b/django-compressor/setup.cfg
deleted file mode 100644 (file)
index 6c71b61..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[wheel]
-universal = 1
-
-[egg_info]
-tag_build = 
-tag_date = 0
-tag_svn_revision = 0
-
diff --git a/django-compressor/tox.ini b/django-compressor/tox.ini
deleted file mode 100644 (file)
index 1aa5e81..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-[deps]
-two =
-    flake8
-    coverage
-    html5lib
-    mock
-    jinja2
-    lxml
-    BeautifulSoup
-    unittest2
-    jingo
-    coffin
-three =
-    flake8
-    coverage
-    html5lib
-    mock
-    jinja2
-    lxml
-    BeautifulSoup4
-    jingo
-    coffin
-three_two =
-    flake8
-    coverage
-    html5lib
-    mock
-    jinja2==2.6
-    lxml
-    BeautifulSoup4
-    jingo
-    coffin
-
-[tox]
-envlist =
-    py33-1.6.X,
-    py32-1.6.X,
-    py27-1.6.X,
-    py26-1.6.X,
-    py33-1.5.X,
-    py32-1.5.X,
-    py27-1.5.X,
-    py26-1.5.X,
-    py27-1.4.X,
-    py26-1.4.X
-
-[testenv]
-setenv =
-    CPPFLAGS=-O0
-usedevelop = true
-whitelist_externals = /usr/bin/make
-downloadcache = {toxworkdir}/_download/
-commands =
-    django-admin.py --version
-    make test
-
-[testenv:py33-1.6.X]
-basepython = python3.3
-deps =
-    Django>=1.6,<1.7
-    {[deps]three}
-
-[testenv:py32-1.6.X]
-basepython = python3.2
-deps =
-    Django>=1.6,<1.7
-    {[deps]three_two}
-
-[testenv:py27-1.6.X]
-basepython = python2.7
-deps =
-    Django>=1.6,<1.7
-    {[deps]two}
-
-[testenv:py26-1.6.X]
-basepython = python2.6
-deps =
-    Django>=1.6,<1.7
-    {[deps]two}
-
-[testenv:py33-1.5.X]
-basepython = python3.3
-deps =
-    Django>=1.5,<1.6
-    django-discover-runner
-    {[deps]three}
-
-[testenv:py32-1.5.X]
-basepython = python3.2
-deps =
-    Django>=1.5,<1.6
-    django-discover-runner
-    {[deps]three_two}
-
-[testenv:py27-1.5.X]
-basepython = python2.7
-deps =
-    Django>=1.5,<1.6
-    django-discover-runner
-    {[deps]two}
-
-[testenv:py26-1.5.X]
-basepython = python2.6
-deps =
-    Django>=1.5,<1.6
-    django-discover-runner
-    {[deps]two}
-
-[testenv:py27-1.4.X]
-basepython = python2.7
-deps =
-    Django>=1.4,<1.5
-    django-discover-runner
-    {[deps]two}
-
-[testenv:py26-1.4.X]
-basepython = python2.6
-deps =
-    Django>=1.4,<1.5
-    django-discover-runner
-    {[deps]two}
diff --git a/python-django-compressor/.gitignore b/python-django-compressor/.gitignore
new file mode 100644 (file)
index 0000000..4b1a2c3
--- /dev/null
@@ -0,0 +1,15 @@
+build
+compressor/tests/static/CACHE
+compressor/tests/static/custom
+compressor/tests/static/js/066cd253eada.js
+compressor/tests/static/test.txt*
+
+dist
+MANIFEST
+*.pyc
+*.egg-info
+*.egg
+docs/_build/
+.sass-cache
+.coverage
+.tox
diff --git a/python-django-compressor/.travis.yml b/python-django-compressor/.travis.yml
new file mode 100644 (file)
index 0000000..b350b18
--- /dev/null
@@ -0,0 +1,27 @@
+language: python
+before_install:
+  - sudo apt-get update
+  - sudo apt-get install csstidy libxml2-dev libxslt-dev
+install:
+  - pip install tox
+script:
+  - tox
+env:
+  - TOXENV=py26-1.4.X
+  - TOXENV=py26-1.5.X
+  - TOXENV=py27-1.4.X
+  - TOXENV=py27-1.5.X
+  - TOXENV=py26-1.6.X
+  - TOXENV=py27-1.6.X
+  - TOXENV=py32-1.6.X
+  - TOXENV=py33-1.6.X
+  - TOXENV=py27-1.7.X
+  - TOXENV=py32-1.7.X
+  - TOXENV=py33-1.7.X
+  - TOXENV=py34-1.7.X
+  - TOXENV=py27-1.8.X
+  - TOXENV=py32-1.8.X
+  - TOXENV=py33-1.8.X
+  - TOXENV=py34-1.8.X
+notifications:
+  irc: "irc.freenode.org#django-compressor"
similarity index 98%
rename from django-compressor/AUTHORS
rename to python-django-compressor/AUTHORS
index de59146ae0b594d09826ede952333cae9b835280..7b9a5719dc8e59acd52afc40ae56f907ea27a0b7 100644 (file)
@@ -29,6 +29,7 @@ Bojan Mihelac
 Boris Shemigon
 Brad Whittington
 Bruno Renié
+Carlton Gibson
 Cassus Adam Banko
 Chris Adams
 Chris Streeter
similarity index 92%
rename from django-compressor/README.rst
rename to python-django-compressor/README.rst
index 93afc647da3d82c7f82ec0018f45033a2daa9003..86ed3d7ae6ff1983fb505a93c4ed158504edf92d 100644 (file)
@@ -4,16 +4,19 @@ Django Compressor
 .. image:: https://coveralls.io/repos/django-compressor/django-compressor/badge.png?branch=develop 
   :target: https://coveralls.io/r/django-compressor/django-compressor?branch=develop
 
-.. image:: https://pypip.in/v/django_compressor/badge.png
+.. image:: https://pypip.in/v/django_compressor/badge.svg
         :target: https://pypi.python.org/pypi/django_compressor
 
-.. image:: https://pypip.in/d/django_compressor/badge.png
+.. image:: https://pypip.in/d/django_compressor/badge.svg
         :target: https://pypi.python.org/pypi/django_compressor
 
-.. image:: https://secure.travis-ci.org/django-compressor/django-compressor.png?branch=develop
+.. image:: https://secure.travis-ci.org/django-compressor/django-compressor.svg?branch=develop
     :alt: Build Status
     :target: http://travis-ci.org/django-compressor/django-compressor
 
+.. image:: https://caniusepython3.com/project/django_compressor.svg
+    :target: https://caniusepython3.com/project/django_compressor
+
 Django Compressor combines and compresses linked and inline Javascript
 or CSS in a Django template into cacheable static files by using the
 ``compress`` template tag.
similarity index 50%
rename from django-compressor/compressor/__init__.py
rename to python-django-compressor/compressor/__init__.py
index ae247e6752ba7034aa9309be79846472610e683d..5e617817b468f25579a01aaa2527cb2e3c1818aa 100644 (file)
@@ -1,2 +1,2 @@
 # following PEP 386
-__version__ = "1.4"
+__version__ = "1.5"
similarity index 98%
rename from django-compressor/compressor/base.py
rename to python-django-compressor/compressor/base.py
index de9c9ce2bf069b1fda73da709f1549e90a262b33..54b16f39c530a13c736e18fa388467d606ee0f78 100644 (file)
@@ -5,7 +5,10 @@ import codecs
 from django.core.files.base import ContentFile
 from django.template import Context
 from django.template.loader import render_to_string
-from django.utils.importlib import import_module
+try:
+    from importlib import import_module
+except:
+    from django.utils.importlib import import_module
 from django.utils.safestring import mark_safe
 
 try:
@@ -140,6 +143,9 @@ class Compressor(object):
         """
         Reads file contents using given `charset` and returns it as text.
         """
+        if charset == 'utf-8':
+            # Removes BOM
+            charset = 'utf-8-sig'
         with codecs.open(filename, 'r', charset) as fd:
             try:
                 return fd.read()
@@ -247,7 +253,7 @@ class Compressor(object):
                 mod_name, cls_name = get_mod_func(filter_or_command)
                 try:
                     mod = import_module(mod_name)
-                except ImportError:
+                except (ImportError, TypeError):
                     filter = CompilerFilter(
                         content, filter_type=self.type, filename=filename,
                         charset=charset, command=filter_or_command)
similarity index 92%
rename from django-compressor/compressor/cache.py
rename to python-django-compressor/compressor/cache.py
index 48479393b09fa38c0038f4cd0dfd9b60ab706b07..f80bf54547827cd8023bcc9a2a990822f9c1d0c1 100644 (file)
@@ -4,11 +4,21 @@ import os
 import socket
 import time
 
-from django.core.cache import get_cache
+try:
+    from django.core.cache import caches
+    def get_cache(name):
+        return caches[name]
+except ImportError:
+    from django.core.cache import get_cache
+
 from django.core.files.base import ContentFile
 from django.utils.encoding import force_text, smart_bytes
 from django.utils.functional import SimpleLazyObject
-from django.utils.importlib import import_module
+
+try:
+    from importlib import import_module
+except:
+    from django.utils.importlib import import_module
 
 from compressor.conf import settings
 from compressor.storage import default_storage
@@ -39,7 +49,7 @@ def get_cachekey(*args, **kwargs):
             mod_name, func_name = get_mod_func(
                 settings.COMPRESS_CACHE_KEY_FUNCTION)
             _cachekey_func = getattr(import_module(mod_name), func_name)
-        except (AttributeError, ImportError) as e:
+        except (AttributeError, ImportError, TypeError) as e:
             raise ImportError("Couldn't import cache key function %s: %s" %
                               (settings.COMPRESS_CACHE_KEY_FUNCTION, e))
     return _cachekey_func(*args, **kwargs)
similarity index 98%
rename from django-compressor/compressor/conf.py
rename to python-django-compressor/compressor/conf.py
index e9763d92f5c92ad9776e750da364bf350ec588e8..87f9d697006b44cbb8ecc8efcbd2ff7efb564a47 100644 (file)
@@ -45,6 +45,8 @@ class CompressorConf(AppConf):
     YUGLIFY_BINARY = 'yuglify'
     YUGLIFY_CSS_ARGUMENTS = '--terminal'
     YUGLIFY_JS_ARGUMENTS = '--terminal'
+    CLEAN_CSS_BINARY = 'cleancss'
+    CLEAN_CSS_ARGUMENTS = ''
     DATA_URI_MAX_SIZE = 1024
 
     # the cache backend to use
similarity index 97%
rename from django-compressor/compressor/css.py
rename to python-django-compressor/compressor/css.py
index e10697bf062342c0d615522f0e063dc37602f833..45cdcd2b8a565ef6035b65697b1b11d7a113d3ca 100644 (file)
@@ -34,7 +34,7 @@ class CssCompressor(Compressor):
                     self.media_nodes[-1][1].split_content.append(data)
                 else:
                     node = self.__class__(content=self.parser.elem_str(elem),
-                                         context=self.context)
+                                          context=self.context)
                     node.split_content.append(data)
                     self.media_nodes.append((media, node))
         return self.split_content
similarity index 89%
rename from django-compressor/compressor/filters/base.py
rename to python-django-compressor/compressor/filters/base.py
index 284afcb3e5f04e63de1191726f6e5abebfe2d335..ee14b823b7d492bbbc28730343096916c52677f3 100644 (file)
@@ -3,9 +3,27 @@ import io
 import logging
 import subprocess
 
+from platform import system
+
+if system() != "Windows":
+    try:
+        from shlex import quote as shell_quote  # Python 3
+    except ImportError:
+        from pipes import quote as shell_quote  # Python 2
+else:
+    from subprocess import list2cmdline
+    def shell_quote(s):
+        # shlex.quote/pipes.quote is not compatible with Windows
+        return list2cmdline([s])
+
 from django.core.exceptions import ImproperlyConfigured
 from django.core.files.temp import NamedTemporaryFile
-from django.utils.importlib import import_module
+
+try:
+    from importlib import import_module
+except ImportError:
+    from django.utils.importlib import import_module
+
 from django.utils.encoding import smart_text
 from django.utils import six
 
@@ -26,7 +44,7 @@ class FilterBase(object):
     """
     def __init__(self, content, filter_type=None, filename=None, verbose=0,
                  charset=None):
-        self.type = filter_type
+        self.type = filter_type or getattr(self, 'type', None)
         self.content = content
         self.verbose = verbose or settings.COMPRESS_VERBOSE
         self.logger = logger
@@ -65,7 +83,7 @@ class CallbackOutputFilter(FilterBase):
         try:
             mod_name, func_name = get_mod_func(self.callback)
             func = getattr(import_module(mod_name), func_name)
-        except ImportError:
+        except (ImportError, TypeError):
             if self.dependencies:
                 if len(self.dependencies) == 1:
                     warning = "dependency (%s) is" % self.dependencies[0]
@@ -147,6 +165,12 @@ class CompilerFilter(FilterBase):
             self.outfile = NamedTemporaryFile(mode='r+', suffix=ext)
             options["outfile"] = self.outfile.name
 
+        # Quote infile and outfile for spaces etc.
+        if "infile" in options:
+            options["infile"] = shell_quote(options["infile"])
+        if "outfile" in options:
+            options["outfile"] = shell_quote(options["outfile"])
+
         try:
             command = self.command.format(**options)
             proc = subprocess.Popen(
diff --git a/python-django-compressor/compressor/filters/cleancss.py b/python-django-compressor/compressor/filters/cleancss.py
new file mode 100644 (file)
index 0000000..daa381a
--- /dev/null
@@ -0,0 +1,10 @@
+from compressor.conf import settings
+from compressor.filters import CompilerFilter
+
+
+class CleanCSSFilter(CompilerFilter):
+    command = "{binary} {args} -o {outfile} {infile}"
+    options = (
+        ("binary", settings.COMPRESS_CLEAN_CSS_BINARY),
+        ("args", settings.COMPRESS_CLEAN_CSS_ARGUMENTS),
+    )
similarity index 90%
rename from django-compressor/compressor/filters/css_default.py
rename to python-django-compressor/compressor/filters/css_default.py
index 1727beb769535a24980bb4bdc0edabab91afd50b..adc0b2479e9e584e0949ca7df94e59e572bf0ab9 100644 (file)
@@ -5,7 +5,6 @@ import posixpath
 from compressor.cache import get_hashed_mtime, get_hashed_content
 from compressor.conf import settings
 from compressor.filters import FilterBase, FilterError
-from compressor.utils import staticfiles
 
 URL_PATTERN = re.compile(r'url\(([^\)]+)\)')
 SRC_PATTERN = re.compile(r'src=([\'"])(.+?)\1')
@@ -22,10 +21,7 @@ class CssAbsoluteFilter(FilterBase):
         self.has_scheme = False
 
     def input(self, filename=None, basename=None, **kwargs):
-        if filename is not None:
-            filename = os.path.normcase(os.path.abspath(filename))
-        if (not (filename and filename.startswith(self.root)) and
-                not self.find(basename)):
+        if not filename:
             return self.content
         self.path = basename.replace(os.sep, '/')
         self.path = self.path.lstrip('/')
@@ -40,10 +36,6 @@ class CssAbsoluteFilter(FilterBase):
         return SRC_PATTERN.sub(self.src_converter,
             URL_PATTERN.sub(self.url_converter, self.content))
 
-    def find(self, basename):
-        if settings.DEBUG and basename and staticfiles.finders:
-            return staticfiles.finders.find(basename)
-
     def guess_filename(self, url):
         local_path = url
         if self.has_scheme:
@@ -70,6 +62,8 @@ class CssAbsoluteFilter(FilterBase):
                 suffix = get_hashed_mtime(filename)
             elif settings.COMPRESS_CSS_HASHING_METHOD in ("hash", "content"):
                 suffix = get_hashed_content(filename)
+            elif settings.COMPRESS_CSS_HASHING_METHOD is None:
+                suffix = None
             else:
                 raise FilterError('COMPRESS_CSS_HASHING_METHOD is configured '
                                   'with an unknown method (%s).' %
diff --git a/python-django-compressor/compressor/js.py b/python-django-compressor/compressor/js.py
new file mode 100644 (file)
index 0000000..f60cc7e
--- /dev/null
@@ -0,0 +1,53 @@
+from compressor.conf import settings
+from compressor.base import Compressor, SOURCE_HUNK, SOURCE_FILE
+
+
+class JsCompressor(Compressor):
+
+    def __init__(self, content=None, output_prefix="js", context=None):
+        super(JsCompressor, self).__init__(content, output_prefix, context)
+        self.filters = list(settings.COMPRESS_JS_FILTERS)
+        self.type = output_prefix
+
+    def split_contents(self):
+        if self.split_content:
+            return self.split_content
+        self.extra_nodes = []
+        for elem in self.parser.js_elems():
+            attribs = self.parser.elem_attribs(elem)
+            if 'src' in attribs:
+                basename = self.get_basename(attribs['src'])
+                filename = self.get_filename(basename)
+                content = (SOURCE_FILE, filename, basename, elem)
+            else:
+                content = (SOURCE_HUNK, self.parser.elem_content(elem), None, elem)
+            self.split_content.append(content)
+            if 'async' in attribs:
+                extra = ' async'
+            elif 'defer' in attribs:
+                extra = ' defer'
+            else:
+                extra = ''
+            # Append to the previous node if it had the same attribute
+            append_to_previous = (self.extra_nodes and
+                                  self.extra_nodes[-1][0] == extra)
+            if append_to_previous and settings.COMPRESS_ENABLED:
+                self.extra_nodes[-1][1].split_content.append(content)
+            else:
+                node = self.__class__(content=self.parser.elem_str(elem),
+                                      context=self.context)
+                node.split_content.append(content)
+                self.extra_nodes.append((extra, node))
+        return self.split_content
+
+    def output(self, *args, **kwargs):
+        if (settings.COMPRESS_ENABLED or settings.COMPRESS_PRECOMPILERS or
+                kwargs.get('forced', False)):
+            self.split_contents()
+            if hasattr(self, 'extra_nodes'):
+                ret = []
+                for extra, subnode in self.extra_nodes:
+                    subnode.extra_context.update({'extra': extra})
+                    ret.append(subnode.output(*args, **kwargs))
+                return '\n'.join(ret)
+        return super(JsCompressor, self).output(*args, **kwargs)
similarity index 89%
rename from django-compressor/compressor/management/commands/compress.py
rename to python-django-compressor/compressor/management/commands/compress.py
index 6be215e6ed87aaf7c1b2949dcbe7c5c96258e548..8cf19266a32bf665b9d1b3b78e6d02b3642d1d27 100644 (file)
@@ -5,6 +5,7 @@ import sys
 from fnmatch import fnmatch
 from optparse import make_option
 
+import django
 from django.core.management.base import NoArgsCommand, CommandError
 import django.template
 from django.template import Context
@@ -53,24 +54,30 @@ class Command(NoArgsCommand):
     requires_model_validation = False
 
     def get_loaders(self):
-        from django.template.loader import template_source_loaders
-        if template_source_loaders is None:
-            try:
-                from django.template.loader import (
-                    find_template as finder_func)
-            except ImportError:
-                from django.template.loader import (
-                    find_template_source as finder_func)  # noqa
-            try:
-                # Force django to calculate template_source_loaders from
-                # TEMPLATE_LOADERS settings, by asking to find a dummy template
-                source, name = finder_func('test')
-            except django.template.TemplateDoesNotExist:
-                pass
-            # Reload template_source_loaders now that it has been calculated ;
-            # it should contain the list of valid, instanciated template loaders
-            # to use.
+        if django.VERSION < (1, 8):
             from django.template.loader import template_source_loaders
+            if template_source_loaders is None:
+                try:
+                    from django.template.loader import (
+                        find_template as finder_func)
+                except ImportError:
+                    from django.template.loader import (
+                        find_template_source as finder_func)  # noqa
+                try:
+                    # Force django to calculate template_source_loaders from
+                    # TEMPLATE_LOADERS settings, by asking to find a dummy template
+                    source, name = finder_func('test')
+                except django.template.TemplateDoesNotExist:
+                    pass
+                # Reload template_source_loaders now that it has been calculated ;
+                # it should contain the list of valid, instanciated template loaders
+                # to use.
+                from django.template.loader import template_source_loaders
+        else:
+            from django.template import engines
+            template_source_loaders = []
+            for e in engines.all():
+                template_source_loaders.extend(e.engine.get_template_loaders(e.engine.loaders))
         loaders = []
         # If template loader is CachedTemplateLoader, return the loaders
         # that it wraps around. So if we have
@@ -130,7 +137,7 @@ class Command(NoArgsCommand):
                 if get_template_sources is None:
                     get_template_sources = loader.get_template_sources
                 paths.update(list(get_template_sources('')))
-            except (ImportError, AttributeError):
+            except (ImportError, AttributeError, TypeError):
                 # Yeah, this didn't work out so well, let's move on
                 pass
         if not paths:
similarity index 80%
rename from django-compressor/compressor/offline/django.py
rename to python-django-compressor/compressor/offline/django.py
index 6541471b46de66508843ad5791555e25366359c0..107c6e4d7f72c73d6a73eb8318104919e15940ed 100644 (file)
@@ -1,13 +1,13 @@
 from __future__ import absolute_import
-import io
 from copy import copy
 
+import django
 from django import template
 from django.conf import settings
-from django.template import Template
 from django.template import Context
 from django.template.base import Node, VariableNode, TextNode, NodeList
 from django.template.defaulttags import IfNode
+from django.template.loader import get_template
 from django.template.loader_tags import ExtendsNode, BlockNode, BlockContext
 
 
@@ -15,7 +15,7 @@ from compressor.exceptions import TemplateSyntaxError, TemplateDoesNotExist
 from compressor.templatetags.compress import CompressorNode
 
 
-def handle_extendsnode(extendsnode, block_context=None):
+def handle_extendsnode(extendsnode, block_context=None, original=None):
     """Create a copy of Node tree of a derived template replacing
     all blocks tags with the nodes of appropriate blocks.
     Also handles {{ block.super }} tags.
@@ -27,6 +27,9 @@ def handle_extendsnode(extendsnode, block_context=None):
     block_context.add_blocks(blocks)
 
     context = Context(settings.COMPRESS_OFFLINE_CONTEXT)
+    if original is not None:
+        context.template = original
+
     compiled_parent = extendsnode.get_parent(context)
     parent_nodelist = compiled_parent.nodelist
     # If the parent template has an ExtendsNode it is not the root.
@@ -34,7 +37,7 @@ def handle_extendsnode(extendsnode, block_context=None):
         # The ExtendsNode has to be the first non-text node.
         if not isinstance(node, TextNode):
             if isinstance(node, ExtendsNode):
-                return handle_extendsnode(node, block_context)
+                return handle_extendsnode(node, block_context, original)
             break
     # Add blocks of the root template to block context.
     blocks = dict((n.name, n) for n in
@@ -55,6 +58,8 @@ def remove_block_nodes(nodelist, block_stack, block_context):
                 if not block_stack:
                     continue
                 node = block_context.get_block(block_stack[-1].name)
+                if not node:
+                    continue
         if isinstance(node, BlockNode):
             expanded_block = expand_blocknode(node, block_stack, block_context)
             new_nodelist.extend(expanded_block)
@@ -93,13 +98,15 @@ class DjangoParser(object):
         self.charset = charset
 
     def parse(self, template_name):
-        with io.open(template_name, mode='rb') as file:
-            try:
-                return Template(file.read().decode(self.charset))
-            except template.TemplateSyntaxError as e:
-                raise TemplateSyntaxError(str(e))
-            except template.TemplateDoesNotExist as e:
-                raise TemplateDoesNotExist(str(e))
+        try:
+            if django.VERSION < (1, 8):
+                return get_template(template_name)
+            else:
+                return get_template(template_name).template
+        except template.TemplateSyntaxError as e:
+            raise TemplateSyntaxError(str(e))
+        except template.TemplateDoesNotExist as e:
+            raise TemplateDoesNotExist(str(e))
 
     def process_template(self, template, context):
         return True
@@ -111,15 +118,17 @@ class DjangoParser(object):
         pass
 
     def render_nodelist(self, template, context, node):
+        if django.VERSION >= (1, 8):
+            context.template = template
         return node.nodelist.render(context)
 
     def render_node(self, template, context, node):
         return node.render(context, forced=True)
 
-    def get_nodelist(self, node):
+    def get_nodelist(self, node, original=None):
         if isinstance(node, ExtendsNode):
             try:
-                return handle_extendsnode(node)
+                return handle_extendsnode(node, block_context=None, original=original)
             except template.TemplateSyntaxError as e:
                 raise TemplateSyntaxError(str(e))
             except template.TemplateDoesNotExist as e:
@@ -134,10 +143,12 @@ class DjangoParser(object):
             nodelist = getattr(node, 'nodelist', [])
         return nodelist
 
-    def walk_nodes(self, node):
-        for node in self.get_nodelist(node):
+    def walk_nodes(self, node, original=None):
+        if django.VERSION >= (1, 8) and original is None:
+            original = node
+        for node in self.get_nodelist(node, original):
             if isinstance(node, CompressorNode) and node.is_offline_compression_enabled(forced=True):
                 yield node
             else:
-                for node in self.walk_nodes(node):
+                for node in self.walk_nodes(node, original):
                     yield node
similarity index 87%
rename from django-compressor/compressor/parser/__init__.py
rename to python-django-compressor/compressor/parser/__init__.py
index a3fe78f8b28608dc68e1d7321296d3f1f7f6502d..19beb01aa8d3bac080a8dae5a8a62d2114ad0641 100644 (file)
@@ -1,6 +1,9 @@
 from django.utils import six
 from django.utils.functional import LazyObject
-from django.utils.importlib import import_module
+try:
+    from importlib import import_module
+except ImportError:
+    from django.utils.importlib import import_module
 
 # support legacy parser module usage
 from compressor.parser.base import ParserBase  # noqa
@@ -30,5 +33,5 @@ class AutoSelectParser(LazyObject):
                 import_module(dependency)
                 self._wrapped = parser(content)
                 break
-            except ImportError:
+            except (ImportError, TypeError):
                 continue
diff --git a/python-django-compressor/compressor/templates/compressor/js_file.html b/python-django-compressor/compressor/templates/compressor/js_file.html
new file mode 100644 (file)
index 0000000..e76d860
--- /dev/null
@@ -0,0 +1 @@
+<script type="text/javascript" src="{{ compressed.url }}"{{ compressed.extra }}></script>
\ No newline at end of file
similarity index 64%
rename from django-compressor/compressor/test_settings.py
rename to python-django-compressor/compressor/test_settings.py
index a5abf921a8ddb7c903c22f43b87d5d5454a2a85f..7fb021cb06d9bc3ae21815c87f24e474232fce89 100644 (file)
@@ -3,7 +3,13 @@ import django
 
 TEST_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'tests')
 
-COMPRESS_CACHE_BACKEND = 'locmem://'
+
+CACHES = {
+    'default': {
+        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
+        'LOCATION': 'unique-snowflake'
+    }
+}
 
 DATABASES = {
     'default': {
@@ -13,9 +19,17 @@ DATABASES = {
 }
 
 INSTALLED_APPS = [
+    'django.contrib.staticfiles',
     'compressor',
     'coffin',
-    'jingo',
+]
+if django.VERSION < (1, 8):
+    INSTALLED_APPS.append('jingo')
+
+STATICFILES_FINDERS = [
+    'django.contrib.staticfiles.finders.FileSystemFinder',
+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+    'compressor.finders.CompressorFinder',
 ]
 
 STATIC_URL = '/static/'
@@ -38,3 +52,5 @@ SECRET_KEY = "iufoj=mibkpdz*%bob952x(%49rqgv8gg45k36kjcg76&-y5=!"
 PASSWORD_HASHERS = (
     'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
 )
+
+MIDDLEWARE_CLASSES = []
similarity index 72%
rename from django-compressor/compressor/tests/precompiler.py
rename to python-django-compressor/compressor/tests/precompiler.py
index 059a322ab8d06f45687e2978be4a0230cd2ad91e..5b3e9afd3a5704267fc677a50c6948930a880b25 100644 (file)
@@ -7,11 +7,11 @@ import sys
 def main():
     p = optparse.OptionParser()
     p.add_option('-f', '--file', action="store",
-                type="string", dest="filename",
-                help="File to read from, defaults to stdin", default=None)
+                 type="string", dest="filename",
+                 help="File to read from, defaults to stdin", default=None)
     p.add_option('-o', '--output', action="store",
-                type="string", dest="outfile",
-                help="File to write to, defaults to stdout", default=None)
+                 type="string", dest="outfile",
+                 help="File to write to, defaults to stdout", default=None)
 
     options, arguments = p.parse_args()
 
diff --git a/python-django-compressor/compressor/tests/static/css/filename with spaces.css b/python-django-compressor/compressor/tests/static/css/filename with spaces.css
new file mode 100644 (file)
index 0000000..239f51c
--- /dev/null
@@ -0,0 +1 @@
+body { background:#424242; }
\ No newline at end of file
diff --git a/python-django-compressor/compressor/tests/static/css/utf-8_with-BOM.css b/python-django-compressor/compressor/tests/static/css/utf-8_with-BOM.css
new file mode 100644 (file)
index 0000000..06a6209
--- /dev/null
@@ -0,0 +1 @@
+.compress-test {color: red;}
\ No newline at end of file
diff --git a/python-django-compressor/compressor/tests/static/js/three.js b/python-django-compressor/compressor/tests/static/js/three.js
new file mode 100644 (file)
index 0000000..e01a825
--- /dev/null
@@ -0,0 +1 @@
+hermanos = {}
\ No newline at end of file
diff --git a/python-django-compressor/compressor/tests/static/js/two.js b/python-django-compressor/compressor/tests/static/js/two.js
new file mode 100644 (file)
index 0000000..595f5b5
--- /dev/null
@@ -0,0 +1 @@
+pollos = {}
\ No newline at end of file
similarity index 78%
rename from django-compressor/compressor/tests/test_base.py
rename to python-django-compressor/compressor/tests/test_base.py
index 46b1d91e85f3753e936661c7b535e9ff771bf902..e8255db12e463ee1f25d4977921edcf8713a04d5 100644 (file)
@@ -12,11 +12,13 @@ from django.core.cache.backends import locmem
 from django.test import SimpleTestCase
 from django.test.utils import override_settings
 
-from compressor.base import SOURCE_HUNK, SOURCE_FILE
+from compressor import cache as cachemod
+from compressor.base import SOURCE_FILE, SOURCE_HUNK
+from compressor.cache import get_cachekey
 from compressor.conf import settings
 from compressor.css import CssCompressor
+from compressor.exceptions import FilterDoesNotExist, FilterError
 from compressor.js import JsCompressor
-from compressor.exceptions import FilterDoesNotExist
 
 
 def make_soup(markup):
@@ -112,6 +114,14 @@ class CompressorTestCase(SimpleTestCase):
         hunks = '\n'.join([h for h in self.css_node.hunks()])
         self.assertEqual(out, hunks)
 
+    def test_css_output_with_bom_input(self):
+        out = 'body { background:#990; }\n.compress-test {color: red;}'
+        css = ("""<link rel="stylesheet" href="/static/css/one.css" type="text/css" />
+        <link rel="stylesheet" href="/static/css/utf-8_with-BOM.css" type="text/css" />""")
+        css_node_with_bom = CssCompressor(css)
+        hunks = '\n'.join([h for h in css_node_with_bom.hunks()])
+        self.assertEqual(out, hunks)
+
     def test_css_mtimes(self):
         is_date = re.compile(r'^\d{10}[\.\d]+$')
         for date in self.css_node.mtimes:
@@ -208,6 +218,14 @@ class CompressorTestCase(SimpleTestCase):
         css_node = CssCompressor(css)
         self.assertRaises(FilterDoesNotExist, css_node.output, 'inline')
 
+    @override_settings(COMPRESS_PRECOMPILERS=(
+        ('text/foobar', './foo -I ./bar/baz'),
+    ), COMPRESS_ENABLED=True)
+    def test_command_with_dot_precompiler(self):
+        css = '<style type="text/foobar">p { border:10px solid red;}</style>'
+        css_node = CssCompressor(css)
+        self.assertRaises(FilterError, css_node.output, 'inline')
+
 
 class CssMediaTestCase(SimpleTestCase):
     def setUp(self):
@@ -267,4 +285,49 @@ class CacheBackendTestCase(CompressorTestCase):
 
     def test_correct_backend(self):
         from compressor.cache import cache
-        self.assertEqual(cache.__class__, locmem.CacheClass)
+        self.assertEqual(cache.__class__, locmem.LocMemCache)
+
+
+class JsAsyncDeferTestCase(SimpleTestCase):
+    def setUp(self):
+        self.js = """\
+            <script src="/static/js/one.js" type="text/javascript"></script>
+            <script src="/static/js/two.js" type="text/javascript" async></script>
+            <script src="/static/js/three.js" type="text/javascript" defer></script>
+            <script type="text/javascript">obj.value = "value";</script>
+            <script src="/static/js/one.js" type="text/javascript" async></script>
+            <script src="/static/js/two.js" type="text/javascript" async></script>
+            <script src="/static/js/three.js" type="text/javascript"></script>"""
+
+    def test_js_output(self):
+        def extract_attr(tag):
+            if tag.has_attr('async'):
+                return 'async'
+            if tag.has_attr('defer'):
+                return 'defer'
+        js_node = JsCompressor(self.js)
+        output = [None, 'async', 'defer', None, 'async', None]
+        if six.PY3:
+            scripts = make_soup(js_node.output()).find_all('script')
+            attrs = [extract_attr(i) for i in scripts]
+        else:
+            scripts = make_soup(js_node.output()).findAll('script')
+            attrs = [s.get('async') or s.get('defer') for s in scripts]
+        self.assertEqual(output, attrs)
+
+
+class CacheTestCase(SimpleTestCase):
+
+    def setUp(self):
+        cachemod._cachekey_func = None
+
+    def test_get_cachekey_basic(self):
+        self.assertEqual(get_cachekey("foo"), "django_compressor.foo")
+
+    @override_settings(COMPRESS_CACHE_KEY_FUNCTION='.leading.dot')
+    def test_get_cachekey_leading_dot(self):
+        self.assertRaises(ImportError, lambda: get_cachekey("foo"))
+
+    @override_settings(COMPRESS_CACHE_KEY_FUNCTION='invalid.module')
+    def test_get_cachekey_invalid_mod(self):
+        self.assertRaises(ImportError, lambda: get_cachekey("foo"))
similarity index 69%
rename from django-compressor/compressor/tests/test_filters.py
rename to python-django-compressor/compressor/tests/test_filters.py
index b656a65874ed4358db25d4af0b1e91830803ef9f..784d89a53c71d448fb10f582761c12d6eb9837a0 100644 (file)
@@ -1,4 +1,5 @@
 from __future__ import with_statement, unicode_literals
+from collections import defaultdict
 import io
 import os
 import sys
@@ -17,9 +18,18 @@ from compressor.filters.base import CompilerFilter
 from compressor.filters.cssmin import CSSMinFilter
 from compressor.filters.css_default import CssAbsoluteFilter
 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
 from compressor.tests.test_base import test_dir
 
 
+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):
@@ -30,7 +40,6 @@ class CssTidyTestCase(TestCase):
         color: black;
         }
         """)
-        from compressor.filters.csstidy import CSSTidyFilter
         ret = CSSTidyFilter(content).input()
         self.assertIsInstance(ret, six.text_type)
         self.assertEqual(
@@ -39,10 +48,13 @@ class CssTidyTestCase(TestCase):
 
 class PrecompilerTestCase(TestCase):
     def setUp(self):
-        self.filename = os.path.join(test_dir, 'static/css/one.css')
+        self.test_precompiler = os.path.join(test_dir, 'precompiler.py')
+        self.setup_infile()
+
+    def setup_infile(self, filename='static/css/one.css'):
+        self.filename = os.path.join(test_dir, filename)
         with io.open(self.filename, encoding=settings.FILE_CHARSET) as file:
             self.content = file.read()
-        self.test_precompiler = os.path.join(test_dir, 'precompiler.py')
 
     def test_precompiler_infile_outfile(self):
         command = '%s %s -f {infile} -o {outfile}' % (sys.executable, self.test_precompiler)
@@ -51,6 +63,14 @@ class PrecompilerTestCase(TestCase):
             charset=settings.FILE_CHARSET, command=command)
         self.assertEqual("body { color:#990; }", compiler.input())
 
+    def test_precompiler_infile_with_spaces(self):
+        self.setup_infile('static/css/filename with spaces.css')
+        command = '%s %s -f {infile} -o {outfile}' % (sys.executable, self.test_precompiler)
+        compiler = CompilerFilter(
+            content=self.content, filename=self.filename,
+            charset=settings.FILE_CHARSET, command=command)
+        self.assertEqual("body { color:#424242; }", compiler.input())
+
     def test_precompiler_infile_stdout(self):
         command = '%s %s -f {infile}' % (sys.executable, self.test_precompiler)
         compiler = CompilerFilter(
@@ -99,8 +119,8 @@ class CssMinTestCase(TestCase):
 class CssAbsolutizingTestCase(TestCase):
     hashing_method = 'mtime'
     hashing_func = staticmethod(get_hashed_mtime)
-    content = ("p { background: url('../../img/python.png') }"
-               "p { filter: Alpha(src='../../img/python.png') }")
+    template = ("p { background: url('%(url)simg/python.png%(query)s%(hash)s%(frag)s') }"
+                "p { filter: Alpha(src='%(url)simg/python.png%(query)s%(hash)s%(frag)s') }")
 
     def setUp(self):
         self.old_enabled = settings.COMPRESS_ENABLED
@@ -120,40 +140,55 @@ class CssAbsolutizingTestCase(TestCase):
         settings.COMPRESS_URL = self.old_url
         settings.COMPRESS_CSS_HASHING_METHOD = self.old_hashing_method
 
+    def test_css_no_hash(self):
+        settings.COMPRESS_CSS_HASHING_METHOD = None
+        filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
+        content = self.template % blankdict(url='../../')
+        params = blankdict({
+            'url': settings.COMPRESS_URL,
+        })
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
+        self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
+
+        settings.COMPRESS_URL = params['url'] = 'http://static.example.com/'
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
+        self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
+
     def test_css_absolute_filter(self):
         filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
         imagefilename = os.path.join(settings.COMPRESS_ROOT, 'img/python.png')
-        params = {
+        content = self.template % blankdict(url='../../')
+        params = blankdict({
             'url': settings.COMPRESS_URL,
-            'hash': self.hashing_func(imagefilename),
-        }
-        output = ("p { background: url('%(url)simg/python.png?%(hash)s') }"
-                  "p { filter: Alpha(src='%(url)simg/python.png?%(hash)s') }") % params
-        filter = CssAbsoluteFilter(self.content)
+            'hash': '?' + self.hashing_func(imagefilename),
+        })
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
+
         settings.COMPRESS_URL = params['url'] = 'http://static.example.com/'
-        filter = CssAbsoluteFilter(self.content)
-        filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
-        output = ("p { background: url('%(url)simg/python.png?%(hash)s') }"
-                  "p { filter: Alpha(src='%(url)simg/python.png?%(hash)s') }") % params
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
 
     def test_css_absolute_filter_url_fragment(self):
         filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
         imagefilename = os.path.join(settings.COMPRESS_ROOT, 'img/python.png')
-        params = {
+        content = self.template % blankdict(url='../../', frag='#foo')
+        params = blankdict({
             'url': settings.COMPRESS_URL,
-            'hash': self.hashing_func(imagefilename),
-        }
-        content = "p { background: url('../../img/python.png#foo') }"
-
-        output = "p { background: url('%(url)simg/python.png?%(hash)s#foo') }" % params
+            'hash': '?' + self.hashing_func(imagefilename),
+            'frag': '#foo',
+        })
+        output = self.template % params
         filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
+
         settings.COMPRESS_URL = params['url'] = 'http://media.example.com/'
+        output = self.template % params
         filter = CssAbsoluteFilter(content)
-        filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
-        output = "p { background: url('%(url)simg/python.png?%(hash)s#foo') }" % params
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
 
     def test_css_absolute_filter_only_url_fragment(self):
@@ -161,64 +196,78 @@ class CssAbsolutizingTestCase(TestCase):
         content = "p { background: url('#foo') }"
         filter = CssAbsoluteFilter(content)
         self.assertEqual(content, filter.input(filename=filename, basename='css/url/test.css'))
+
         settings.COMPRESS_URL = 'http://media.example.com/'
         filter = CssAbsoluteFilter(content)
-        filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
         self.assertEqual(content, filter.input(filename=filename, basename='css/url/test.css'))
 
     def test_css_absolute_filter_querystring(self):
         filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
         imagefilename = os.path.join(settings.COMPRESS_ROOT, 'img/python.png')
-        params = {
+        content = self.template % blankdict(url='../../', query='?foo')
+        params = blankdict({
             'url': settings.COMPRESS_URL,
-            'hash': self.hashing_func(imagefilename),
-        }
-        content = "p { background: url('../../img/python.png?foo') }"
-
-        output = "p { background: url('%(url)simg/python.png?foo&%(hash)s') }" % params
+            'query': '?foo',
+            'hash': '&' + self.hashing_func(imagefilename),
+        })
+        output = self.template % params
         filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
+
         settings.COMPRESS_URL = params['url'] = 'http://media.example.com/'
+        output = self.template % params
         filter = CssAbsoluteFilter(content)
-        filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
-        output = "p { background: url('%(url)simg/python.png?foo&%(hash)s') }" % params
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
 
     def test_css_absolute_filter_https(self):
         filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
         imagefilename = os.path.join(settings.COMPRESS_ROOT, 'img/python.png')
-        params = {
+        content = self.template % blankdict(url='../../')
+        params = blankdict({
             'url': settings.COMPRESS_URL,
-            'hash': self.hashing_func(imagefilename),
-        }
-        output = ("p { background: url('%(url)simg/python.png?%(hash)s') }"
-                  "p { filter: Alpha(src='%(url)simg/python.png?%(hash)s') }") % params
-        filter = CssAbsoluteFilter(self.content)
+            'hash': '?' + self.hashing_func(imagefilename),
+        })
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
+
         settings.COMPRESS_URL = params['url'] = 'https://static.example.com/'
-        filter = CssAbsoluteFilter(self.content)
-        filename = os.path.join(settings.COMPRESS_ROOT, 'css/url/test.css')
-        output = ("p { background: url('%(url)simg/python.png?%(hash)s') }"
-                  "p { filter: Alpha(src='%(url)simg/python.png?%(hash)s') }") % params
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
 
     def test_css_absolute_filter_relative_path(self):
         filename = os.path.join(settings.TEST_DIR, 'whatever', '..', 'static', 'whatever/../css/url/test.css')
         imagefilename = os.path.join(settings.COMPRESS_ROOT, 'img/python.png')
-        params = {
+        content = self.template % blankdict(url='../../')
+        params = blankdict({
             'url': settings.COMPRESS_URL,
-            'hash': self.hashing_func(imagefilename),
-        }
-        output = ("p { background: url('%(url)simg/python.png?%(hash)s') }"
-                  "p { filter: Alpha(src='%(url)simg/python.png?%(hash)s') }") % params
-        filter = CssAbsoluteFilter(self.content)
+            'hash': '?' + self.hashing_func(imagefilename),
+        })
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
+
         settings.COMPRESS_URL = params['url'] = 'https://static.example.com/'
-        filter = CssAbsoluteFilter(self.content)
-        output = ("p { background: url('%(url)simg/python.png?%(hash)s') }"
-                  "p { filter: Alpha(src='%(url)simg/python.png?%(hash)s') }") % params
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
         self.assertEqual(output, filter.input(filename=filename, basename='css/url/test.css'))
 
+    def test_css_absolute_filter_filename_outside_compress_root(self):
+        filename = '/foo/bar/baz/test.css'
+        content = self.template % blankdict(url='../qux/')
+        params = blankdict({
+            'url': settings.COMPRESS_URL + 'bar/qux/',
+        })
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
+        self.assertEqual(output, filter.input(filename=filename, basename='bar/baz/test.css'))
+        settings.COMPRESS_URL = 'https://static.example.com/'
+        params['url'] = settings.COMPRESS_URL + 'bar/qux/'
+        output = self.template % params
+        filter = CssAbsoluteFilter(content)
+        self.assertEqual(output, filter.input(filename=filename, basename='bar/baz/test.css'))
+
     def test_css_hunks(self):
         hash_dict = {
             'hash1': self.hashing_func(os.path.join(settings.COMPRESS_ROOT, 'img/python.png')),
@@ -253,14 +302,6 @@ class CssAbsolutizingTestCaseWithHash(CssAbsolutizingTestCase):
     hashing_method = 'content'
     hashing_func = staticmethod(get_hashed_content)
 
-    def setUp(self):
-        super(CssAbsolutizingTestCaseWithHash, self).setUp()
-        self.css = """
-        <link rel="stylesheet" href="/static/css/url/url1.css" type="text/css" charset="utf-8">
-        <link rel="stylesheet" href="/static/css/url/2/url2.css" type="text/css" charset="utf-8">
-        """
-        self.css_node = CssCompressor(self.css)
-
 
 class CssDataUriTestCase(TestCase):
     def setUp(self):
@@ -301,3 +342,38 @@ class TemplateTestCase(TestCase):
         #footer {font-weight: bold;}
         """
         self.assertEqual(input, TemplateFilter(content).input())
+
+
+class SpecializedFiltersTest(TestCase):
+    """
+    Test to check the Specializations of filters.
+    """
+    def test_closure_filter(self):
+        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')
+        self.assertEqual(filter.options, (('binary', six.text_type('yuglify')), ('args', six.text_type('--terminal'))))
+
+        filter = YUglifyJSFilter('')
+        self.assertEqual(filter.command, '{binary} {args} --type=js')
+        self.assertEqual(filter.options, (('binary', six.text_type('yuglify')), ('args', six.text_type('--terminal'))))
+
+    def test_yui_filters(self):
+        filter = YUICSSFilter('')
+        self.assertEqual(filter.command, '{binary} {args} --type=css')
+        self.assertEqual(filter.options, (('binary', six.text_type('java -jar yuicompressor.jar')), ('args', six.text_type(''))))
+
+        filter = YUIJSFilter('', verbose=1)
+        self.assertEqual(filter.command, '{binary} {args} --type=js --verbose')
+        self.assertEqual(filter.options, (('binary', six.text_type('java -jar yuicompressor.jar')), ('args', six.text_type('')), ('verbose', 1)))
+
+    def test_clean_css_filter(self):
+        filter = CleanCSSFilter('')
+        self.assertEqual(filter.options, (('binary', six.text_type('cleancss')), ('args', six.text_type(''))))
similarity index 99%
rename from django-compressor/compressor/tests/test_jinja2ext.py
rename to python-django-compressor/compressor/tests/test_jinja2ext.py
index 5adc8ee8baf52c6564303f8608a5060450ce51d6..04adb9a3b674a912651e5bb2b266064a7638e24c 100644 (file)
@@ -65,8 +65,7 @@ class TestJinja2CompressorExtension(TestCase):
         self.assertEqual(tag_body, template.render())
 
     def test_empty_tag(self):
-        template = self.env.from_string("""{% compress js %}{% block js %}
-        {% endblock %}{% endcompress %}""")
+        template = self.env.from_string("""{% compress js %}{% block js %}{% endblock %}{% endcompress %}""")
         context = {'STATIC_URL': settings.COMPRESS_URL}
         self.assertEqual('', template.render(context))
 
similarity index 95%
rename from django-compressor/compressor/tests/test_offline.py
rename to python-django-compressor/compressor/tests/test_offline.py
index 327b9012398148536ff2eca9bd1cf5e685b1f020..59a3d62085b297d2b9c9fdc6e291783270353173 100644 (file)
@@ -3,6 +3,7 @@ import io
 import os
 import sys
 
+import django
 from django.core.management.base import CommandError
 from django.template import Template, Context
 from django.test import TestCase
@@ -44,10 +45,6 @@ class OfflineTestCaseMixin(object):
         engines = ("django",)
 
     def setUp(self):
-        self._old_compress = settings.COMPRESS_ENABLED
-        self._old_compress_offline = settings.COMPRESS_OFFLINE
-        self._old_template_dirs = settings.TEMPLATE_DIRS
-        self._old_offline_context = settings.COMPRESS_OFFLINE_CONTEXT
         self.log = StringIO()
 
         # Reset template dirs, because it enables us to force compress to
@@ -58,11 +55,18 @@ class OfflineTestCaseMixin(object):
         # template to be skipped over.
         django_template_dir = os.path.join(settings.TEST_DIR, 'test_templates', self.templates_dir)
         jinja2_template_dir = os.path.join(settings.TEST_DIR, 'test_templates_jinja2', self.templates_dir)
-        settings.TEMPLATE_DIRS = (django_template_dir, jinja2_template_dir)
 
-        # Enable offline compress
-        settings.COMPRESS_ENABLED = True
-        settings.COMPRESS_OFFLINE = True
+        override_settings = {
+            'TEMPLATE_DIRS': (django_template_dir, jinja2_template_dir,),
+            'COMPRESS_ENABLED': True,
+            'COMPRESS_OFFLINE': True
+        }
+
+        if "jinja2" in self.engines:
+            override_settings["COMPRESS_JINJA2_GET_ENVIRONMENT"] = lambda: self._get_jinja2_env()
+
+        self.override_settings = self.settings(**override_settings)
+        self.override_settings.__enter__()
 
         if "django" in self.engines:
             self.template_path = os.path.join(django_template_dir, self.template_name)
@@ -70,22 +74,16 @@ class OfflineTestCaseMixin(object):
             with io.open(self.template_path, encoding=settings.FILE_CHARSET) as file:
                 self.template = Template(file.read())
 
-        self._old_jinja2_get_environment = settings.COMPRESS_JINJA2_GET_ENVIRONMENT
-
         if "jinja2" in self.engines:
-            # Setup Jinja2 settings.
-            settings.COMPRESS_JINJA2_GET_ENVIRONMENT = lambda: self._get_jinja2_env()
-            jinja2_env = settings.COMPRESS_JINJA2_GET_ENVIRONMENT()
+            jinja2_env = override_settings["COMPRESS_JINJA2_GET_ENVIRONMENT"]()
             self.template_path_jinja2 = os.path.join(jinja2_template_dir, self.template_name)
 
             with io.open(self.template_path_jinja2, encoding=settings.FILE_CHARSET) as file:
                 self.template_jinja2 = jinja2_env.from_string(file.read())
 
     def tearDown(self):
-        settings.COMPRESS_JINJA2_GET_ENVIRONMENT = self._old_jinja2_get_environment
-        settings.COMPRESS_ENABLED = self._old_compress
-        settings.COMPRESS_OFFLINE = self._old_compress_offline
-        settings.TEMPLATE_DIRS = self._old_template_dirs
+        self.override_settings.__exit__(None, None, None)
+
         manifest_path = os.path.join('CACHE', 'manifest.json')
         if default_storage.exists(manifest_path):
             default_storage.delete(manifest_path)
@@ -454,6 +452,8 @@ class OfflineGenerationComplexTestCase(OfflineTestCaseMixin, TestCase):
 # It seems there is no evidence nor indicated support for Python 3+.
 @unittest.skipIf(sys.version_info >= (3, 2),
     "Coffin does not support 3.2+")
+@unittest.skipIf(django.VERSION >= (1, 8),
+    "Import error on 1.8")
 class OfflineGenerationCoffinTestCase(OfflineTestCaseMixin, TestCase):
     templates_dir = "test_coffin"
     expected_hash = "32c8281e3346"
@@ -478,6 +478,8 @@ class OfflineGenerationCoffinTestCase(OfflineTestCaseMixin, TestCase):
 # is also evident in its tox.ini file.
 @unittest.skipIf(sys.version_info >= (3, 2) and sys.version_info < (3, 3),
     "Jingo does not support 3.2")
+@unittest.skipIf(django.VERSION >= (1, 8),
+    "Import error on 1.8")
 class OfflineGenerationJingoTestCase(OfflineTestCaseMixin, TestCase):
     templates_dir = "test_jingo"
     expected_hash = "61ec584468eb"
@@ -5,4 +5,9 @@
     <script type="text/javascript">
         alert("this alert shouldn't be alone!");
     </script>
+    {% block orphan %}
+        {{ block.super }}
+        An 'orphan' block that refers to a non-existent super block.
+        Contents of this block are ignored.
+    {% endblock %}
 {% endspaceless %}{% endblock %}
diff --git a/python-django-compressor/compressor/utils/staticfiles.py b/python-django-compressor/compressor/utils/staticfiles.py
new file mode 100644 (file)
index 0000000..2d9ed00
--- /dev/null
@@ -0,0 +1,17 @@
+from __future__ import absolute_import, unicode_literals
+
+from django.core.exceptions import ImproperlyConfigured
+
+from compressor.conf import settings
+
+if "django.contrib.staticfiles" in settings.INSTALLED_APPS:
+    from django.contrib.staticfiles import finders  # noqa
+
+    if ("compressor.finders.CompressorFinder"
+            not in settings.STATICFILES_FINDERS):
+        raise ImproperlyConfigured(
+            "When using Django Compressor together with staticfiles, "
+            "please add 'compressor.finders.CompressorFinder' to the "
+            "STATICFILES_FINDERS setting.")
+else:
+    finders = None  # noqa
similarity index 91%
rename from django-compressor/docs/changelog.txt
rename to python-django-compressor/docs/changelog.txt
index 3828197a0d87db42688ea8f95d0bbd06d0ae0738..07864df093753b7a428e7069b14f6479dc0604f3 100644 (file)
@@ -1,12 +1,46 @@
 Changelog
 =========
 
-v1.4
-----
+v1.5 (03/27/2015)
+-----------------
+
+`Full Changelog <https://github.com/django-compressor/django-compressor/compare/1.4...HEAD>`_
+
+- Fix compress command and run automated tests for Django 1.8
+
+- Fix Django 1.8 warnings
+
+- Handle TypeError from import_module
+
+- Fix reading UTF-8 files which have BOM
+
+- Fix incompatibility with Windows (shell_quote is not supported)
+
+- Run automated tests on Django 1.7
+
+- Ignore non-existent {{ block.super }} in offline compression instead of raising AttributeError
+
+- Support for clean-css
+
+- Fix link markup
+
+- Add support for COMPRESS_CSS_HASHING_METHOD = None
+
+- Remove compatibility with old 'staticfiles' app
+
+- In compress command, use get_template() instead of opening template files manually, fixing compatibility issues with custom template loaders
+
+- Fix FilterBase so that does not override self.type for subclasses if filter_type is not specified at init
+
+- Remove unnecessary filename and existence checks in CssAbsoluteFilter
+
+
+v1.4 (06/20/2014)
+-----------------
 
 - Added Python 3 compatibility.
 
-- Added compatibility with Django 1.6.x.
+- Added compatibility with Django 1.6.x and dropped support for Django 1.3.X.
 
 - Fixed compatibility with html5lib 1.0.
 
@@ -46,7 +80,7 @@ v1.3 (03/18/2013)
   -  Dropped support for Python 2.5. Removed ``any`` and ``walk`` compatibility
      functions in ``compressor.utils``.
 
-  - Removed compatibility with Django 1.2 for default values of some settings:
+  - Removed compatibility with some old django setttings:
 
     - :attr:`~COMPRESS_ROOT` no longer uses ``MEDIA_ROOT`` if ``STATIC_ROOT`` is
       not defined. It expects ``STATIC_ROOT`` to be defined instead.
similarity index 97%
rename from django-compressor/docs/contributing.txt
rename to python-django-compressor/docs/contributing.txt
index 225a1ae1bb7c3752bb72b1b46dedbb28c187d371..8f0cd50427921db0121f0c9b8e8068f78d6330b0 100644 (file)
@@ -9,11 +9,12 @@ tidy, everybody has to follow a few rules (nothing major, I promise :) )
 Community
 ---------
 
-People interested in developing for the Django Compressor should head
-over to #django-compressor on the `freenode`_ IRC network for help and to
+People interested in developing for the Django Compressor should:
+
+1. Head over to #django-compressor on the `freenode`_ IRC network for help and to
 discuss the development.
+2. Open an issue on GitHub explaining your ideas.
 
-You may also be interested in following `@jezdez`_ on Twitter.
 
 In a nutshell
 -------------
@@ -143,7 +144,7 @@ Documentation should be:
 - Accessible. You should assume the reader to be moderately familiar with
   Python and Django, but not anything else. Link to documentation of libraries
   you use, for example, even if they are "obvious" to you. A brief
-  description of what it does is also welcome. 
+  description of what it does is also welcome.
 
 Pulling of documentation is pretty fast and painless. Usually somebody goes
 over your text and merges it, since there are no "breaks" and that github
similarity index 60%
rename from django-compressor/docs/django-sekizai.txt
rename to python-django-compressor/docs/django-sekizai.txt
index 6fd80c9b59939eda44eb7a29f12ed37ef3f8ad5d..ab70b1744fb064dd675698549cc9e5d6d57afe72 100644 (file)
@@ -3,12 +3,12 @@
 django-sekizai Support
 ======================
 
-Django Compressor comes with support for _django-sekizai via an extension.
-_django-sekizai provides the ability to include template code, from within
+Django Compressor comes with support for django-sekizai_ via an extension.
+django-sekizai provides the ability to include template code, from within
 any block, to a parent block. It is primarily used to include js/css from
 included templates to the master template.
 
-It requires _django-sekizai to installed. Refer to the _django-sekizai _docs
+It requires django-sekizai to be installed. Refer to the `django-sekizai docs`_
 for how to use ``render_block``
 
 Usage
@@ -21,4 +21,4 @@ Usage
 
 
 .. _django-sekizai: https://github.com/ojii/django-sekizai
-.. _docs: http://django-sekizai.readthedocs.org/en/latest/
+.. _django-sekizai docs: http://django-sekizai.readthedocs.org/en/latest/
similarity index 94%
rename from django-compressor/docs/jinja2.txt
rename to python-django-compressor/docs/jinja2.txt
index 134b0b8d598f06f2aea7b02685c9f3e6a11c6a39..f4922792ab117e7b562c7228fa56ee48d1a6b233 100644 (file)
@@ -42,13 +42,13 @@ Jinja2 Offline Compression Support
 ==================================
 You'd need to configure ``COMPRESS_JINJA2_GET_ENVIRONMENT`` so that
 Compressor can retrieve the Jinja2 environment for rendering.
-This can be a lamda or function that returns a Jinja2 environment.
+This can be a lambda or function that returns a Jinja2 environment.
 
 Usage
 -----
-Run the following compress command along with an ``-engine`` parameter. The
+Run the following compress command along with an ``--engine`` parameter. The
 parameter can be either jinja2 or django (default). For example,
-"./manage.py compress -engine jinja2".
+``./manage.py compress --engine jinja2``.
 
 Using both Django and Jinja2 templates
 --------------------------------------
@@ -60,9 +60,9 @@ template safely. (Vice versa for Django parser).
 
 A typical usage could be :
 
-- "./manage.py compress" for processing Django templates first, skipping
+- ``./manage.py compress`` for processing Django templates first, skipping
   Jinja2 templates.
-- "./manage.py compress -engine jinja2" for processing Jinja2 templates,
+- ``./manage.py compress --engine jinja2`` for processing Jinja2 templates,
   skipping Django templates.
 
 However, it is still recommended that you do not mix Django and Jinja2
@@ -172,4 +172,3 @@ Jinja2 alone (with custom loader) are tested and work on Python 2.6, 2.7 and
 .. _Jinja2: http://jinja.pocoo.org/docs/
 .. _Coffin: http://pypi.python.org/pypi/Coffin
 .. _Jingo: https://jingo.readthedocs.org/en/latest/
-
similarity index 89%
rename from django-compressor/docs/quickstart.txt
rename to python-django-compressor/docs/quickstart.txt
index 4acfab2d2b7cd0631de705bb80611fceb76a0b87..00931ea4198d5aaa109baaa5b6fcccf8f6d84b44 100644 (file)
@@ -18,10 +18,8 @@ Installation
 * See the list of :ref:`settings` to modify Django Compressor's
   default behaviour and make adjustments for your website.
 
-* In case you use Django's staticfiles_ contrib app (or its standalone
-  counterpart django-staticfiles_) you have to add Django Compressor's file
-  finder to the ``STATICFILES_FINDERS`` setting, for example with
-  ``django.contrib.staticfiles``:
+* In case you use Django's staticfiles_ contrib app you have to add Django
+  Compressor's file finder to the ``STATICFILES_FINDERS`` setting, like this:
 
   .. code-block:: python
 
@@ -95,6 +93,6 @@ Optional
 .. _lxml: http://codespeak.net/lxml/
 .. _libxml2: http://xmlsoft.org/
 .. _html5lib: http://code.google.com/p/html5lib/
-.. _`Slim It`: http://slimit.org/
+.. _`Slim It`: https://github.com/rspivak/slimit
 .. _django-appconf: http://pypi.python.org/pypi/django-appconf/
 .. _versiontools: http://pypi.python.org/pypi/versiontools/
similarity index 88%
rename from django-compressor/docs/remote-storages.txt
rename to python-django-compressor/docs/remote-storages.txt
index 91e7c2e92a6273fc6a35568c3dbf4a9a922ab3b3..8af6934855b5d98978cc05d6488e4741d6b54da4 100644 (file)
@@ -39,12 +39,11 @@ The storage backend to save the compressed files needs to be changed, too::
 Using staticfiles
 ^^^^^^^^^^^^^^^^^
 
-If you are using Django's staticfiles_ contrib app or the standalone
-app django-staticfiles_, you'll need to use a temporary filesystem cache
-for Django Compressor to know which files to compress. Since staticfiles
-provides a management command to collect static files from various
-locations which uses a storage backend, this is where both apps can be
-integrated.
+If you are using Django's staticfiles_ contrib app, you'll need to use a
+temporary filesystem cache for Django Compressor to know which files to
+compress. Since staticfiles provides a management command to collect static
+files from various locations which uses a storage backend, this is where both
+apps can be integrated.
 
 #. Make sure the :attr:`~django.conf.settings.COMPRESS_ROOT` and STATIC_ROOT_
    settings are equal since both apps need to look at the same directories
@@ -84,7 +83,6 @@ integrated.
 .. _Amazon S3: https://s3.amazonaws.com/
 .. _boto: http://boto.cloudhackers.com/
 .. _django-storages: http://code.welldev.org/django-storages/
-.. _django-staticfiles: http://github.com/jezdez/django-staticfiles/
 .. _staticfiles: http://docs.djangoproject.com/en/dev/howto/static-files/
 .. _STATIC_ROOT: http://docs.djangoproject.com/en/dev/ref/settings/#static-root
 .. _STATIC_URL: http://docs.djangoproject.com/en/dev/ref/settings/#static-url
similarity index 94%
rename from django-compressor/docs/settings.txt
rename to python-django-compressor/docs/settings.txt
index 0d3fd72abd4835bd4ff57d1fd94ab75c9b10fef2..268f6455d0dac87b449d279e1958661125fecf98 100644 (file)
@@ -81,10 +81,11 @@ Backend settings
 
       .. attribute:: COMPRESS_CSS_HASHING_METHOD
 
-         The method to use when calculating the hash to append to
-         processed URLs. Either ``'mtime'`` (default) or ``'content'``.
-         Use the latter in case you're using multiple server to serve your
-         static files.
+         The method to use when calculating the suffix to append to URLs in
+         your processed CSS files. Either ``None``, ``'mtime'`` (default) or
+         ``'content'``. Use the ``None`` if you want to completely disable that
+         feature, and the ``'content'`` in case you're using multiple servers
+         to serve your content.
 
     - ``compressor.filters.csstidy.CSSTidyFilter``
 
@@ -136,9 +137,24 @@ Backend settings
       A filter that uses Zachary Voase's Python port of the YUI CSS compression
       algorithm cssmin_.
 
+    - ``compressor.filters.cleancss.CleanCSSFilter``
+
+      A filter that passes the CSS content to the `clean-css`_ tool.
+
+      .. attribute:: CLEAN_CSS_BINARY
+
+         The clean-css binary filesystem path.
+
+      .. attribute:: CLEAN_CSS_ARGUMENTS
+
+         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/
+    .. _`clean-css`: https://github.com/GoalSmashers/clean-css/
+
 
     - ``compressor.filters.template.TemplateFilter``
 
@@ -220,7 +236,7 @@ Backend settings
     .. _`Google Closure compiler`: http://code.google.com/closure/compiler/
     .. _`YUI compressor`: http://developer.yahoo.com/yui/compressor/
     .. _`yUglify compressor`: https://github.com/yui/yuglify
-    .. _`Slim It`: http://slimit.org/
+    .. _`Slim It`: https://github.com/rspivak/slimit
 
 .. attribute:: COMPRESS_PRECOMPILERS
 
@@ -305,7 +321,7 @@ Backend settings
         <link rel="stylesheet" href="/static/CACHE/css/8ccf8d877f18.css" type="text/css" charset="utf-8">
 
     .. _less: http://lesscss.org/
-    .. _CoffeeScript: http://jashkenas.github.com/coffee-script/
+    .. _CoffeeScript: http://coffeescript.org/
 
 .. attribute:: COMPRESS_STORAGE
 
similarity index 98%
rename from django-compressor/docs/usage.txt
rename to python-django-compressor/docs/usage.txt
index 3e18a8f22dfb46cebdaac960c8348fc6e47ebcb3..5bf665e4b4b9db1a8cfe7bba9dcf13be96e3b599 100644 (file)
@@ -48,7 +48,7 @@ Which would be rendered something like:
 
 .. note::
 
-    Remember that django-compressor will try to :ref:`group ouputs by media <css_notes>`.
+    Remember that django-compressor will try to :ref:`group outputs by media <css_notes>`.
 
 Linked files **must** be accessible via
 :attr:`~django.conf.settings.COMPRESS_URL`.
diff --git a/python-django-compressor/setup.cfg b/python-django-compressor/setup.cfg
new file mode 100644 (file)
index 0000000..5e40900
--- /dev/null
@@ -0,0 +1,2 @@
+[wheel]
+universal = 1
diff --git a/python-django-compressor/tox.ini b/python-django-compressor/tox.ini
new file mode 100644 (file)
index 0000000..78d6039
--- /dev/null
@@ -0,0 +1,66 @@
+[deps]
+two =
+    flake8
+    coverage
+    html5lib
+    mock
+    jinja2
+    lxml
+    BeautifulSoup
+    unittest2
+    jingo
+    coffin
+three =
+    flake8
+    coverage
+    html5lib
+    mock
+    jinja2
+    lxml
+    BeautifulSoup4
+    jingo
+    coffin
+three_two =
+    flake8
+    coverage
+    html5lib
+    mock
+    jinja2==2.6
+    lxml
+    BeautifulSoup4
+    jingo
+    coffin
+
+[tox]
+envlist =
+    {py26,py27}-{1.4.X,1.5.X},
+    {py26,py27,py32,py33}-{1.6.X},
+    {py27,py32,py33,py34}-{1.7.X},
+    {py27,py32,py33,py34}-{1.8.X}
+[testenv]
+basepython =
+    py26: python2.6
+    py27: python2.7
+    py32: python3.2
+    py33: python3.3
+    py34: python3.4
+usedevelop = true
+setenv =
+    CPPFLAGS=-O0
+whitelist_externals = /usr/bin/make
+downloadcache = {toxworkdir}/_download/
+commands =
+    django-admin.py --version
+    make test
+deps =
+    1.4.X: Django>=1.4,<1.5
+    1.5.X: Django>=1.5,<1.6
+    1.6.X: Django>=1.6,<1.7
+    1.7.X: Django>=1.7,<1.8
+    1.8.X: Django>=1.8,<1.9
+    py26: {[deps]two}
+    py27: {[deps]two}
+    py32: {[deps]three_two}
+    py33: {[deps]three}
+    py34: {[deps]three}
+    django-discover-runner