From 6ba60d6d8e67994ba552e51731191f4e098f497d Mon Sep 17 00:00:00 2001 From: tisto Date: Sat, 30 May 2015 13:52:11 +0200 Subject: [PATCH] [fc] Repository: Products.PortalTransforms Branch: refs/heads/master Date: 2015-05-29T13:41:22Z Author: Tom Gross (tomgross) Commit: https://github.com/plone/Products.PortalTransforms/commit/df2de9c1759e43588ab07a7ffc491e66707e8d30 remove CMFDefault dependency Files changed: M Products/PortalTransforms/transforms/html_body.py M Products/PortalTransforms/transforms/pdf_to_html.py M Products/PortalTransforms/transforms/rtf_to_html.py M Products/PortalTransforms/transforms/safe_html.py Repository: Products.PortalTransforms Branch: refs/heads/master Date: 2015-05-29T13:42:00Z Author: Tom Gross (tomgross) Commit: https://github.com/plone/Products.PortalTransforms/commit/d4749b60adacf12f03eed1def39407098fb0c5f6 document changes and remove egg dependency on CMFDefault Files changed: M CHANGES.rst M setup.py Repository: Products.PortalTransforms Branch: refs/heads/master Date: 2015-05-30T13:52:11+02:00 Author: Timo Stollenwerk (tisto) Commit: https://github.com/plone/Products.PortalTransforms/commit/070647cfcfc891a9c819481f94c67d75c31ad85f Merge pull request #8 from plone/tomgross-nocmfdefault2 Removed CMFDefault dependency Files changed: M CHANGES.rst M Products/PortalTransforms/transforms/html_body.py M Products/PortalTransforms/transforms/pdf_to_html.py M Products/PortalTransforms/transforms/rtf_to_html.py M Products/PortalTransforms/transforms/safe_html.py M setup.py --- last_commit.txt | 428 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 336 insertions(+), 92 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 7e684282c3..82f9d5ae3f 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,132 +1,376 @@ -Repository: plone.app.upgrade +Repository: Products.PortalTransforms Branch: refs/heads/master -Date: 2015-05-29T12:14:55Z +Date: 2015-05-29T13:41:22Z Author: Tom Gross (tomgross) -Commit: https://github.com/plone/plone.app.upgrade/commit/647d32822b98ce2f607b9e7fb3f83d76b8e844ea +Commit: https://github.com/plone/Products.PortalTransforms/commit/df2de9c1759e43588ab07a7ffc491e66707e8d30 -conditionally exclude upgrade step with CMFDefault dependency +remove CMFDefault dependency Files changed: -M CHANGES.rst -M plone/app/upgrade/v40/configure.zcml +M Products/PortalTransforms/transforms/html_body.py +M Products/PortalTransforms/transforms/pdf_to_html.py +M Products/PortalTransforms/transforms/rtf_to_html.py +M Products/PortalTransforms/transforms/safe_html.py -diff --git a/CHANGES.rst b/CHANGES.rst -index 542501e..fab7196 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -7,6 +7,8 @@ Changelog - - Plone 5: upgrade manage portlets js - [vangheem] +diff --git a/Products/PortalTransforms/transforms/html_body.py b/Products/PortalTransforms/transforms/html_body.py +index e03fdaa..78181ab 100644 +--- a/Products/PortalTransforms/transforms/html_body.py ++++ b/Products/PortalTransforms/transforms/html_body.py +@@ -1,6 +1,6 @@ + from Products.PortalTransforms.interfaces import ITransform + from zope.interface import implements +-from Products.CMFDefault.utils import bodyfinder ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + + + class HTMLBody: +diff --git a/Products/PortalTransforms/transforms/pdf_to_html.py b/Products/PortalTransforms/transforms/pdf_to_html.py +index 8c6159d..27f9f24 100644 +--- a/Products/PortalTransforms/transforms/pdf_to_html.py ++++ b/Products/PortalTransforms/transforms/pdf_to_html.py +@@ -7,7 +7,7 @@ + from Products.PortalTransforms.libtransforms.utils import sansext + from Products.PortalTransforms.libtransforms.commandtransform import ( + commandtransform, popentransform) +-from Products.CMFDefault.utils import bodyfinder ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + import os + + +diff --git a/Products/PortalTransforms/transforms/rtf_to_html.py b/Products/PortalTransforms/transforms/rtf_to_html.py +index cb50d20..7df9d68 100644 +--- a/Products/PortalTransforms/transforms/rtf_to_html.py ++++ b/Products/PortalTransforms/transforms/rtf_to_html.py +@@ -5,9 +5,9 @@ + from Products.PortalTransforms.interfaces import ITransform + from zope.interface import implements + from Products.PortalTransforms.libtransforms.utils import sansext ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + from Products.PortalTransforms.libtransforms.commandtransform import \ + commandtransform +-from Products.CMFDefault.utils import bodyfinder + import os -+- Remove hard dependency on CMFDefault -+ [tomgross] - 1.3.10 (2015-05-13) - ------------------- -diff --git a/plone/app/upgrade/v40/configure.zcml b/plone/app/upgrade/v40/configure.zcml -index 6437c40..a51e4d6 100644 ---- a/plone/app/upgrade/v40/configure.zcml -+++ b/plone/app/upgrade/v40/configure.zcml -@@ -1,5 +1,6 @@ - - -@@ -169,6 +170,7 @@ - profile="Products.CMFPlone:plone"> - - - - -Repository: plone.app.upgrade +diff --git a/Products/PortalTransforms/transforms/safe_html.py b/Products/PortalTransforms/transforms/safe_html.py +index 255a878..e5e243c 100644 +--- a/Products/PortalTransforms/transforms/safe_html.py ++++ b/Products/PortalTransforms/transforms/safe_html.py +@@ -6,17 +6,74 @@ + from Products.PortalTransforms.interfaces import ITransform + from zope.interface import implements + from Products.PortalTransforms.utils import log +-from Products.CMFDefault.utils import bodyfinder +-from Products.CMFDefault.utils import IllegalHTML +-from Products.CMFDefault.utils import VALID_TAGS +-from Products.CMFDefault.utils import NASTY_TAGS ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + from Products.PortalTransforms.utils import safeToInt + +-# tag mapping: tag -> short or long tag +-VALID_TAGS = VALID_TAGS.copy() +-NASTY_TAGS = NASTY_TAGS.copy() ++class IllegalHTML(ValueError): ++ """ Illegal HTML error. ++ """ ++ ++ ++# These are the HTML tags that we will leave intact ++VALID_TAGS = { 'a' : 1 ++ , 'b' : 1 ++ , 'base' : 0 ++ , 'big' : 1 ++ , 'blockquote' : 1 ++ , 'body' : 1 ++ , 'br' : 0 ++ , 'caption' : 1 ++ , 'cite' : 1 ++ , 'code' : 1 ++ , 'dd' : 1 ++ , 'div' : 1 ++ , 'dl' : 1 ++ , 'dt' : 1 ++ , 'em' : 1 ++ , 'h1' : 1 ++ , 'h2' : 1 ++ , 'h3' : 1 ++ , 'h4' : 1 ++ , 'h5' : 1 ++ , 'h6' : 1 ++ , 'head' : 1 ++ , 'hr' : 0 ++ , 'html' : 1 ++ , 'i' : 1 ++ , 'img' : 0 ++ , 'kbd' : 1 ++ , 'li' : 1 ++ # , 'link' : 1 type="script" hoses us ++ , 'meta' : 0 ++ , 'ol' : 1 ++ , 'p' : 1 ++ , 'pre' : 1 ++ , 'small' : 1 ++ , 'span' : 1 ++ , 'strong' : 1 ++ , 'sub' : 1 ++ , 'sup' : 1 ++ , 'table' : 1 ++ , 'tbody' : 1 ++ , 'td' : 1 ++ , 'th' : 1 ++ , 'title' : 1 ++ , 'tr' : 1 ++ , 'tt' : 1 ++ , 'u' : 1 ++ , 'ul' : 1 ++ } ++ ++NASTY_TAGS = { 'script' : 1 ++ , 'object' : 1 ++ , 'embed' : 1 ++ , 'applet' : 1 ++ , 'style' : 1 # this helps improve Word HTML cleanup. ++ , 'meta' : 1 # allowed by parsers, but can cause unexpected behavior ++ } ++ + +-# add some tags to allowed types. These should be backported to CMFDefault. ++# add some tags to allowed types. + VALID_TAGS['ins'] = 1 + VALID_TAGS['del'] = 1 + VALID_TAGS['q'] = 1 +@@ -61,9 +118,6 @@ + VALID_TAGS['time'] = 1 + VALID_TAGS['video'] = 1 + +-# add some tags to nasty. +-NASTY_TAGS['style'] = 1 # this helps improve Word HTML cleanup. +-NASTY_TAGS['meta'] = 1 # allowed by parsers, but can cause unexpected behavior + + + msg_pat = """ + + +Repository: Products.PortalTransforms Branch: refs/heads/master -Date: 2015-05-29T12:20:03Z +Date: 2015-05-29T13:42:00Z Author: Tom Gross (tomgross) -Commit: https://github.com/plone/plone.app.upgrade/commit/008f09a4bacfe2b1b0a11366c9894f973f9e40ea +Commit: https://github.com/plone/Products.PortalTransforms/commit/d4749b60adacf12f03eed1def39407098fb0c5f6 -remove CMFDefault as install dependency +document changes and remove egg dependency on CMFDefault Files changed: +M CHANGES.rst M setup.py +diff --git a/CHANGES.rst b/CHANGES.rst +index f1dee22..8450ec6 100644 +--- a/CHANGES.rst ++++ b/CHANGES.rst +@@ -4,7 +4,8 @@ Changelog + 2.1.7 (unreleased) + ------------------ + +-- Nothing changed yet. ++- Remove CMFDefault dependency ++ [tomgross] + + + 2.1.6 (2015-04-22) diff --git a/setup.py b/setup.py -index 265e131..c64aaa9 100644 +index 5b949bc..b7e10f0 100644 --- a/setup.py +++ b/setup.py -@@ -59,7 +59,6 @@ - 'Products.Archetypes', - 'Products.contentmigration', - 'Products.CMFCore', -- 'Products.CMFDefault', - 'Products.CMFDiffTool', - 'Products.CMFEditions', - 'Products.CMFFormController', +@@ -32,7 +32,6 @@ + 'zope.interface', + 'zope.structuredtext', + 'Products.CMFCore', +- 'Products.CMFDefault', + 'Products.MimetypesRegistry', + 'Acquisition', + 'ZODB3', -Repository: plone.app.upgrade +Repository: Products.PortalTransforms Branch: refs/heads/master -Date: 2015-05-30T13:41:49+02:00 +Date: 2015-05-30T13:52:11+02:00 Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.app.upgrade/commit/d3d0b0ccc71d59bacb55d9d3b0c48772a51704ed +Commit: https://github.com/plone/Products.PortalTransforms/commit/070647cfcfc891a9c819481f94c67d75c31ad85f -Merge pull request #32 from plone/tomgross-nocmfdefault +Merge pull request #8 from plone/tomgross-nocmfdefault2 -Removed hard CMFDefault dependency +Removed CMFDefault dependency Files changed: M CHANGES.rst -M plone/app/upgrade/v40/configure.zcml +M Products/PortalTransforms/transforms/html_body.py +M Products/PortalTransforms/transforms/pdf_to_html.py +M Products/PortalTransforms/transforms/rtf_to_html.py +M Products/PortalTransforms/transforms/safe_html.py M setup.py diff --git a/CHANGES.rst b/CHANGES.rst -index 542501e..fab7196 100644 +index f1dee22..8450ec6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst -@@ -7,6 +7,8 @@ Changelog - - Plone 5: upgrade manage portlets js - [vangheem] +@@ -4,7 +4,8 @@ Changelog + 2.1.7 (unreleased) + ------------------ -+- Remove hard dependency on CMFDefault +-- Nothing changed yet. ++- Remove CMFDefault dependency + [tomgross] - 1.3.10 (2015-05-13) - ------------------- -diff --git a/plone/app/upgrade/v40/configure.zcml b/plone/app/upgrade/v40/configure.zcml -index 6437c40..a51e4d6 100644 ---- a/plone/app/upgrade/v40/configure.zcml -+++ b/plone/app/upgrade/v40/configure.zcml -@@ -1,5 +1,6 @@ - - -@@ -169,6 +170,7 @@ - profile="Products.CMFPlone:plone"> - - + + 2.1.6 (2015-04-22) +diff --git a/Products/PortalTransforms/transforms/html_body.py b/Products/PortalTransforms/transforms/html_body.py +index e03fdaa..78181ab 100644 +--- a/Products/PortalTransforms/transforms/html_body.py ++++ b/Products/PortalTransforms/transforms/html_body.py +@@ -1,6 +1,6 @@ + from Products.PortalTransforms.interfaces import ITransform + from zope.interface import implements +-from Products.CMFDefault.utils import bodyfinder ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + + + class HTMLBody: +diff --git a/Products/PortalTransforms/transforms/pdf_to_html.py b/Products/PortalTransforms/transforms/pdf_to_html.py +index 8c6159d..27f9f24 100644 +--- a/Products/PortalTransforms/transforms/pdf_to_html.py ++++ b/Products/PortalTransforms/transforms/pdf_to_html.py +@@ -7,7 +7,7 @@ + from Products.PortalTransforms.libtransforms.utils import sansext + from Products.PortalTransforms.libtransforms.commandtransform import ( + commandtransform, popentransform) +-from Products.CMFDefault.utils import bodyfinder ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + import os + + +diff --git a/Products/PortalTransforms/transforms/rtf_to_html.py b/Products/PortalTransforms/transforms/rtf_to_html.py +index cb50d20..7df9d68 100644 +--- a/Products/PortalTransforms/transforms/rtf_to_html.py ++++ b/Products/PortalTransforms/transforms/rtf_to_html.py +@@ -5,9 +5,9 @@ + from Products.PortalTransforms.interfaces import ITransform + from zope.interface import implements + from Products.PortalTransforms.libtransforms.utils import sansext ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + from Products.PortalTransforms.libtransforms.commandtransform import \ + commandtransform +-from Products.CMFDefault.utils import bodyfinder + import os + + +diff --git a/Products/PortalTransforms/transforms/safe_html.py b/Products/PortalTransforms/transforms/safe_html.py +index 255a878..e5e243c 100644 +--- a/Products/PortalTransforms/transforms/safe_html.py ++++ b/Products/PortalTransforms/transforms/safe_html.py +@@ -6,17 +6,74 @@ + from Products.PortalTransforms.interfaces import ITransform + from zope.interface import implements + from Products.PortalTransforms.utils import log +-from Products.CMFDefault.utils import bodyfinder +-from Products.CMFDefault.utils import IllegalHTML +-from Products.CMFDefault.utils import VALID_TAGS +-from Products.CMFDefault.utils import NASTY_TAGS ++from Products.PortalTransforms.libtransforms.utils import bodyfinder + from Products.PortalTransforms.utils import safeToInt + +-# tag mapping: tag -> short or long tag +-VALID_TAGS = VALID_TAGS.copy() +-NASTY_TAGS = NASTY_TAGS.copy() ++class IllegalHTML(ValueError): ++ """ Illegal HTML error. ++ """ ++ ++ ++# These are the HTML tags that we will leave intact ++VALID_TAGS = { 'a' : 1 ++ , 'b' : 1 ++ , 'base' : 0 ++ , 'big' : 1 ++ , 'blockquote' : 1 ++ , 'body' : 1 ++ , 'br' : 0 ++ , 'caption' : 1 ++ , 'cite' : 1 ++ , 'code' : 1 ++ , 'dd' : 1 ++ , 'div' : 1 ++ , 'dl' : 1 ++ , 'dt' : 1 ++ , 'em' : 1 ++ , 'h1' : 1 ++ , 'h2' : 1 ++ , 'h3' : 1 ++ , 'h4' : 1 ++ , 'h5' : 1 ++ , 'h6' : 1 ++ , 'head' : 1 ++ , 'hr' : 0 ++ , 'html' : 1 ++ , 'i' : 1 ++ , 'img' : 0 ++ , 'kbd' : 1 ++ , 'li' : 1 ++ # , 'link' : 1 type="script" hoses us ++ , 'meta' : 0 ++ , 'ol' : 1 ++ , 'p' : 1 ++ , 'pre' : 1 ++ , 'small' : 1 ++ , 'span' : 1 ++ , 'strong' : 1 ++ , 'sub' : 1 ++ , 'sup' : 1 ++ , 'table' : 1 ++ , 'tbody' : 1 ++ , 'td' : 1 ++ , 'th' : 1 ++ , 'title' : 1 ++ , 'tr' : 1 ++ , 'tt' : 1 ++ , 'u' : 1 ++ , 'ul' : 1 ++ } ++ ++NASTY_TAGS = { 'script' : 1 ++ , 'object' : 1 ++ , 'embed' : 1 ++ , 'applet' : 1 ++ , 'style' : 1 # this helps improve Word HTML cleanup. ++ , 'meta' : 1 # allowed by parsers, but can cause unexpected behavior ++ } ++ + +-# add some tags to allowed types. These should be backported to CMFDefault. ++# add some tags to allowed types. + VALID_TAGS['ins'] = 1 + VALID_TAGS['del'] = 1 + VALID_TAGS['q'] = 1 +@@ -61,9 +118,6 @@ + VALID_TAGS['time'] = 1 + VALID_TAGS['video'] = 1 + +-# add some tags to nasty. +-NASTY_TAGS['style'] = 1 # this helps improve Word HTML cleanup. +-NASTY_TAGS['meta'] = 1 # allowed by parsers, but can cause unexpected behavior + + + msg_pat = """ diff --git a/setup.py b/setup.py -index 265e131..c64aaa9 100644 +index 5b949bc..b7e10f0 100644 --- a/setup.py +++ b/setup.py -@@ -59,7 +59,6 @@ - 'Products.Archetypes', - 'Products.contentmigration', - 'Products.CMFCore', -- 'Products.CMFDefault', - 'Products.CMFDiffTool', - 'Products.CMFEditions', - 'Products.CMFFormController', +@@ -32,7 +32,6 @@ + 'zope.interface', + 'zope.structuredtext', + 'Products.CMFCore', +- 'Products.CMFDefault', + 'Products.MimetypesRegistry', + 'Acquisition', + 'ZODB3',