From f0a9d9ad6bec8804ff546f79709bf1547e6d47ad Mon Sep 17 00:00:00 2001 From: tisto Date: Sun, 15 Dec 2013 12:02:32 +0100 Subject: [PATCH] Pep8 --- plone/app/discussion/patches.py | 2 -- plone/app/discussion/subscribers.py | 3 ++- plone/app/discussion/tests/test_catalog.py | 2 -- plone/app/discussion/tests/test_conversation.py | 2 +- plone/app/discussion/tests/test_moderation_view.py | 2 -- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/plone/app/discussion/patches.py b/plone/app/discussion/patches.py index f803f10..9491702 100644 --- a/plone/app/discussion/patches.py +++ b/plone/app/discussion/patches.py @@ -1,7 +1,5 @@ from Products.CMFCore.utils import getToolByName -from zope.component import queryUtility - from Acquisition import aq_inner, aq_parent from zope.annotation.interfaces import IAnnotations diff --git a/plone/app/discussion/subscribers.py b/plone/app/discussion/subscribers.py index 20ac7ad..07e0bb5 100644 --- a/plone/app/discussion/subscribers.py +++ b/plone/app/discussion/subscribers.py @@ -1,14 +1,15 @@ from Products.CMFCore.utils import getToolByName + def index_object(obj, event): """Index the object when it is added to the conversation. """ catalog = getToolByName(obj, 'portal_catalog') return catalog.reindexObject(obj) + def unindex_object(obj, event): """Unindex the object when it is removed from the conversation. """ catalog = getToolByName(obj, 'portal_catalog') return catalog.unindexObject(obj) - diff --git a/plone/app/discussion/tests/test_catalog.py b/plone/app/discussion/tests/test_catalog.py index 8c5291a..cbe8df6 100644 --- a/plone/app/discussion/tests/test_catalog.py +++ b/plone/app/discussion/tests/test_catalog.py @@ -19,8 +19,6 @@ from plone.app.discussion.testing import ( from plone.app.discussion.interfaces import IConversation -from plone.app.discussion.testing import COLLECTION_TYPE - class CatalogSetupTest(unittest.TestCase): diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index 770e3af..278adb5 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -308,7 +308,7 @@ class ConversationTest(unittest.TestCase): # Create a folder self.typetool.constructContent('Folder', self.portal, 'f1') - f1 = self.portal.f1 + # Usually we don't create a conversation on a folder conversation = self.portal.f1.restrictedTraverse('@@conversation_view') diff --git a/plone/app/discussion/tests/test_moderation_view.py b/plone/app/discussion/tests/test_moderation_view.py index 33064b6..c821200 100644 --- a/plone/app/discussion/tests/test_moderation_view.py +++ b/plone/app/discussion/tests/test_moderation_view.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- import unittest -from DateTime import DateTime - from zope.component import createObject from Products.CMFCore.utils import getToolByName