-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/3.0.x Date: 2017-04-26T12:40:16+02:00 Author: Johannes Raggam (thet) <thetetet@gmail.com> Commit: plone/plone.namedfile@4bdaac7 fix assertIsInstance not available in Python 2.6 Files changed: M plone/namedfile/tests/test_scaling.py Repository: plone.namedfile Branch: refs/heads/3.0.x Date: 2017-04-26T14:14:43+02:00 Author: Alexander Loechel (loechel) <loechel@users.noreply.github.com> Commit: plone/plone.namedfile@15d264a Merge pull request #49 from plone/thet-fixassert fix assertIsInstance not available in Python 2.6 Files changed: M plone/namedfile/tests/test_scaling.py
- Loading branch information
Showing
1 changed file
with
79 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,88 @@ | ||
Repository: plone.app.contenttypes | ||
Repository: plone.namedfile | ||
|
||
|
||
Branch: refs/heads/1.2.x | ||
Date: 2017-04-10T10:00:25+02:00 | ||
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> | ||
Commit: https://github.com/plone/plone.app.contenttypes/commit/7d6801cdda9a33577aaac26c78aae9fca969f222 | ||
|
||
Fixed Mimetype icon path. | ||
|
||
Version 1.2.19 introduced a change to fit Products.MimetypesRegistry 2.1, but Plone 5.0 should remain on 2.0.x. | ||
Fixes https://github.com/plone/Products.CMFPlone/issues/1997. | ||
|
||
Revert "with the removal of the skins folder in https://github.com/plone/Products.MimetypesRegistry/pull/8/commits/61acf8327e5c844bff9e5c5676170aaf0ee2c323 we need the full resourcepath now" | ||
This reverts commit 292aefd647a67d6d0767aba39a687845fab00a76. | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M plone/app/contenttypes/browser/utils.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 5c39611..4b7a50b 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -14,6 +14,11 @@ New features: | ||
|
||
Bug fixes: | ||
|
||
+- Fixed Mimetype icon path. Version 1.2.19 introduced a change to fit | ||
+ Products.MimetypesRegistry 2.1, but Plone 5.0 should remain on 2.0.x. | ||
+ Fixes `issue 1997 <https://github.com/plone/Products.CMFPlone/issues/1997>`_. | ||
+ [maurits] | ||
+ | ||
- Avoid failure during migration if relation is broken. | ||
[cedricmessiant] | ||
|
||
diff --git a/plone/app/contenttypes/browser/utils.py b/plone/app/contenttypes/browser/utils.py | ||
index ba07fb3..cf76657 100644 | ||
--- a/plone/app/contenttypes/browser/utils.py | ||
+++ b/plone/app/contenttypes/browser/utils.py | ||
@@ -37,8 +37,7 @@ def getMimeTypeIcon(self, content_file): | ||
if content_file.filename: | ||
mime.append(mtr.lookupExtension(content_file.filename)) | ||
mime.append(mtr.lookup('application/octet-stream')[0]) | ||
- icon_paths = ['++resource++mimetype.icons/' + m.icon_path | ||
- for m in mime if hasattr(m, 'icon_path')] | ||
+ icon_paths = [m.icon_path for m in mime if hasattr(m, 'icon_path')] | ||
if icon_paths: | ||
return icon_paths[0] | ||
|
||
|
||
|
||
Repository: plone.app.contenttypes | ||
|
||
|
||
Branch: refs/heads/1.2.x | ||
Date: 2017-04-26T11:48:16+02:00 | ||
Branch: refs/heads/3.0.x | ||
Date: 2017-04-26T12:40:16+02:00 | ||
Author: Johannes Raggam (thet) <thetetet@gmail.com> | ||
Commit: https://github.com/plone/plone.app.contenttypes/commit/25c8a64408244649eb0c1ab69f072b2db627b86c | ||
|
||
Merge pull request #395 from plone/revert-mimetype-icons-12x | ||
Commit: https://github.com/plone/plone.namedfile/commit/4bdaac716eb9ec3cd8b1562b3ba3b459df533da3 | ||
|
||
Fixed Mimetype icon path. [1.2.x, Plone 5.0] | ||
fix assertIsInstance not available in Python 2.6 | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M plone/app/contenttypes/browser/utils.py | ||
M plone/namedfile/tests/test_scaling.py | ||
|
||
diff --git a/plone/namedfile/tests/test_scaling.py b/plone/namedfile/tests/test_scaling.py | ||
index 4b384d0..fdc99b8 100644 | ||
--- a/plone/namedfile/tests/test_scaling.py | ||
+++ b/plone/namedfile/tests/test_scaling.py | ||
@@ -63,9 +63,9 @@ def testCreateScale(self): | ||
foo = self.scaling.scale('image', width=100, height=80) | ||
self.assertTrue(foo.uid) | ||
self.assertEqual(foo.mimetype, 'image/jpeg') | ||
- self.assertIsInstance(foo.mimetype, str) | ||
+ self.assertTrue(isinstance(foo.mimetype, str)) | ||
self.assertEqual(foo.data.contentType, 'image/jpeg') | ||
- self.assertIsInstance(foo.data.contentType, str) | ||
+ self.assertTrue(isinstance(foo.data.contentType, str)) | ||
self.assertEqual(foo.width, 80) | ||
self.assertEqual(foo.height, 80) | ||
self.assertImage(foo.data.data, 'JPEG', (80, 80)) | ||
@@ -81,9 +81,9 @@ def testGetScaleByName(self): | ||
foo = self.scaling.scale('image', scale='foo') | ||
self.assertTrue(foo.uid) | ||
self.assertEqual(foo.mimetype, 'image/jpeg') | ||
- self.assertIsInstance(foo.mimetype, str) | ||
+ self.assertTrue(isinstance(foo.mimetype, str)) | ||
self.assertEqual(foo.data.contentType, 'image/jpeg') | ||
- self.assertIsInstance(foo.data.contentType, str) | ||
+ self.assertTrue(isinstance(foo.data.contentType, str)) | ||
self.assertEqual(foo.width, 60) | ||
self.assertEqual(foo.height, 60) | ||
self.assertImage(foo.data.data, 'JPEG', (60, 60)) | ||
|
||
|
||
Repository: plone.namedfile | ||
|
||
|
||
Branch: refs/heads/3.0.x | ||
Date: 2017-04-26T14:14:43+02:00 | ||
Author: Alexander Loechel (loechel) <loechel@users.noreply.github.com> | ||
Commit: https://github.com/plone/plone.namedfile/commit/15d264a6e8c570861684f2aa89c13b1c026d9b80 | ||
|
||
Merge pull request #49 from plone/thet-fixassert | ||
|
||
fix assertIsInstance not available in Python 2.6 | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 5c39611..4b7a50b 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -14,6 +14,11 @@ New features: | ||
|
||
Bug fixes: | ||
|
||
+- Fixed Mimetype icon path. Version 1.2.19 introduced a change to fit | ||
+ Products.MimetypesRegistry 2.1, but Plone 5.0 should remain on 2.0.x. | ||
+ Fixes `issue 1997 <https://github.com/plone/Products.CMFPlone/issues/1997>`_. | ||
+ [maurits] | ||
+ | ||
- Avoid failure during migration if relation is broken. | ||
[cedricmessiant] | ||
|
||
diff --git a/plone/app/contenttypes/browser/utils.py b/plone/app/contenttypes/browser/utils.py | ||
index ba07fb3..cf76657 100644 | ||
--- a/plone/app/contenttypes/browser/utils.py | ||
+++ b/plone/app/contenttypes/browser/utils.py | ||
@@ -37,8 +37,7 @@ def getMimeTypeIcon(self, content_file): | ||
if content_file.filename: | ||
mime.append(mtr.lookupExtension(content_file.filename)) | ||
mime.append(mtr.lookup('application/octet-stream')[0]) | ||
- icon_paths = ['++resource++mimetype.icons/' + m.icon_path | ||
- for m in mime if hasattr(m, 'icon_path')] | ||
+ icon_paths = [m.icon_path for m in mime if hasattr(m, 'icon_path')] | ||
if icon_paths: | ||
return icon_paths[0] | ||
|
||
Files changed: | ||
M plone/namedfile/tests/test_scaling.py | ||
|
||
diff --git a/plone/namedfile/tests/test_scaling.py b/plone/namedfile/tests/test_scaling.py | ||
index 4b384d0..fdc99b8 100644 | ||
--- a/plone/namedfile/tests/test_scaling.py | ||
+++ b/plone/namedfile/tests/test_scaling.py | ||
@@ -63,9 +63,9 @@ def testCreateScale(self): | ||
foo = self.scaling.scale('image', width=100, height=80) | ||
self.assertTrue(foo.uid) | ||
self.assertEqual(foo.mimetype, 'image/jpeg') | ||
- self.assertIsInstance(foo.mimetype, str) | ||
+ self.assertTrue(isinstance(foo.mimetype, str)) | ||
self.assertEqual(foo.data.contentType, 'image/jpeg') | ||
- self.assertIsInstance(foo.data.contentType, str) | ||
+ self.assertTrue(isinstance(foo.data.contentType, str)) | ||
self.assertEqual(foo.width, 80) | ||
self.assertEqual(foo.height, 80) | ||
self.assertImage(foo.data.data, 'JPEG', (80, 80)) | ||
@@ -81,9 +81,9 @@ def testGetScaleByName(self): | ||
foo = self.scaling.scale('image', scale='foo') | ||
self.assertTrue(foo.uid) | ||
self.assertEqual(foo.mimetype, 'image/jpeg') | ||
- self.assertIsInstance(foo.mimetype, str) | ||
+ self.assertTrue(isinstance(foo.mimetype, str)) | ||
self.assertEqual(foo.data.contentType, 'image/jpeg') | ||
- self.assertIsInstance(foo.data.contentType, str) | ||
+ self.assertTrue(isinstance(foo.data.contentType, str)) | ||
self.assertEqual(foo.width, 60) | ||
self.assertEqual(foo.height, 60) | ||
self.assertImage(foo.data.data, 'JPEG', (60, 60)) | ||
|
||
|