src/pyams_content/component/illustration/__init__.py
changeset 359 b21d74ececb1
parent 249 990a1e45f07c
child 369 7dc78749caa2
equal deleted inserted replaced
358:d959b670cbe1 359:b21d74ececb1
    17 
    17 
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.component.illustration.interfaces import IIllustrationRenderer, IIllustration, IIllustrationTarget, \
    19 from pyams_content.component.illustration.interfaces import IIllustrationRenderer, IIllustration, IIllustrationTarget, \
    20     ILLUSTRATION_KEY
    20     ILLUSTRATION_KEY
    21 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
    21 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
    22 from pyams_file.interfaces import DELETED_FILE, IResponsiveImage, IFileInfo
    22 from pyams_file.interfaces import IFileInfo, IImage, IResponsiveImage
    23 from pyams_i18n.interfaces import INegotiator, II18n, II18nManager
    23 from pyams_i18n.interfaces import INegotiator, II18n, II18nManager
    24 from zope.annotation.interfaces import IAnnotations
    24 from zope.annotation.interfaces import IAnnotations
    25 from zope.lifecycleevent.interfaces import IObjectAddedEvent, IObjectModifiedEvent
    25 from zope.lifecycleevent.interfaces import IObjectAddedEvent, IObjectModifiedEvent
    26 from zope.location.interfaces import ISublocations
    26 from zope.location.interfaces import ISublocations
    27 from zope.traversing.interfaces import ITraversable
    27 from zope.traversing.interfaces import ITraversable
    66 
    66 
    67     @data.setter
    67     @data.setter
    68     def data(self, value):
    68     def data(self, value):
    69         self._data = value
    69         self._data = value
    70         for data in value.values():
    70         for data in value.values():
    71             if (data is not None) and (data is not DELETED_FILE):
    71             if IImage.providedBy(data):
    72                 alsoProvides(data, IResponsiveImage)
    72                 alsoProvides(data, IResponsiveImage)
    73 
    73 
    74 
    74 
    75 @adapter_config(context=IIllustrationTarget, provides=IIllustration)
    75 @adapter_config(context=IIllustrationTarget, provides=IIllustration)
    76 def illustration_factory(context):
    76 def illustration_factory(context):