Skip to content

Commit

Permalink
find -name "*.py" -exec pyupgrade --py3-only --py37-plus {} +
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Apr 30, 2022
1 parent 82c55fc commit b665b88
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 28 deletions.
1 change: 0 additions & 1 deletion plone/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
__import__("pkg_resources").declare_namespace(__name__)
1 change: 0 additions & 1 deletion plone/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
__import__("pkg_resources").declare_namespace(__name__)
1 change: 0 additions & 1 deletion plone/app/contentlisting/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# -*- coding: utf-8 -*-
1 change: 0 additions & 1 deletion plone/app/contentlisting/browser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from plone.app.contentlisting.interfaces import IContentListing
from Products.CMFCore.utils import getToolByName
from zope.publisher.browser import BrowserView
Expand Down
3 changes: 1 addition & 2 deletions plone/app/contentlisting/catalog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_base
from plone.app.contentlisting.contentlisting import BaseContentListingObject
from plone.app.contentlisting.interfaces import IContentListingObject
Expand Down Expand Up @@ -30,7 +29,7 @@ def __init__(self, brain):
def __repr__(self):
return (
"<plone.app.contentlisting.catalog."
"CatalogContentListingObject instance at {0}>".format(
"CatalogContentListingObject instance at {}>".format(
self.getPath(),
)
)
Expand Down
6 changes: 2 additions & 4 deletions plone/app/contentlisting/contentlisting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from Acquisition import aq_base
from plone.app.contentlisting.interfaces import IContentListing
from plone.app.contentlisting.interfaces import IContentListingObject
Expand All @@ -17,7 +15,7 @@


@implementer(IContentListing)
class ContentListing(object):
class ContentListing:
"""An IContentListing implementation based on sequences of objects."""

def __init__(self, sequence):
Expand Down Expand Up @@ -106,7 +104,7 @@ def __getslice__(self, i, j):
return IContentListing(self._basesequence[i:j])


class BaseContentListingObject(object):
class BaseContentListingObject:
"""A baseclass for the different types of contentlistingobjects.
To avoid duplication of the stuff that is not implementation-specific.
Expand Down
1 change: 0 additions & 1 deletion plone/app/contentlisting/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from Products.CMFCore.interfaces import IDublinCore
from zope.interface.common.sequence import IReadSequence

Expand Down
3 changes: 1 addition & 2 deletions plone/app/contentlisting/realobject.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_base
from Acquisition import aq_get
from plone.app.contentlisting.contentlisting import BaseContentListingObject
Expand All @@ -24,7 +23,7 @@ def __init__(self, obj):
def __repr__(self):
return (
"<plone.app.contentlisting.realobject."
"RealContentListingObject instance at {0}>".format(
"RealContentListingObject instance at {}>".format(
self.getPath(),
)
)
Expand Down
1 change: 0 additions & 1 deletion plone/app/contentlisting/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE
from plone.app.testing import FunctionalTesting
from plone.app.testing import IntegrationTesting
Expand Down
2 changes: 0 additions & 2 deletions plone/app/contentlisting/tests/test_integration_doctest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from plone.app.contentlisting.tests.base import (
CONTENTLISTING_FUNCTIONAL_TESTING, # NOQA: E501
)
Expand Down
21 changes: 10 additions & 11 deletions plone/app/contentlisting/tests/test_integration_unit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from plone.app.contentlisting.interfaces import IContentListing
from plone.app.contentlisting.interfaces import IContentListingObject
from plone.app.contentlisting.tests.base import (
Expand All @@ -17,7 +16,7 @@ class TestSetup(unittest.TestCase):
layer = CONTENTLISTING_FUNCTIONAL_TESTING

def setUp(self):
super(TestSetup, self).setUp()
super().setUp()
self.portal = self.layer["portal"]
self.folder = self.portal["test-folder"]
self.workflow = getToolByName(self.portal, "portal_workflow")
Expand Down Expand Up @@ -70,7 +69,7 @@ class TestIndividualCatalogContentItems(unittest.TestCase):
layer = CONTENTLISTING_FUNCTIONAL_TESTING

def setUp(self):
super(TestIndividualCatalogContentItems, self).setUp()
super().setUp()
self.portal = self.layer["portal"]
self.folder = self.portal["test-folder"]
self.folder.invokeFactory(
Expand Down Expand Up @@ -144,8 +143,8 @@ def test_item_reviewState(self):
self.assertEqual(self.item.review_state(), wf)

def test_item_Type(self):
self.assertEqual(self.item.Type(), u"Page")
self.assertEqual(self.item.Type().domain, u"plone")
self.assertEqual(self.item.Type(), "Page")
self.assertEqual(self.item.Type().domain, "plone")

def test_appendViewAction(self):
# checking that we append the view action to urls when needed
Expand Down Expand Up @@ -178,7 +177,7 @@ class TestIndividualRealContentItems(unittest.TestCase):
layer = CONTENTLISTING_FUNCTIONAL_TESTING

def setUp(self):
super(TestIndividualRealContentItems, self).setUp()
super().setUp()
self.portal = self.layer["portal"]
self.folder = self.portal["test-folder"]
self.folder.invokeFactory(
Expand Down Expand Up @@ -243,8 +242,8 @@ def test_item_reviewState(self):
self.assertEqual(self.item.review_state(), wf)

def test_item_Type(self):
self.assertEqual(self.item.Type(), u"Page")
self.assertEqual(self.item.Type().domain, u"plone")
self.assertEqual(self.item.Type(), "Page")
self.assertEqual(self.item.Type().domain, "plone")

def test_item_ContentTypeClass(self):
# checking the that we print nice strings for css class identifiers
Expand Down Expand Up @@ -274,7 +273,7 @@ class TestFolderContents(unittest.TestCase):
layer = CONTENTLISTING_FUNCTIONAL_TESTING

def setUp(self):
super(TestFolderContents, self).setUp()
super().setUp()
self.portal = self.layer["portal"]
self.folder = self.portal["test-folder"]

Expand Down Expand Up @@ -337,11 +336,11 @@ class TestCollectionResults(unittest.TestCase):
layer = CONTENTLISTING_FUNCTIONAL_TESTING

def setUp(self):
super(TestCollectionResults, self).setUp()
super().setUp()
self.portal = self.layer["portal"]
self.folder = self.portal["test-folder"]
setRoles(self.portal, TEST_USER_ID, ["Manager"])
self.portal.invokeFactory("Collection", "collection", title=u"Col")
self.portal.invokeFactory("Collection", "collection", title="Col")
collection = self.portal.collection
collection.query = [
{
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read(*rnames):

version = "2.0.8.dev0"

long_description = "{0}\n\n{1}".format(read("README.rst"), read("CHANGES.rst"))
long_description = "{}\n\n{}".format(read("README.rst"), read("CHANGES.rst"))

setup(
name="plone.app.contentlisting",
Expand Down

0 comments on commit b665b88

Please sign in to comment.