--- a/src/pyams_default_theme/component/association/__init__.py Fri Nov 13 13:31:59 2020 +0100
+++ b/src/pyams_default_theme/component/association/__init__.py Fri Nov 13 16:34:00 2020 +0100
@@ -10,23 +10,23 @@
# FOR A PARTICULAR PURPOSE.
#
-__docformat__ = 'restructuredtext'
-
from itertools import islice
from persistent import Persistent
from zope.location import Location
from zope.schema.fieldproperty import FieldProperty
-from pyams_content.component.association.interfaces import IAssociationContainer, IAssociationInfo, \
- IAssociationParagraph
+from pyams_content.component.association.interfaces import IAssociationContainer, \
+ IAssociationInfo, IAssociationParagraph
from pyams_content.component.extfile import IExtFile
from pyams_content.component.links.interfaces import IBaseLink, IInternalLink
-from pyams_content.component.paragraph.interfaces import IParagraphContainer, IParagraphContainerTarget
+from pyams_content.component.paragraph.interfaces import IParagraphContainer, \
+ IParagraphContainerTarget
from pyams_content.features.renderer.interfaces import IContentRenderer
-from pyams_default_theme import _
-from pyams_default_theme.component.association.interfaces import IAssociationParagraphDefaultRendererSettings, \
- IAssociationParagraphRemoteContentRendererSettings, IAssociationParagraphSlicedRemoteContentRendererSettings
+from pyams_default_theme.component.association.interfaces import \
+ IAssociationParagraphDefaultRendererSettings, \
+ IAssociationParagraphRemoteContentRendererSettings, \
+ IAssociationParagraphSlicedRemoteContentRendererSettings
from pyams_default_theme.features.renderer import BaseContentRenderer
from pyams_skin.layer import IPyAMSLayer
from pyams_template.template import template_config
@@ -34,6 +34,11 @@
from pyams_utils.factory import factory_config
+__docformat__ = 'restructuredtext'
+
+from pyams_default_theme import _
+
+
#
# Associations paragraph default renderer
#
@@ -48,15 +53,19 @@
description_format = FieldProperty(IAssociationParagraphDefaultRendererSettings['description_format'])
-@adapter_config(context=IAssociationParagraph, provides=IAssociationParagraphDefaultRendererSettings)
+@adapter_config(context=IAssociationParagraph,
+ provides=IAssociationParagraphDefaultRendererSettings)
def association_paragraph_default_renderer_settings_factory(context):
"""Associations paragraph default renderer settings factory"""
return get_annotation_adapter(context, ASSOCIATION_PARAGRAPH_DEFAULT_RENDERER_SETTINGS_KEY,
IAssociationParagraphDefaultRendererSettings)
-@adapter_config(name='default', context=(IAssociationParagraph, IPyAMSLayer), provides=IContentRenderer)
-@template_config(template='templates/association-default.pt', layer=IPyAMSLayer)
+@adapter_config(name='default',
+ context=(IAssociationParagraph, IPyAMSLayer),
+ provides=IContentRenderer)
+@template_config(template='templates/association-default.pt',
+ layer=IPyAMSLayer)
class AssociationParagraphDefaultRenderer(BaseContentRenderer):
"""Associations paragraph default renderer"""
@@ -105,15 +114,19 @@
paragraphs_count = FieldProperty(IAssociationParagraphSlicedRemoteContentRendererSettings['paragraphs_count'])
-@adapter_config(context=IAssociationParagraph, provides=IAssociationParagraphSlicedRemoteContentRendererSettings)
+@adapter_config(context=IAssociationParagraph,
+ provides=IAssociationParagraphSlicedRemoteContentRendererSettings)
def association_paragraph_sliced_remote_content_renderer_settings_factory(context):
"""Associations paragraph sliced remote content renderer settings factory"""
return get_annotation_adapter(context, ASSOCIATION_PARAGRAPH_SLICED_REMOTE_CONTENT_RENDERER_SETTINGS_KEY,
IAssociationParagraphSlicedRemoteContentRendererSettings)
-@adapter_config(name='reportage', context=(IAssociationParagraph, IPyAMSLayer), provides=IContentRenderer)
-@template_config(template='templates/association-remote-content.pt', layer=IPyAMSLayer)
+@adapter_config(name='reportage',
+ context=(IAssociationParagraph, IPyAMSLayer),
+ provides=IContentRenderer)
+@template_config(template='templates/association-remote-content.pt',
+ layer=IPyAMSLayer)
class AssociationParagraphSlicedRemoteContentRenderer(BaseContentRenderer):
"""Associations container sliced remote content renderer"""
@@ -151,15 +164,19 @@
anchors_only = FieldProperty(IAssociationParagraphRemoteContentRendererSettings['anchors_only'])
-@adapter_config(context=IAssociationParagraph, provides=IAssociationParagraphRemoteContentRendererSettings)
+@adapter_config(context=IAssociationParagraph,
+ provides=IAssociationParagraphRemoteContentRendererSettings)
def association_paragraph_remote_content_renderer_settings_factory(context):
"""Associations paragraph remote content renderer settings factory"""
return get_annotation_adapter(context, ASSOCIATION_PARAGRAPH_REMOTE_CONTENT_RENDERER_SETTINGS_KEY,
IAssociationParagraphRemoteContentRendererSettings)
-@adapter_config(name='remote-content', context=(IAssociationParagraph, IPyAMSLayer), provides=IContentRenderer)
-@template_config(template='templates/association-remote-content.pt', layer=IPyAMSLayer)
+@adapter_config(name='remote-content',
+ context=(IAssociationParagraph, IPyAMSLayer),
+ provides=IContentRenderer)
+@template_config(template='templates/association-remote-content.pt',
+ layer=IPyAMSLayer)
class AssociationParagraphRemoteContentRenderer(BaseContentRenderer):
"""Associations container remote content renderer"""