[Testbot] Plone 5.0 - Python 2.7 - Build # 3233 - Fixed! - 0 failure(s)
jenkins at plone.org
jenkins at plone.org
Tue Sep 23 13:30:27 UTC 2014
-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 3233 - Fixed!
-------------------------------------------------------------------------------
http://jenkins.plone.org/job/plone-5.0-python-2.7/3233/
-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------
Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-05-23T15:23:19+02:00
Author: Kees Hink (khink) <keeshink at gmail.com>
Commit: https://github.com/plone/plone.portlet.static/commit/52904294205359b3fd4c44a2eba2e7f3be81aacf
Replace DL/DT/DD in portlet with more semantic markup
Files changed:
M plone/portlet/static/static.pt
diff --git a/plone/portlet/static/static.pt b/plone/portlet/static/static.pt
index 13b888f..9ea9e9e 100644
--- a/plone/portlet/static/static.pt
+++ b/plone/portlet/static/static.pt
@@ -1,11 +1,11 @@
<div tal:condition="view/data/omit_border"
tal:attributes="class string:portletStaticText ${view/css_class}"
tal:content="structure view/transformed" />
-<dl tal:condition="not:view/data/omit_border"
+<div tal:condition="not:view/data/omit_border"
tal:attributes="class string:portlet portletStaticText ${view/css_class}"
i18n:domain="plone">
- <dt class="portletHeader"
+ <strong class="portletHeader"
tal:define="header view/data/header"
tal:attributes="class python:header and 'portletHeader' or 'portletHeader titleless'">
<span class="portletTopLeft"></span>
@@ -18,17 +18,17 @@
/>
</span>
<span class="portletTopRight"></span>
- </dt>
+ </strong>
- <dd class="portletItem odd">
+ <div class="portletContent">
<div tal:replace="structure view/transformed" />
<tal:corners condition="not:view/has_footer">
<span class="portletBottomLeft"></span>
<span class="portletBottomRight"></span>
</tal:corners>
- </dd>
+ </div>
- <dd class="portletFooter" tal:condition="view/has_footer">
+ <footer class="portletFooter" tal:condition="view/has_footer">
<span class="portletBottomLeft"></span>
<span>
<a class="tile"
@@ -38,6 +38,6 @@
/>
</span>
<span class="portletBottomRight"></span>
- </dd>
+ </footer>
-</dl>
+</div>
Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-09-23T13:28:44+02:00
Author: Kees Hink (khink) <keeshink at gmail.com>
Commit: https://github.com/plone/plone.portlet.static/commit/49441ff92dd9e7e5f25318699efa12e76715e0aa
Replace DL/DT/DD in portlet with more semantic markup
Files changed:
M plone/portlet/static/static.pt
diff --git a/plone/portlet/static/static.pt b/plone/portlet/static/static.pt
index 07989ab..9ea9e9e 100644
--- a/plone/portlet/static/static.pt
+++ b/plone/portlet/static/static.pt
@@ -1,11 +1,11 @@
<div tal:condition="view/data/omit_border"
tal:attributes="class string:portletStaticText ${view/css_class}"
tal:content="structure view/transformed" />
-<dl tal:condition="not:view/data/omit_border"
+<div tal:condition="not:view/data/omit_border"
tal:attributes="class string:portlet portletStaticText ${view/css_class}"
i18n:domain="plone">
- <dt class="portletHeader"
+ <strong class="portletHeader"
tal:define="header view/data/header"
tal:attributes="class python:header and 'portletHeader' or 'portletHeader titleless'">
<span class="portletTopLeft"></span>
@@ -18,17 +18,17 @@
/>
</span>
<span class="portletTopRight"></span>
- </dt>
+ </strong>
- <dd class="portletItem odd">
+ <div class="portletContent">
<div tal:replace="structure view/transformed" />
<tal:corners condition="not:view/has_footer">
<span class="portletBottomLeft"></span>
<span class="portletBottomRight"></span>
</tal:corners>
- </dd>
-
- <dd class="portletFooter" tal:condition="view/has_footer">
+ </div>
+
+ <footer class="portletFooter" tal:condition="view/has_footer">
<span class="portletBottomLeft"></span>
<span>
<a class="tile"
@@ -38,6 +38,6 @@
/>
</span>
<span class="portletBottomRight"></span>
- </dd>
+ </footer>
-</dl>
+</div>
Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-09-23T13:30:18+02:00
Author: Jens W. Klein (jensens) <jk at kleinundpartner.at>
Commit: https://github.com/plone/plone.portlet.static/commit/0becdf7dbd775c4fe91543b13937f59cb6eddfbb
document chnages from mergin PR #7
Files changed:
M CHANGES.txt
diff --git a/CHANGES.txt b/CHANGES.txt
index 9d34338..01e50d5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,6 +5,9 @@ Changelog
3.0.1 (unreleased)
------------------
+- Replace DL/DT/DD in portlet with more semantic markup (see PR #7).
+ [khink]
+
- Fix the relative url transformation.
The 'safe_html' transformation has to be called with 'assignment context'
instead of 'display context'.
Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-09-23T13:30:59+02:00
Author: Jens W. Klein (jensens) <jk at kleinundpartner.at>
Commit: https://github.com/plone/plone.portlet.static/commit/83d31cd7ea34d1e3331fe96152522c4aacf6631a
Merge branch 'replace-dl-dt-dd-with-more-semantic-markup' of git://github.com/plone/plone.portlet.static into replace-dl-dt-dd-with-more-semantic-markup
Files changed:
Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-09-23T13:48:48+02:00
Author: Jens W. Klein (jensens) <jk at kleinundpartner.at>
Commit: https://github.com/plone/plone.portlet.static/commit/6e656a6d542fec8c2e896b6b5a98e6d070c64ed8
adopt test to non-dl/dt template and some pep8
Files changed:
M plone/portlet/static/tests/test_portlet_static.py
diff --git a/plone/portlet/static/tests/test_portlet_static.py b/plone/portlet/static/tests/test_portlet_static.py
index 3475005..b997915 100644
--- a/plone/portlet/static/tests/test_portlet_static.py
+++ b/plone/portlet/static/tests/test_portlet_static.py
@@ -1,20 +1,17 @@
-
-from plone.app.testing import login
-from plone.app.testing import setRoles
+# -*- coding: utf-8 -*-
+from plone.app.portlets.storage import PortletAssignmentMapping
from plone.app.testing import TEST_USER_ID
from plone.app.testing import TEST_USER_NAME
-
-from plone.portlets.interfaces import IPortletType
-from plone.portlets.interfaces import IPortletManager
+from plone.app.testing import login
+from plone.app.testing import setRoles
+from plone.portlet.static import static
+from plone.portlet.static.testing import PLONEPORTLETSTATIC_INTEGRATION_TESTING
from plone.portlets.interfaces import IPortletAssignment
from plone.portlets.interfaces import IPortletDataProvider
+from plone.portlets.interfaces import IPortletManager
from plone.portlets.interfaces import IPortletRenderer
-from plone.app.portlets.storage import PortletAssignmentMapping
+from plone.portlets.interfaces import IPortletType
from zope.component import getUtility, getMultiAdapter
-
-from plone.portlet.static import static
-from plone.portlet.static.testing import PLONEPORTLETSTATIC_INTEGRATION_TESTING
-
import unittest2 as unittest
@@ -39,12 +36,16 @@ def testInterfaces(self):
def testInvokeAddview(self):
portlet = getUtility(IPortletType, name='plone.portlet.static.Static')
- mapping = self.portal.restrictedTraverse('++contextportlets++plone.leftcolumn')
+ mapping = self.portal.restrictedTraverse(
+ '++contextportlets++plone.leftcolumn'
+ )
for m in mapping.keys():
del mapping[m]
addview = mapping.restrictedTraverse('+/' + portlet.addview)
- addview.createAndAdd(data={'header': u"test title", 'text': u"test text"})
+ addview.createAndAdd(
+ data={'header': u"test title", 'text': u"test text"}
+ )
self.assertEquals(len(mapping), 1)
self.failUnless(isinstance(mapping.values()[0], static.Assignment))
@@ -61,10 +62,17 @@ def testRenderer(self):
context = self.folder
request = self.folder.REQUEST
view = self.folder.restrictedTraverse('@@plone')
- manager = getUtility(IPortletManager, name='plone.rightcolumn', context=self.portal)
+ manager = getUtility(
+ IPortletManager,
+ name='plone.rightcolumn',
+ context=self.portal
+ )
assignment = static.Assignment(header=u"title", text="text")
- renderer = getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
+ renderer = getMultiAdapter(
+ (context, request, view, manager, assignment),
+ IPortletRenderer
+ )
self.failUnless(isinstance(renderer, static.Renderer))
self.failUnless(renderer.available,
@@ -81,18 +89,37 @@ def setUp(self):
setRoles(self.portal, TEST_USER_ID, ['Manager'])
login(self.portal, TEST_USER_NAME)
- def renderer(self, context=None, request=None, view=None, manager=None, assignment=None):
+ def renderer(self, context=None, request=None, view=None, manager=None,
+ assignment=None):
context = context or self.folder
request = request or self.folder.REQUEST
view = view or self.folder.restrictedTraverse('@@plone')
- manager = manager or getUtility(IPortletManager, name='plone.rightcolumn', context=self.portal)
- assignment = assignment or static.Assignment(header=u"title", text="text")
- r = getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
- r.__portlet_metadata__ = {'key': '/'.join(self.portal.getPhysicalPath())}
- return r
+ manager = manager or getUtility(
+ IPortletManager,
+ name='plone.rightcolumn',
+ context=self.portal
+ )
+ assignment = assignment or static.Assignment(
+ header=u"title",
+ text="text"
+ )
+ ren = getMultiAdapter(
+ (context, request, view, manager, assignment),
+ IPortletRenderer
+ )
+ ren.__portlet_metadata__ = {
+ 'key': '/'.join(self.portal.getPhysicalPath())
+ }
+ return ren
def test_render(self):
- r = self.renderer(context=self.portal, assignment=static.Assignment(header=u"title", text="<b>text</b>"))
+ r = self.renderer(
+ context=self.portal,
+ assignment=static.Assignment(
+ header=u"title",
+ text="<b>text</b>"
+ )
+ )
r = r.__of__(self.folder)
r.update()
output = r.render()
@@ -100,24 +127,41 @@ def test_render(self):
self.failUnless('<b>text</b>' in output)
def test_no_header(self):
- r = self.renderer(context=self.portal, assignment=static.Assignment(text="<b>text</b>"))
+ r = self.renderer(
+ context=self.portal,
+ assignment=static.Assignment(text="<b>text</b>")
+ )
r = r.__of__(self.folder)
r.update()
output = r.render()
self.assertTrue('<a class="tile"' not in output)
- self.assertTrue('<dt class="portletHeader titleless"' in output)
+ self.assertTrue('<strong class="portletHeader titleless"' in output)
def test_hide(self):
self.assertRaises(TypeError, static.Assignment, hide=True)
def test_css_class(self):
- r = self.renderer(context=self.portal,
- assignment=static.Assignment(header=u"Welcome text", text="<b>text</b>"))
+ r = self.renderer(
+ context=self.portal,
+ assignment=static.Assignment(
+ header=u"Welcome text",
+ text="<b>text</b>"
+ )
+ )
self.assertEquals('portlet-static-welcome-text', r.css_class())
def test_relative_link(self):
- folder_id = self.portal.invokeFactory('Folder', id='folder1', title='My Folder Title')
- r = self.renderer(context=self.portal[folder_id], assignment=static.Assignment(text="""<a href="relative/link">link</a>"""))
+ folder_id = self.portal.invokeFactory(
+ 'Folder',
+ id='folder1',
+ title='My Folder Title'
+ )
+ r = self.renderer(
+ context=self.portal[folder_id],
+ assignment=static.Assignment(
+ text="""<a href="relative/link">link</a>"""
+ )
+ )
r = r.__of__(self.folder)
r.update()
output = r.render()
Repository: plone.portlet.static
Branch: refs/heads/master
Date: 2014-09-23T13:50:55+02:00
Author: Jens W. Klein (jensens) <jk at kleinundpartner.at>
Commit: https://github.com/plone/plone.portlet.static/commit/c3b9e9f60a4336b19f528ae839ab0ee631fed355
modernizing code base: formatting, pep8 and so on
Files changed:
A CHANGES.rst
A README.rst
M MANIFEST.in
M plone/portlet/__init__.py
M plone/portlet/static/__init__.py
M plone/portlet/static/configure.zcml
M plone/portlet/static/static.py
M plone/portlet/static/testing.py
M plone/portlet/static/tests/__init__.py
M setup.py
D CHANGES.txt
D README.txt
diff --git a/CHANGES.rst b/CHANGES.rst
new file mode 100644
index 0000000..01e50d5
--- /dev/null
+++ b/CHANGES.rst
@@ -0,0 +1,228 @@
+Changelog
+=========
+
+
+3.0.1 (unreleased)
+------------------
+
+- Replace DL/DT/DD in portlet with more semantic markup (see PR #7).
+ [khink]
+
+- Fix the relative url transformation.
+ The 'safe_html' transformation has to be called with 'assignment context'
+ instead of 'display context'.
+ [sverbois]
+
+
+3.0.0 (2014-04-13)
+------------------
+
+- Use z3c.form for the portlet forms.
+ [bosim, davisagli]
+
+
+2.0.2 (2013-01-13)
+------------------
+
+- Check if instance is str before turning to unicode as Portal_tranform itself
+ can return unicode
+ [fafhrd91]
+
+- Portlet title no longer required. If the title is empty, the css class
+ "titleless" is added to the header.
+ [rnix, thet]
+
+- Adding constraint to validate white spaces
+ Fix https://dev.plone.org/ticket/13130
+ [hersonrodrigues]
+
+- Add MANIFEST.in.
+ [WouterVH]
+
+- Add metadata.xml to profile.
+ [WouterVH]
+
+
+2.0.1 - 2011-01-03
+------------------
+
+- Add Site Administrator to the default roles for the
+ "plone.portlet.static: Add static portlet" permission, for forward
+ compatibility with Plone 4.1.
+ [davisagli]
+
+
+2.0 - 2010-07-18
+----------------
+
+- Removed the deprecated `hide` option form the portlet.
+ [hannosch]
+
+- Update license to GPL version 2 only.
+ [hannosch]
+
+
+2.0b2 - 2010-02-17
+------------------
+
+- Removed the transformation cache from the portlet renderer. Portal transforms
+ doesn't actually work with the assignment class as a cache context.
+ This closes http://dev.plone.org/plone/ticket/10167.
+ [hannosch]
+
+
+2.0b1 - 2009-12-02
+------------------
+
+- Removed Kupu as a testing dependency. In Plone 4 the tests work with the
+ default TinyMCE transforms.
+ [hannosch]
+
+
+2.0a2 - 2009-11-18
+------------------
+
+- Removed reference to non-existent profile in plone.app.portlets.
+ [hannosch]
+
+
+2.0a1 - 2009-11-13
+------------------
+
+- Remove the "hide" option as this is now available to all portlets (PLIP 9286)
+ [igbun]
+
+- Adjusted test setup to Plone 5.
+ [hannosch]
+
+- Added the z3c.autoinclude entry point so this package is automatically loaded
+ on Plone 3.3 and above.
+ [hannosch]
+
+- Declare test dependencies in an extra.
+ [hannosch]
+
+- Specify package dependencies.
+ [hannosch]
+
+- Added 'tile' CSS class to the links within dt.portletHeader and
+ dd.portletFooter for static portlet's template
+ [spliter]
+
+
+1.2.1 - 2009-11-25
+------------------
+
+- Fixed a syntax error introduced in the last change.
+ [hannosch]
+
+
+1.2 - 2009-11-25
+----------------
+
+- Ensure that text output is passed through the safe-html transform to protect
+ against malicious text. This also ensures the resolve uid behavior works when
+ only TinyMCE and not Kupu is installed.
+ [hannosch]
+
+- Removed msgids in portlets.xml. There is no support for
+ msgids in the import of portlets.xml implementation.
+ This allows to extract translatable strings with i18ndude.
+ [vincentfretin]
+
+- Added transform to resolve uids.
+ [lrowe]
+
+
+1.2rc1 - 2009-03-27
+-------------------
+
+- The portlet was incorrectly using the 'Manage portlet' permission. It now
+ uses a custom permission with the same default roles.
+ Fixes http://dev.plone.org/plone/ticket/8403.
+ [optilude]
+
+
+1.1.5 - 2008-08-18
+------------------
+
+- Fixed a typo in CSS class name. This closes
+ http://dev.plone.org/plone/ticket/8119.
+ [hannosch]
+
+
+1.1.2 - 2008-06-01
+-------------------
+
+- Added more i18n in the main python file as the i18n in portlets.xml
+ is not used. [maurits]
+
+- Added option to (temporarily) hide the portlet without needing to
+ delete it. [maurits]
+
+
+1.1.0 - 2008-04-20
+------------------
+
+- Unchanged from 1.1rc2
+
+
+1.1rc2 - 2008-03-26
+-------------------
+
+- Use README.txt and HISTORY.txt as the package's long description and
+ add missing history entries for all releases.
+ [wichert]
+
+- Fix the version restriction on the plone.app.form dependency.
+ [wichert]
+
+
+1.1rc1 - 2008-03-25
+-------------------
+
+- Add missing i18n support.
+ [hannosch]
+
+- Add a version restriction on the plone.app.form dependency.
+ [optilude]
+
+
+1.1.0a1 - 2008-03-09
+--------------------
+
+- Packaging cleanups
+ [wichert]
+
+- PLIP 184: make text editable using a rich text editor such as kupu
+ [optilude]
+
+- Add an 'omit border' option
+ [optilude]
+
+
+1.0b3 - 2007-08-27
+-------------------
+
+- Correct portlet styling to Plone standards
+ [optilude]
+
+
+1.0b2 - 2007-08-26
+------------------
+
+- Make header and footer configurable
+ [optilude]
+
+
+1.0b1 - 2007-08-26
+------------------
+
+- Added missing i18n markup to portlets.xml.
+ [hannosch]
+
+- Changed the i18n domain to `plone`.
+ [hannosch]
+
+- Initial release
+ [optilude]
diff --git a/CHANGES.txt b/CHANGES.txt
deleted file mode 100644
index 01e50d5..0000000
--- a/CHANGES.txt
+++ /dev/null
@@ -1,228 +0,0 @@
-Changelog
-=========
-
-
-3.0.1 (unreleased)
-------------------
-
-- Replace DL/DT/DD in portlet with more semantic markup (see PR #7).
- [khink]
-
-- Fix the relative url transformation.
- The 'safe_html' transformation has to be called with 'assignment context'
- instead of 'display context'.
- [sverbois]
-
-
-3.0.0 (2014-04-13)
-------------------
-
-- Use z3c.form for the portlet forms.
- [bosim, davisagli]
-
-
-2.0.2 (2013-01-13)
-------------------
-
-- Check if instance is str before turning to unicode as Portal_tranform itself
- can return unicode
- [fafhrd91]
-
-- Portlet title no longer required. If the title is empty, the css class
- "titleless" is added to the header.
- [rnix, thet]
-
-- Adding constraint to validate white spaces
- Fix https://dev.plone.org/ticket/13130
- [hersonrodrigues]
-
-- Add MANIFEST.in.
- [WouterVH]
-
-- Add metadata.xml to profile.
- [WouterVH]
-
-
-2.0.1 - 2011-01-03
-------------------
-
-- Add Site Administrator to the default roles for the
- "plone.portlet.static: Add static portlet" permission, for forward
- compatibility with Plone 4.1.
- [davisagli]
-
-
-2.0 - 2010-07-18
-----------------
-
-- Removed the deprecated `hide` option form the portlet.
- [hannosch]
-
-- Update license to GPL version 2 only.
- [hannosch]
-
-
-2.0b2 - 2010-02-17
-------------------
-
-- Removed the transformation cache from the portlet renderer. Portal transforms
- doesn't actually work with the assignment class as a cache context.
- This closes http://dev.plone.org/plone/ticket/10167.
- [hannosch]
-
-
-2.0b1 - 2009-12-02
-------------------
-
-- Removed Kupu as a testing dependency. In Plone 4 the tests work with the
- default TinyMCE transforms.
- [hannosch]
-
-
-2.0a2 - 2009-11-18
-------------------
-
-- Removed reference to non-existent profile in plone.app.portlets.
- [hannosch]
-
-
-2.0a1 - 2009-11-13
-------------------
-
-- Remove the "hide" option as this is now available to all portlets (PLIP 9286)
- [igbun]
-
-- Adjusted test setup to Plone 5.
- [hannosch]
-
-- Added the z3c.autoinclude entry point so this package is automatically loaded
- on Plone 3.3 and above.
- [hannosch]
-
-- Declare test dependencies in an extra.
- [hannosch]
-
-- Specify package dependencies.
- [hannosch]
-
-- Added 'tile' CSS class to the links within dt.portletHeader and
- dd.portletFooter for static portlet's template
- [spliter]
-
-
-1.2.1 - 2009-11-25
-------------------
-
-- Fixed a syntax error introduced in the last change.
- [hannosch]
-
-
-1.2 - 2009-11-25
-----------------
-
-- Ensure that text output is passed through the safe-html transform to protect
- against malicious text. This also ensures the resolve uid behavior works when
- only TinyMCE and not Kupu is installed.
- [hannosch]
-
-- Removed msgids in portlets.xml. There is no support for
- msgids in the import of portlets.xml implementation.
- This allows to extract translatable strings with i18ndude.
- [vincentfretin]
-
-- Added transform to resolve uids.
- [lrowe]
-
-
-1.2rc1 - 2009-03-27
--------------------
-
-- The portlet was incorrectly using the 'Manage portlet' permission. It now
- uses a custom permission with the same default roles.
- Fixes http://dev.plone.org/plone/ticket/8403.
- [optilude]
-
-
-1.1.5 - 2008-08-18
-------------------
-
-- Fixed a typo in CSS class name. This closes
- http://dev.plone.org/plone/ticket/8119.
- [hannosch]
-
-
-1.1.2 - 2008-06-01
--------------------
-
-- Added more i18n in the main python file as the i18n in portlets.xml
- is not used. [maurits]
-
-- Added option to (temporarily) hide the portlet without needing to
- delete it. [maurits]
-
-
-1.1.0 - 2008-04-20
-------------------
-
-- Unchanged from 1.1rc2
-
-
-1.1rc2 - 2008-03-26
--------------------
-
-- Use README.txt and HISTORY.txt as the package's long description and
- add missing history entries for all releases.
- [wichert]
-
-- Fix the version restriction on the plone.app.form dependency.
- [wichert]
-
-
-1.1rc1 - 2008-03-25
--------------------
-
-- Add missing i18n support.
- [hannosch]
-
-- Add a version restriction on the plone.app.form dependency.
- [optilude]
-
-
-1.1.0a1 - 2008-03-09
---------------------
-
-- Packaging cleanups
- [wichert]
-
-- PLIP 184: make text editable using a rich text editor such as kupu
- [optilude]
-
-- Add an 'omit border' option
- [optilude]
-
-
-1.0b3 - 2007-08-27
--------------------
-
-- Correct portlet styling to Plone standards
- [optilude]
-
-
-1.0b2 - 2007-08-26
-------------------
-
-- Make header and footer configurable
- [optilude]
-
-
-1.0b1 - 2007-08-26
-------------------
-
-- Added missing i18n markup to portlets.xml.
- [hannosch]
-
-- Changed the i18n domain to `plone`.
- [hannosch]
-
-- Initial release
- [optilude]
diff --git a/MANIFEST.in b/MANIFEST.in
index 48ebc74..ca47510 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,7 @@
+include *.rst
include *.txt
recursive-include docs *
recursive-include plone *
-global-exclude *pyc
\ No newline at end of file
+global-exclude *pyc
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..788279f
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,4 @@
+Introduction
+============
+
+A simple static HTML portlet for Plone 3 and up.
diff --git a/README.txt b/README.txt
deleted file mode 100644
index 788279f..0000000
--- a/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Introduction
-============
-
-A simple static HTML portlet for Plone 3 and up.
diff --git a/plone/portlet/__init__.py b/plone/portlet/__init__.py
index f48ad10..68c04af 100644
--- a/plone/portlet/__init__.py
+++ b/plone/portlet/__init__.py
@@ -1,6 +1,2 @@
-# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
- from pkgutil import extend_path
- __path__ = extend_path(__path__, __name__)
+# -*- coding: utf-8 -*-
+__import__('pkg_resources').declare_namespace(__name__)
diff --git a/plone/portlet/static/__init__.py b/plone/portlet/static/__init__.py
index f1c74a9..d65704c 100644
--- a/plone/portlet/static/__init__.py
+++ b/plone/portlet/static/__init__.py
@@ -1,7 +1,10 @@
-from zope.i18nmessageid import MessageFactory
+# -*- coding: utf-8 -*-
from Products.CMFCore.permissions import setDefaultRoles
+from zope.i18nmessageid import MessageFactory
PloneMessageFactory = MessageFactory('plone')
-setDefaultRoles('plone.portlet.static: Add static portlet',
- ('Manager', 'Site Administrator', 'Owner', ))
+setDefaultRoles(
+ 'plone.portlet.static: Add static portlet',
+ ('Manager', 'Site Administrator', 'Owner', )
+)
diff --git a/plone/portlet/static/configure.zcml b/plone/portlet/static/configure.zcml
index bf23f2f..c610cb4 100644
--- a/plone/portlet/static/configure.zcml
+++ b/plone/portlet/static/configure.zcml
@@ -8,28 +8,28 @@
<five:registerPackage package="." />
<genericsetup:registerProfile
- name="default"
- title="Static text portlet"
- directory="profiles/default"
- description="A simple portlet that displays static HTML"
- provides="Products.GenericSetup.interfaces.EXTENSION"
- />
+ name="default"
+ title="Static text portlet"
+ directory="profiles/default"
+ description="A simple portlet that displays static HTML"
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ />
- <permission
- id="plone.portlet.static.AddStaticPortlet"
- title="plone.portlet.static: Add static portlet"
- />
+ <permission
+ id="plone.portlet.static.AddStaticPortlet"
+ title="plone.portlet.static: Add static portlet"
+ />
<!-- Register the portlet -->
- <plone:portlet
- name="plone.portlet.static.Static"
- interface=".static.IStaticPortlet"
- assignment=".static.Assignment"
- view_permission="zope2.View"
- edit_permission="plone.portlet.static.AddStaticPortlet"
- renderer=".static.Renderer"
- addview=".static.AddForm"
- editview=".static.EditForm"
- />
+ <plone:portlet
+ name="plone.portlet.static.Static"
+ interface=".static.IStaticPortlet"
+ assignment=".static.Assignment"
+ view_permission="zope2.View"
+ edit_permission="plone.portlet.static.AddStaticPortlet"
+ renderer=".static.Renderer"
+ addview=".static.AddForm"
+ editview=".static.EditForm"
+ />
</configure>
diff --git a/plone/portlet/static/static.py b/plone/portlet/static/static.py
index 46a2803..c29494a 100644
--- a/plone/portlet/static/static.py
+++ b/plone/portlet/static/static.py
@@ -1,15 +1,16 @@
+# -*- coding: utf-8 -*-
from Acquisition import aq_inner
+from Products.CMFCore.utils import getToolByName
+from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.portlets.portlets import base
from plone.app.textfield import RichText
from plone.app.textfield.value import RichTextValue
from plone.i18n.normalizer.interfaces import IIDNormalizer
from plone.portlet.static import PloneMessageFactory as _
from plone.portlets.interfaces import IPortletDataProvider
-from Products.CMFCore.utils import getToolByName
-from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope import schema
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
import logging
import re
@@ -37,8 +38,10 @@ class IStaticPortlet(IPortletDataProvider):
omit_border = schema.Bool(
title=_(u"Omit portlet border"),
- description=_(u"Tick this box if you want to render the text above "
- "without the standard header, border or footer."),
+ description=_(
+ u"Tick this box if you want to render the text above "
+ "without the standard header, border or footer."
+ ),
required=True,
default=False)
@@ -49,11 +52,13 @@ class IStaticPortlet(IPortletDataProvider):
more_url = schema.ASCIILine(
title=_(u"Details link"),
- description=_(u"If given, the header and footer "
- "will link to this URL."),
+ description=_(
+ u"If given, the header and footer will link to this URL."
+ ),
required=False)
+ at implementer(IStaticPortlet)
class Assignment(base.Assignment):
"""Portlet assignment.
@@ -61,8 +66,6 @@ class Assignment(base.Assignment):
with columns.
"""
- implements(IStaticPortlet)
-
header = _(u"title_static_portlet", default=u"Static text portlet")
text = u""
omit_border = False
@@ -127,17 +130,25 @@ def transformed(self, mt='text/x-html-safe'):
# which stored text directly as sent by the browser, which could
# be any encoding in the world.
orig = unicode(orig, 'utf-8', 'ignore')
- logger.warn("Static portlet at %s has stored non-unicode text. "
- "Assuming utf-8 encoding." % context.absolute_url())
+ logger.warn(
+ "Static portlet at %s has stored non-unicode text. "
+ "Assuming utf-8 encoding." % context.absolute_url()
+ )
# Portal transforms needs encoded strings
orig = orig.encode('utf-8')
transformer = getToolByName(context, 'portal_transforms')
assignment_context_path = self.__portlet_metadata__['key']
- assignment_context = context.restrictedTraverse(assignment_context_path)
- data = transformer.convertTo(mt, orig,
- context=assignment_context, mimetype='text/html')
+ assignment_context = context.restrictedTraverse(
+ assignment_context_path
+ )
+ data = transformer.convertTo(
+ mt,
+ orig,
+ context=assignment_context,
+ mimetype='text/html'
+ )
result = data.getData()
if result:
if isinstance(result, str):
@@ -155,8 +166,10 @@ class AddForm(base.AddForm):
"""
schema = IStaticPortlet
label = _(u"title_add_static_portlet", default=u"Add static text portlet")
- description = _(u"description_static_portlet",
- default=u"A portlet which can display static HTML text.")
+ description = _(
+ u"description_static_portlet",
+ default=u"A portlet which can display static HTML text."
+ )
def create(self, data):
return Assignment(**data)
@@ -169,6 +182,11 @@ class EditForm(base.EditForm):
zope.formlib which fields to display.
"""
schema = IStaticPortlet
- label = _(u"title_edit_static_portlet", default=u"Edit static text portlet")
- description = _(u"description_static_portlet",
- default=u"A portlet which can display static HTML text.")
+ label = _(
+ u"title_edit_static_portlet",
+ default=u"Edit static text portlet"
+ )
+ description = _(
+ u"description_static_portlet",
+ default=u"A portlet which can display static HTML text."
+ )
diff --git a/plone/portlet/static/testing.py b/plone/portlet/static/testing.py
index 345d4d8..e486b4e 100644
--- a/plone/portlet/static/testing.py
+++ b/plone/portlet/static/testing.py
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-
-
-from zope.configuration import xmlconfig
-
-from plone.testing import z2
-
+from plone.app.testing import PloneSandboxLayer
from plone.app.testing import TEST_USER_ID
from plone.app.testing import TEST_USER_NAME
-from plone.app.testing import setRoles
-from plone.app.testing import login
-from plone.app.testing import PloneSandboxLayer
from plone.app.testing import applyProfile
+from plone.app.testing import login
+from plone.app.testing import setRoles
from plone.app.testing.layers import IntegrationTesting
+from plone.testing import z2
+from zope.configuration import xmlconfig
class PlonePortletStaticLayer(PloneSandboxLayer):
@@ -32,10 +29,12 @@ def setUpPloneSite(self, portal):
applyProfile(portal, 'plone.portlet.static:default')
setRoles(portal, TEST_USER_ID, ['Manager'])
login(portal, TEST_USER_NAME)
- portal.acl_users.userFolderAddUser('admin',
- 'secret',
- ['Manager'],
- [])
+ portal.acl_users.userFolderAddUser(
+ 'admin',
+ 'secret',
+ ['Manager'],
+ []
+ )
portal.invokeFactory(
"Folder",
id="test-folder",
@@ -49,4 +48,5 @@ def tearDownZope(self, app):
PLONEPORTLETSTATIC_INTEGRATION_TESTING = IntegrationTesting(
bases=(PLONEPORTLETSTATIC_FIXTURE,),
- name="PloneAppCollectionLayer:Integration")
+ name="PloneAppCollectionLayer:Integration"
+)
diff --git a/plone/portlet/static/tests/__init__.py b/plone/portlet/static/tests/__init__.py
index 792d600..40a96af 100644
--- a/plone/portlet/static/tests/__init__.py
+++ b/plone/portlet/static/tests/__init__.py
@@ -1 +1 @@
-#
+# -*- coding: utf-8 -*-
diff --git a/setup.py b/setup.py
index ebe4ebd..e9719b9 100644
--- a/setup.py
+++ b/setup.py
@@ -8,16 +8,16 @@ def read(*rnames):
version = '3.0.1.dev0'
long_description = (
- read('README.txt')
+ read('README.rst')
+ '\n' +
- read('CHANGES.txt')
+ read('CHANGES.rst')
+ '\n'
)
setup(name='plone.portlet.static',
version=version,
- description="A simple static HTML portlet for Plone.",
+ description="An editable static HTML portlet for Plone.",
long_description=long_description,
classifiers=[
"Environment :: Web Environment",
-------------------------------------------------------------------------------
More information about the Testbot
mailing list