Products.CMFPlone/cssmin_relacement: replaced cssmin with PyScss for css compression.
Alexander Loechel <jenkins-z4DKO/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Repository: Products.CMFPlone Branch: refs/heads/cssmin_relacement Date: 2017-07-16T22:59:18+02:00 Author: Alexander Loechel (loechel) <[email protected]> Commit: https://github.com/plone/Products.CMFPlone/commit/34fc51b24c379f1e39def863ea79819398ef243f replaced cssmin with PyScss for css compression. Files changed: M CHANGES.rst M Products/CMFPlone/resources/browser/cook.py M setup.py diff --git a/CHANGES.rst b/CHANGES.rst index f3e5743db..f5ac11dd3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,7 +10,11 @@ Changelog Breaking changes: -- *add item here* +- Replaced cssmin with PyScss to ensure Python 3 compatibility and maintainability. + Removed dependency to cssmin, so could break dependency for third party addons that depend on it. + Introduced PyScss as a drop in replacement that could also do more things. + Discussion on that at https://github.com/plone/Products.CMFPlone/issues/1800 + [loechel] New features: @@ -41,7 +45,7 @@ Bug fixes: - fixed css-classes for thumb scales ... https://github.com/plone/Products.CMFPlone/issues/2077 [fgrcon] - + - Fix current value in group details edit form. [Gagaro] @@ -104,7 +108,7 @@ Bug fixes: [jensens] - Fix possible ``mechanize.AmbiguityError`` in controlpanel tests. - [jensens] + [jensens] 5.1b3 (2017-04-03) ------------------ diff --git a/Products/CMFPlone/resources/browser/cook.py b/Products/CMFPlone/resources/browser/cook.py index 545fdc2c9..75f36a950 100644 --- a/Products/CMFPlone/resources/browser/cook.py +++ b/Products/CMFPlone/resources/browser/cook.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from cssmin import cssmin from datetime import datetime from plone.protect.interfaces import IDisableCSRFProtection from plone.registry.interfaces import IRegistry @@ -9,6 +8,7 @@ from Products.CMFPlone.interfaces.resources import IResourceRegistry from Products.CMFPlone.interfaces.resources import OVERRIDE_RESOURCE_DIRECTORY_NAME # noqa from Products.CMFPlone.resources.browser.combine import combine_bundles +from PyScss import compiler from slimit import minify from StringIO import StringIO from zExceptions import NotFound @@ -76,6 +76,7 @@ def cookWhenChangingSettings(context, bundle=None): return # Let's join all css and js + css_compiler = Compiler(output_style='compressed') cooked_css = '' cooked_js = REQUIREJS_RESET_PREFIX siteUrl = getSite().absolute_url() @@ -94,7 +95,7 @@ def cookWhenChangingSettings(context, bundle=None): css = response.getBody() cooked_css += '\n/* Resource: {0} */\n{1}\n'.format( css_resource, - css if '.min.css' == css_resource[-8:] else cssmin(css) + css if '.min.css' == css_resource[-8:] else css_compiler.compile_string(css) # NOQA: E501 ) else: cooked_css +=\ diff --git a/setup.py b/setup.py index 012d4b9e9..76e8e4f9e 100644 --- a/setup.py +++ b/setup.py @@ -69,10 +69,10 @@ 'Products.ResourceRegistries', 'Products.contentmigration', 'Products.statusmessages', + 'PyScss', 'ZODB3', 'Zope2 > 2.13.0', 'borg.localrole', - 'cssmin', 'five.customerize', 'five.localsitemanager', 'five.pt', ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot