Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imports are Python3 compatible #82

Merged
merged 1 commit into from
Oct 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Bug fixes:
fields on non-default fieldset
[datakurre]

- Imports are Python3 compatible
[b4oshany]

2.2.0 (2017-06-09)
------------------
Expand Down
4 changes: 3 additions & 1 deletion plone/app/standardtiles/existingcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from zope.component.hooks import getSite
from zope.interface import Invalid

import six


def uuidToObject(uuid):
"""Given a UUID, attempt to return a content object. Will return
Expand Down Expand Up @@ -174,7 +176,7 @@ def item_macros(self):
def item_panels(self):
default_view = self.default_view
html = default_view()
if isinstance(html, unicode):
if isinstance(html, six.text_type):
html = html.encode('utf-8')
serializer = getHTMLSerializer([html], pretty_print=False,
encoding='utf-8')
Expand Down
5 changes: 2 additions & 3 deletions plone/app/standardtiles/portlets/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from plone.app.tiles.browser.edit import DefaultEditView
from plone.portlets.utils import unhashPortletInfo
from plone.uuid.interfaces import IUUIDGenerator
from six.moves import urllib
from zope.component import getUtility

import urllib


class PortletTileEditView(DefaultEditView):
""" Override the tile edit view for the portlet tile and redirect it to the
Expand Down Expand Up @@ -33,5 +32,5 @@ def __call__(self):
)
self.request.form['referer'] = tile_url
self.request.response.redirect(
'{0}?referer={0}'.format(url, urllib.quote(tile_url))
'{0}?referer={0}'.format(url, urllib.parse.quote(tile_url))
)
5 changes: 3 additions & 2 deletions plone/app/standardtiles/tests/test_existing_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
from unittest import TestCase
from zope.component import createObject
from zope.component import queryUtility

import random
import StringIO
import six
import transaction


Expand All @@ -31,7 +32,7 @@ def image():
random.randint(0, 255)))
del draw

output = StringIO.StringIO()
output = six.StringIO()
img.save(output, 'PNG')
output.seek(0)

Expand Down
11 changes: 6 additions & 5 deletions plone/app/standardtiles/tests/test_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
from plone.namedfile import NamedImage
from plone.protect.authenticator import createToken
from plone.testing.z2 import Browser
from six.moves import urllib
from six.moves.urllib.parse import quote
from unittest import TestCase
from urllib import quote
from zope.annotation import IAnnotations

import os
import plone.app.standardtiles.tests as test_dir
import random
import StringIO
import six
import transaction
import urllib


def fromstring(s):
Expand All @@ -39,7 +40,7 @@ def image():
random.randint(0, 255)))
del draw

output = StringIO.StringIO()
output = six.StringIO()
img.save(output, 'PNG')
output.seek(0)

Expand Down Expand Up @@ -230,7 +231,7 @@ def test_rawhtml_tile(self):
self.browser.open(
self.pageURL +
'/@@plone.app.standardtiles.rawhtml/test',
data='content={0:s}'.format(urllib.quote(content))
data='content={0:s}'.format(urllib.parse.quote(content))
)

root = fromstring(self.browser.contents)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'Products.CMFPlone>=5.0.4',
'requests',
'setuptools',
'six',
'z3c.form',
],
extras_require={
Expand Down