Skip to content

Commit

Permalink
chore: isort plone (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico authored Jan 21, 2025
1 parent 44890db commit e98116e
Show file tree
Hide file tree
Showing 122 changed files with 438 additions and 527 deletions.
3 changes: 1 addition & 2 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[settings]
profile=black
force_single_line=True
profile=plone
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog
2.8.5 (unreleased)
------------------

- Nothing changed yet.
- isort with plone profile
[mamico]


2.8.4 (2024-12-02)
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import os
import sys


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from setuptools import find_packages
from setuptools import setup


long_description = "\n\n".join(
[
open("README.rst").read(),
Expand Down
15 changes: 8 additions & 7 deletions src/redturtle/prenotazioni/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-
from AccessControl import Unauthorized
from App.config import getConfiguration
from datetime import datetime
from datetime import timedelta
from DateTime import DateTime
from dateutil.tz.tz import tzutc
from logging import FileHandler
from logging import Formatter
from logging import getLogger

import dateutil
import pytz
from AccessControl import Unauthorized
from App.config import getConfiguration
from DateTime import DateTime
from dateutil.tz.tz import tzutc
from OFS.CopySupport import CopyError
from plone import api
from plone.api.exc import UserNotFoundError
Expand All @@ -19,6 +16,10 @@
from zope.globalrequest import getRequest
from zope.i18nmessageid import MessageFactory

import dateutil
import pytz


logger = getLogger("redturtle.prenotazioni")
_ = MessageFactory("redturtle.prenotazioni")

Expand Down
6 changes: 3 additions & 3 deletions src/redturtle/prenotazioni/actions/mail.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import six
from Acquisition import aq_base
from Acquisition import aq_inner
from collective.contentrules.mailfromfield import logger
Expand All @@ -11,12 +10,13 @@
from plone.dexterity.interfaces import IDexterityContainer
from plone.event.interfaces import IICalendar
from Products.CMFPlone.interfaces.siteroot import IPloneSiteRoot
from redturtle.prenotazioni.prenotazione_event import IMovedPrenotazione
from six.moves import filter
from zope.component import adapter
from zope.interface import Interface
from zope.interface import implementer
from zope.interface import Interface

from redturtle.prenotazioni.prenotazione_event import IMovedPrenotazione
import six


class MailActionExecutor(BaseExecutor):
Expand Down
23 changes: 11 additions & 12 deletions src/redturtle/prenotazioni/adapters/booker.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# -*- coding: utf-8 -*-
import math
from datetime import datetime
from datetime import timedelta
from random import choice

from DateTime import DateTime
from plone import api
from plone.memoize.instance import memoize
from six.moves.urllib.parse import parse_qs
from six.moves.urllib.parse import urlparse
from zope.annotation.interfaces import IAnnotations
from zope.component import Interface
from zope.component import getMultiAdapter
from zope.event import notify
from zope.interface import implementer
from ZTUtils.Lazy import LazyMap

from random import choice
from redturtle.prenotazioni import _
from redturtle.prenotazioni import datetime_with_tz
from redturtle.prenotazioni import logger
Expand All @@ -31,6 +20,16 @@
from redturtle.prenotazioni.interfaces import IBookingEmailMessage
from redturtle.prenotazioni.interfaces import IBookingNotificationSender
from redturtle.prenotazioni.prenotazione_event import MovedPrenotazione
from six.moves.urllib.parse import parse_qs
from six.moves.urllib.parse import urlparse
from zope.annotation.interfaces import IAnnotations
from zope.component import getMultiAdapter
from zope.component import Interface
from zope.event import notify
from zope.interface import implementer
from ZTUtils.Lazy import LazyMap

import math


class IBooker(Interface):
Expand Down
7 changes: 3 additions & 4 deletions src/redturtle/prenotazioni/adapters/booking_code.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
import hashlib

from zope.component import Interface
from redturtle.prenotazioni.content.prenotazione import IPrenotazione
from zope.component import adapter
from zope.component import Interface
from zope.interface import implementer

from redturtle.prenotazioni.content.prenotazione import IPrenotazione
import hashlib


class IBookingCodeGenerator(Interface):
Expand Down
5 changes: 2 additions & 3 deletions src/redturtle/prenotazioni/adapters/conflict.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# -*- coding: utf-8 -*-
from datetime import timedelta

import six
from plone.memoize.instance import memoize
from Products.CMFCore.utils import getToolByName
from redturtle.prenotazioni.adapters.slot import BaseSlot
from six.moves import range
from zope.component import Interface
from zope.interface import implementer

from redturtle.prenotazioni.adapters.slot import BaseSlot
import six


class IConflictManager(Interface):
Expand Down
6 changes: 3 additions & 3 deletions src/redturtle/prenotazioni/adapters/ical.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# -*- coding: utf-8 -*-
import icalendar
from Acquisition import aq_inner
from plone import api
from plone.app.event.base import default_timezone
from plone.app.event.ical.exporter import ICalendarEventComponent
from plone.app.event.ical.exporter import PRODID
from plone.app.event.ical.exporter import VERSION
from plone.app.event.ical.exporter import ICalendarEventComponent
from plone.event.interfaces import IICalendar
from plone.event.interfaces import IICalendarEventComponent
from plone.registry.interfaces import IRegistry
from plone.stringinterp.interfaces import IContextWrapper
from plone.stringinterp.interfaces import IStringSubstitution
from redturtle.prenotazioni import _
from zope.annotation.interfaces import IAnnotations
from zope.component import getAdapter
from zope.component import getUtility
from zope.interface import implementer

from redturtle.prenotazioni import _
import icalendar


def construct_icalendar(context, bookings):
Expand Down
4 changes: 2 additions & 2 deletions src/redturtle/prenotazioni/adapters/stringinterp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from plone.app.event.base import default_timezone
from plone.app.layout.viewlets.content import ContentHistoryViewlet
from plone.stringinterp.adapters import BaseSubstitution
from redturtle.prenotazioni import _
from redturtle.prenotazioni import logger
from zope.component import adapter
from zope.globalrequest import getRequest
from zope.interface import Interface

from redturtle.prenotazioni import _
from redturtle.prenotazioni import logger

try:
from plone.app.event.base import spell_date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
from plone.autoform.interfaces import IFormFieldProvider
from plone.dexterity.interfaces import IDexterityContent
from plone.supermodel import model
from redturtle.prenotazioni import _
from zope import schema
from zope.component import adapter
from zope.interface import implementer
from zope.interface import provider

from redturtle.prenotazioni import _


@provider(IFormFieldProvider)
class IContacts(model.Schema):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
from .appio.adapters import app_io_allowed_for
from functools import wraps

from Products.CMFCore.utils import getToolByName

from redturtle.prenotazioni import _

from .appio.adapters import app_io_allowed_for


def get_booking_folder_notification_flags(booking_folder):
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
from plone.autoform.interfaces import IFormFieldProvider
from plone.dexterity.interfaces import IDexterityContent
from plone.supermodel import model
from redturtle.prenotazioni import _
from zope import schema
from zope.component import adapter
from zope.interface import implementer
from zope.interface import provider
from zope.schema.interfaces import IContextAwareDefaultFactory

from redturtle.prenotazioni import _


@provider(IContextAwareDefaultFactory)
def notify_on_submit_appio_subject_default_factory(context):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# -*- coding: utf-8 -*-
from plone import api
from zope.component import adapter
from zope.component import getUtility
from zope.interface import implementer
from zope.schema.interfaces import IVocabularyFactory

from redturtle.prenotazioni import logger
from redturtle.prenotazioni.content.prenotazione import IPrenotazione
from redturtle.prenotazioni.interfaces import IBookingAPPIoMessage
Expand All @@ -13,6 +8,10 @@
from redturtle.prenotazioni.interfaces import IRedturtlePrenotazioniLayer
from redturtle.prenotazioni.io_tools.api import Api
from redturtle.prenotazioni.io_tools.storage import logstorage
from zope.component import adapter
from zope.component import getUtility
from zope.interface import implementer
from zope.schema.interfaces import IVocabularyFactory


# TODO: ramcache ?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# -*- coding: utf-8 -*-
from .. import notify_the_message_failure
from . import INotificationAppIO
from functools import partial

from zope.component import getMultiAdapter
from zope.globalrequest import getRequest

from redturtle.prenotazioni.interfaces import IBookingAPPIoMessage
from redturtle.prenotazioni.interfaces import IBookingNotificationSender
from redturtle.prenotazioni.utilities import handle_exception_by_log

from .. import notify_the_message_failure
from . import INotificationAppIO
from zope.component import getMultiAdapter
from zope.globalrequest import getRequest


def booking_folder_provides_current_behavior(booking):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
from plone.stringinterp.interfaces import IContextWrapper
from plone.stringinterp.interfaces import IStringInterpolator
from Products.DCWorkflow.interfaces import IAfterTransitionEvent
from zope.component import adapter
from zope.interface import implementer

from redturtle.prenotazioni import _
from redturtle.prenotazioni.content.prenotazione import IPrenotazione
from redturtle.prenotazioni.interfaces import IBookingAPPIoMessage
from redturtle.prenotazioni.interfaces import IBookingReminderEvent
from redturtle.prenotazioni.prenotazione_event import IMovedPrenotazione
from zope.component import adapter
from zope.interface import implementer


class PrenotazioneAPPIoMessage:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
import os
from logging import getLogger

import yaml
from zope.interface import implementer
from zope.schema.interfaces import IVocabularyFactory
from zope.schema.vocabulary import SimpleTerm
from zope.schema.vocabulary import SimpleVocabulary

import os
import yaml


logger = getLogger(__name__)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
from plone.autoform.interfaces import IFormFieldProvider
from plone.dexterity.interfaces import IDexterityContent
from plone.supermodel import model
from redturtle.prenotazioni import _
from zope import schema
from zope.component import adapter
from zope.interface import implementer
from zope.interface import provider
from zope.schema.interfaces import IContextAwareDefaultFactory

from redturtle.prenotazioni import _


@provider(IContextAwareDefaultFactory)
def notify_on_submit_subject_default_factory(context):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# -*- coding: utf-8 -*-
from zope.component import adapter
from zope.component import getUtility
from zope.interface import implementer

from .. import write_message_to_object_history
from redturtle.prenotazioni import logger
from redturtle.prenotazioni.content.prenotazione import IPrenotazione
from redturtle.prenotazioni.interfaces import IBookingEmailMessage
from redturtle.prenotazioni.interfaces import IBookingNotificationSender
from redturtle.prenotazioni.interfaces import IBookingNotificatorSupervisorUtility
from redturtle.prenotazioni.interfaces import IRedturtlePrenotazioniLayer
from redturtle.prenotazioni.utilities import send_email

from .. import write_message_to_object_history
from zope.component import adapter
from zope.component import getUtility
from zope.interface import implementer


@implementer(IBookingNotificationSender)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# -*- coding: utf-8 -*-
from .. import notify_the_message_failure
from . import INotificationEmail
from functools import partial

from zope.component import getMultiAdapter
from zope.globalrequest import getRequest

from redturtle.prenotazioni.interfaces import IBookingEmailMessage
from redturtle.prenotazioni.interfaces import IBookingNotificationSender
from redturtle.prenotazioni.utilities import handle_exception_by_log
from zope.component import getMultiAdapter
from zope.globalrequest import getRequest

from .. import notify_the_message_failure
from . import INotificationEmail

notify_the_message_failure = partial(notify_the_message_failure, gateway_type="Email")

Expand Down
Loading

0 comments on commit e98116e

Please sign in to comment.