Skip to content

Commit

Permalink
Merge pull request #64 from plone/python3
Browse files Browse the repository at this point in the history
Python3
  • Loading branch information
pbauer authored Sep 17, 2018
2 parents 767c95d + 05a7a62 commit 1eb4806
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ New features:

Bug fixes:

- *add item here*
- Some Python 3 fixes.
[pbauer]


3.3.8 (2018-06-18)
Expand Down
2 changes: 1 addition & 1 deletion plone/app/iterate/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from zope.component import adapter
from zope.interface import implementer

import interfaces
from . import interfaces


@implementer(interfaces.IObjectArchiver)
Expand Down
2 changes: 1 addition & 1 deletion plone/app/iterate/copier.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from Products.Archetypes.Referenceable import Referenceable
from Products.CMFCore.utils import getToolByName
from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
from relation import WorkingCopyRelation
from .relation import WorkingCopyRelation
from ZODB.PersistentMapping import PersistentMapping
from zope import component
from zope import interface
Expand Down
6 changes: 3 additions & 3 deletions plone/app/iterate/dexterity/copier.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ def _get_relation_to_baseline(self):
id = intids.getId(context)
# ask catalog
catalog = component.getUtility(ICatalog)
relations = list(catalog.findRelations({'to_id': id}))
relations = filter(lambda r: r.from_attribute == ITERATE_RELATION_NAME,
relations)
relations = catalog.findRelations({'to_id': id})
relations = [i for i in relations
if i.from_attribute == ITERATE_RELATION_NAME]
# do we have a baseline in our relations?
if relations and not len(relations) == 1:
raise interfaces.CheckinException('Baseline count mismatch')
Expand Down
2 changes: 1 addition & 1 deletion plone/app/iterate/dexterity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_relations(context):
lambda r: r.from_attribute == ITERATE_RELATION_NAME,
relations
)
return relations
return list(relations)


def get_checkout_relation(context):
Expand Down
2 changes: 1 addition & 1 deletion plone/app/iterate/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from zope.event import notify
from zope.interface import implementer

import interfaces
from . import interfaces


@implementer(interfaces.ICheckoutEvent)
Expand Down
7 changes: 3 additions & 4 deletions plone/app/iterate/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##################################################################

from Products.CMFCore.permissions import setDefaultRoles

from AccessControl.Permission import addPermission

CheckinPermission = 'iterate : Check in content'
CheckoutPermission = 'iterate : Check out content'

DEFAULT_ROLES = ('Manager', 'Owner', 'Site Administrator', 'Editor')
setDefaultRoles(CheckinPermission, DEFAULT_ROLES)
setDefaultRoles(CheckoutPermission, DEFAULT_ROLES)
addPermission(CheckinPermission, default_roles=DEFAULT_ROLES)
addPermission(CheckoutPermission, default_roles=DEFAULT_ROLES)
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
'Environment :: Web Environment',
'Framework :: Plone',
'Framework :: Plone :: 5.1',
'Framework :: Plone :: 5.2',
'Framework :: Zope2',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords='check-out check-in staging',
author='Plone Foundation',
Expand Down

1 comment on commit 1eb4806

@jenkins-plone-org
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pbauer Jenkins CI reporting about code analysis
See the full report here: https://jenkins.plone.org/job/package-plone.app.iterate/74/violations

plone/app/iterate/copier.py:37:1: I001 isort found an import in the wrong position
plone/app/iterate/policy.py:57:45: C812 missing trailing comma
plone/app/iterate/policy.py:66:11: T000 Todo note found.
plone/app/iterate/permissions.py:26:1: I003 isort expected 1 blank line in imports, found 0
plone/app/iterate/base.py:160:22: W292 no newline at end of file
plone/app/iterate/testing.py:147:80: E501 line too long (83 > 79 characters)
plone/app/iterate/interfaces.py:321:23: C812 missing trailing comma
plone/app/iterate/interfaces.py:328:22: C812 missing trailing comma
plone/app/iterate/__init__.py:48:78: C812 missing trailing comma
plone/app/iterate/setuphandlers.py:11:27: C812 missing trailing comma
plone/app/iterate/event.py:28:1: I004 isort found an unexpected blank line in imports
plone/app/iterate/event.py:29:1: I001 isort found an import in the wrong position
plone/app/iterate/containers.py:72:50: C812 missing trailing comma
plone/app/iterate/containers.py:73:14: C812 missing trailing comma
plone/app/iterate/archiver.py:26:1: I004 isort found an unexpected blank line in imports
plone/app/iterate/archiver.py:27:1: I001 isort found an import in the wrong position
plone/app/iterate/browser/checkout.py:70:33: C812 missing trailing comma
plone/app/iterate/dexterity/copier.py:5:1: I001 isort found an import in the wrong position
plone/app/iterate/dexterity/copier.py:67:19: T000 Todo note found.
plone/app/iterate/dexterity/copier.py:157:50: C812 missing trailing comma
plone/app/iterate/dexterity/utils.py:25:18: C812 missing trailing comma
plone/app/iterate/tests/test_iterate.py:171:80: E501 line too long (97 > 79 characters)
plone/app/iterate/tests/test_iterate_at.py:35:1: I003 isort expected 1 blank line in imports, found 0
plone/app/iterate/tests/test_iterate_at.py:42:5: E301 expected 1 blank line, found 0
plone/app/iterate/tests/test_iterate_at.py:52:80: E501 line too long (85 > 79 characters)
plone/app/iterate/tests/test_iterate_at.py:154:11: T000 Todo note found.
plone/app/iterate/tests/test_iterate_at.py:302:80: E501 line too long (97 > 79 characters)
plone/app/iterate/tests/test_doctests.py:6:1: I003 isort expected 1 blank line in imports, found 0
plone/app/iterate/tests/test_doctests.py:7:1: I003 isort expected 1 blank line in imports, found 0
plone/app/iterate/tests/test_doctests.py:9:5: F401 'Products.ATContentTypes' imported but unused
plone/app/iterate/tests/test_doctests.py:26:54: C812 missing trailing comma
plone/app/iterate/tests/test_doctests.py:34:53: C812 missing trailing comma

Follow these instructions to reproduce it locally.

Please sign in to comment.