Updated renderers
authorThierry Florac <tflorac@ulthar.net>
Wed, 10 Oct 2018 17:43:32 +0200
changeset 176 77801855486a
parent 175 73baccb50d24
child 177 610811d72a10
Updated renderers
src/pyams_default_theme/component/paragraph/frame.py
src/pyams_default_theme/component/paragraph/verbatim.py
--- a/src/pyams_default_theme/component/paragraph/frame.py	Tue Oct 09 16:24:49 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/frame.py	Wed Oct 10 17:43:32 2018 +0200
@@ -12,31 +12,26 @@
 
 __docformat__ = 'restructuredtext'
 
+from persistent import Persistent
+from zope.interface import implementer
+from zope.location import Location
+from zope.schema.fieldproperty import FieldProperty
 
-# import standard library
-from persistent import Persistent
-
-# import interfaces
 from pyams_content.component.association.interfaces import IAssociationContainer
 from pyams_content.component.illustration.interfaces import IIllustration
 from pyams_content.component.paragraph.interfaces.frame import IFrameParagraph
 from pyams_content.features.renderer.interfaces import IContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
 from pyams_content.reference.pictograms.interfaces import IPictogramTable
-from pyams_default_theme.component.paragraph.interfaces.frame import IFrameParagraphRendererSettings, \
-    ILateralFrameParagraphRendererSettings, IDefaultFrameParagraphRendererSettings, ILeftFrameParagraphRendererSettings, \
+from pyams_default_theme.component.paragraph.interfaces.frame import IDefaultFrameParagraphRendererSettings, \
+    IFrameParagraphRendererSettings, ILateralFrameParagraphRendererSettings, ILeftFrameParagraphRendererSettings, \
     IRightFrameParagraphRendererSettings
 from pyams_i18n.interfaces import II18n
 from pyams_skin.layer import IPyAMSLayer
-
-# import packages
-from pyams_content.features.renderer.skin import BaseContentRenderer
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config, get_annotation_adapter
 from pyams_utils.registry import query_utility
 from pyams_utils.zodb import volatile_property
-from zope.interface import implementer
-from zope.location import Location
-from zope.schema.fieldproperty import FieldProperty
 
 from pyams_default_theme import _
 
@@ -146,15 +141,6 @@
     i18n_context_attrs = ('title', 'body')
     illustration_renderer = None
 
-    def update(self):
-        super(BaseFrameParagraphRenderer, self).update()
-        if self.settings.can_display_illustration():
-            illustration = IIllustration(self.context, None)
-            renderer = illustration.get_renderer(self.request)
-            if renderer is not None:
-                renderer.update()
-                self.illustration_renderer = renderer
-
 
 @adapter_config(name='default', context=(IFrameParagraph, IPyAMSLayer), provides=IContentRenderer)
 @template_config(template='templates/frame-default.pt', layer=IPyAMSLayer)
--- a/src/pyams_default_theme/component/paragraph/verbatim.py	Tue Oct 09 16:24:49 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/verbatim.py	Wed Oct 10 17:43:32 2018 +0200
@@ -12,27 +12,25 @@
 
 __docformat__ = 'restructuredtext'
 
-
-# import standard library
 from persistent import Persistent
 from zope.interface import implementer
 from zope.location import Location
 from zope.schema.fieldproperty import FieldProperty
 
-# import interfaces
 from pyams_content.component.illustration.interfaces import IIllustration
 from pyams_content.component.paragraph.interfaces.verbatim import IVerbatimParagraph
 from pyams_content.features.renderer.interfaces import IContentRenderer
-# import packages
 from pyams_content.features.renderer.skin import BaseContentRenderer
-from pyams_default_theme import _
-from pyams_default_theme.component.paragraph.interfaces.verbatim import IVerbatimParagraphRendererSettings, \
-    ILateralVerbatimParagraphRendererSettings, IDefaultVerbatimParagraphRendererSettings
+from pyams_default_theme.component.paragraph.interfaces.verbatim import IDefaultVerbatimParagraphRendererSettings, \
+    ILateralVerbatimParagraphRendererSettings, IVerbatimParagraphRendererSettings
 from pyams_i18n.interfaces import II18n
 from pyams_skin.layer import IPyAMSLayer
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config, get_annotation_adapter
 
+from pyams_default_theme import _
+
+
 #
 # Verbatim paragraph default renderer settings
 #
@@ -90,7 +88,7 @@
 class BaseVerbatimParagraphRenderer(BaseContentRenderer):
     """Base frame paragraph renderer"""
 
-    context_attrs = ('author', )
+    context_attrs = ('author',)
     i18n_context_attrs = ('title', 'quote', 'charge')
     illustration_renderer = None