src/pyams_content/component/paragraph/header.py
changeset 407 0ef5de2d5674
parent 355 5dce53509832
child 408 e1d40ed27899
equal deleted inserted replaced
406:5527bc086216 407:0ef5de2d5674
    15 
    15 
    16 # import standard library
    16 # import standard library
    17 
    17 
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    19 from pyams_content.component.paragraph.interfaces import IParagraphFactory
    20 from pyams_content.component.paragraph.interfaces.header import IHeaderParagraph
    20 from pyams_content.component.paragraph.interfaces.header import IHeaderParagraph, HEADER_PARAGRAPH_TYPE
    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_i18n.interfaces import II18n, II18nManager, INegotiator
    22 from pyams_i18n.interfaces import II18n, II18nManager, INegotiator
    23 
    23 
    24 # import packages
    24 # import packages
    25 from pyams_content.component.paragraph import BaseParagraph, BaseParagraphContentChecker, BaseParagraphFactory
    25 from pyams_content.component.paragraph import BaseParagraph, BaseParagraphContentChecker, BaseParagraphFactory
    46         return get_text_start(header, 50, 10)
    46         return get_text_start(header, 50, 10)
    47 
    47 
    48     header = FieldProperty(IHeaderParagraph['header'])
    48     header = FieldProperty(IHeaderParagraph['header'])
    49 
    49 
    50 
    50 
    51 @utility_config(name='Header', provides=IParagraphFactory)
    51 @utility_config(name=HEADER_PARAGRAPH_TYPE, provides=IParagraphFactory)
    52 class HTMLParagraphFactory(BaseParagraphFactory):
    52 class HTMLParagraphFactory(BaseParagraphFactory):
    53     """HTML paragraph factory"""
    53     """HTML paragraph factory"""
    54 
    54 
    55     name = _("Header paragraph")
    55     name = _("Header paragraph")
    56     content_type = HeaderParagraph
    56     content_type = HeaderParagraph