Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Jul 25, 2024
1 parent e4d6c79 commit d6d555d
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 67 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
1 change: 0 additions & 1 deletion src/collective/feedback/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
"""Init and utils."""
from zope.i18nmessageid import MessageFactory


_ = MessageFactory("collective.feedback")
2 changes: 1 addition & 1 deletion src/collective/feedback/locales/update.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

import os
import pkg_resources
import subprocess

import pkg_resources

domain = "collective.feedback"
os.chdir(pkg_resources.resource_filename(domain, ""))
Expand Down
3 changes: 2 additions & 1 deletion src/collective/feedback/restapi/services/add.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from collective.feedback.interfaces import ICollectiveFeedbackStore
from plone import api
from plone.protect.interfaces import IDisableCSRFProtection
from plone.restapi.deserializer import json_body
Expand All @@ -7,6 +6,8 @@
from zope.component import getUtility
from zope.interface import alsoProvides

from collective.feedback.interfaces import ICollectiveFeedbackStore


class FeedbackAdd(Service):
"""
Expand Down
6 changes: 3 additions & 3 deletions src/collective/feedback/restapi/services/delete.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from collective.feedback.interfaces import ICollectiveFeedbackStore
from plone.protect.interfaces import IDisableCSRFProtection
from plone.restapi.services import Service
from zExceptions import BadRequest
from zope.component import getUtility
from zope.interface import alsoProvides
from zope.interface import implementer
from zope.interface import alsoProvides, implementer
from zope.publisher.interfaces import IPublishTraverse

from collective.feedback.interfaces import ICollectiveFeedbackStore


@implementer(IPublishTraverse)
class FeedbackDelete(Service):
Expand Down
7 changes: 4 additions & 3 deletions src/collective/feedback/restapi/services/get.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from AccessControl import Unauthorized
from collective.feedback.interfaces import ICollectiveFeedbackStore
import csv
from copy import deepcopy
from datetime import datetime

from AccessControl import Unauthorized
from plone import api
from plone.restapi.batching import HypermediaBatch
from plone.restapi.search.utils import unflatten_dotted_dict
Expand All @@ -12,7 +13,7 @@
from zope.interface import implementer
from zope.publisher.interfaces import IPublishTraverse

import csv
from collective.feedback.interfaces import ICollectiveFeedbackStore


@implementer(IPublishTraverse)
Expand Down
3 changes: 2 additions & 1 deletion src/collective/feedback/restapi/services/update.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from collective.feedback.interfaces import ICollectiveFeedbackStore
from plone import api
from plone.protect.interfaces import IDisableCSRFProtection
from plone.restapi.deserializer import json_body
Expand All @@ -8,6 +7,8 @@
from zope.interface import alsoProvides, implementer
from zope.publisher.interfaces import IPublishTraverse

from collective.feedback.interfaces import ICollectiveFeedbackStore


@implementer(IPublishTraverse)
class FeedbackUpdate(Service):
Expand Down
3 changes: 1 addition & 2 deletions src/collective/feedback/storage/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from repoze.catalog.indexes.field import CatalogFieldIndex
from repoze.catalog.indexes.text import CatalogTextIndex
from souper.interfaces import ICatalogFactory
from souper.soup import NodeAttributeIndexer
from souper.soup import NodeTextIndexer
from souper.soup import NodeAttributeIndexer, NodeTextIndexer
from zope.interface import implementer


Expand Down
16 changes: 6 additions & 10 deletions src/collective/feedback/storage/store.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# -*- coding: utf-8 -*-
from collective.feedback.interfaces import ICollectiveFeedbackStore
import logging
from datetime import datetime
from plone import api
from repoze.catalog.query import And
from repoze.catalog.query import Any
from repoze.catalog.query import Contains
from repoze.catalog.query import Eq
from souper.soup import get_soup
from souper.soup import Record
from zope.interface import implementer

import logging
import six
from plone import api
from repoze.catalog.query import And, Any, Contains, Eq
from souper.soup import Record, get_soup
from zope.interface import implementer

from collective.feedback.interfaces import ICollectiveFeedbackStore

logger = logging.getLogger(__name__)

Expand Down
17 changes: 9 additions & 8 deletions src/collective/feedback/testing.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE
from plone.app.testing import applyProfile
from plone.app.testing import FunctionalTesting
from plone.app.testing import IntegrationTesting
from plone.app.testing import PloneSandboxLayer
from plone.testing.zope import WSGI_SERVER_FIXTURE

import collective.feedback
import collective.honeypot
import collective.honeypot.config
import plone.restapi
import souper.plone
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE
from plone.app.testing import (
FunctionalTesting,
IntegrationTesting,
PloneSandboxLayer,
applyProfile,
)
from plone.testing.zope import WSGI_SERVER_FIXTURE

import collective.feedback

collective.honeypot.config.EXTRA_PROTECTED_ACTIONS = set(["feedback-add"])
collective.honeypot.config.HONEYPOT_FIELD = "honey"
Expand Down
22 changes: 12 additions & 10 deletions src/collective/feedback/tests/test_delete_content.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# -*- coding: utf-8 -*-
from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import RESTAPI_TESTING
import unittest
from datetime import datetime

import transaction
from plone import api
from plone.app.testing import setRoles
from plone.app.testing import SITE_OWNER_NAME
from plone.app.testing import SITE_OWNER_PASSWORD
from plone.app.testing import TEST_USER_ID
from plone.app.testing import (
SITE_OWNER_NAME,
SITE_OWNER_PASSWORD,
TEST_USER_ID,
setRoles,
)
from plone.restapi.testing import RelativeSession
from souper.soup import get_soup
from souper.soup import Record
from souper.soup import Record, get_soup
from zope.component import getUtility

import transaction
import unittest
from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import RESTAPI_TESTING


class TestCustomerSatisfactionGet(unittest.TestCase):
Expand Down
19 changes: 11 additions & 8 deletions src/collective/feedback/tests/test_feedbacks_add.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# -*- coding: utf-8 -*-
from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import RESTAPI_TESTING
import unittest

import transaction
from plone import api
from plone.app.testing import setRoles
from plone.app.testing import SITE_OWNER_NAME
from plone.app.testing import SITE_OWNER_PASSWORD
from plone.app.testing import TEST_USER_ID
from plone.app.testing import (
SITE_OWNER_NAME,
SITE_OWNER_PASSWORD,
TEST_USER_ID,
setRoles,
)
from plone.restapi.testing import RelativeSession
from zope.component import getUtility

import transaction
import unittest
from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import RESTAPI_TESTING


class TestAdd(unittest.TestCase):
Expand Down
22 changes: 12 additions & 10 deletions src/collective/feedback/tests/test_feedbacks_get.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# -*- coding: utf-8 -*-
from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import RESTAPI_TESTING
import unittest
from datetime import datetime

import transaction
from plone import api
from plone.app.testing import setRoles
from plone.app.testing import SITE_OWNER_NAME
from plone.app.testing import SITE_OWNER_PASSWORD
from plone.app.testing import TEST_USER_ID
from plone.app.testing import (
SITE_OWNER_NAME,
SITE_OWNER_PASSWORD,
TEST_USER_ID,
setRoles,
)
from plone.restapi.serializer.converters import json_compatible
from plone.restapi.testing import RelativeSession
from souper.soup import get_soup
from souper.soup import Record
from souper.soup import Record, get_soup
from zope.component import getUtility

import transaction
import unittest
from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import RESTAPI_TESTING


class TestGet(unittest.TestCase):
Expand Down
12 changes: 6 additions & 6 deletions src/collective/feedback/tests/test_store.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import FUNCTIONAL_TESTING
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from zope.component import getUtility
import unittest

import transaction
import unittest
from plone.app.testing import TEST_USER_ID, setRoles
from zope.component import getUtility

from collective.feedback.interfaces import ICollectiveFeedbackStore
from collective.feedback.testing import FUNCTIONAL_TESTING


class TestTool(unittest.TestCase):
Expand Down
5 changes: 2 additions & 3 deletions src/collective/feedback/upgrades.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
from plone import api
from plone.app.upgrade.utils import installOrReinstallProduct

import logging

from plone import api
from plone.app.upgrade.utils import installOrReinstallProduct

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit d6d555d

Please sign in to comment.