Example #1
0
    def next_partial_definition_field():
        """ Return the next field likely to contain a partial definition. """

        return first(fields(
            template.content,
            with_name_like=pattern,
            with_context_like=pattern,
            strictly_matching=False))  # match either name or context, or both
Example #2
0
    def next_partial_definition_field():
        """ Return the next field likely to contain a partial definition. """

        return first(
            fields(template.content,
                   with_name_like=pattern,
                   with_context_like=pattern,
                   strictly_matching=False)
        )  # match either name or context, or both
Example #3
0
    def next_include_field():
        """ Return the next probable include/inline field. """

        return first(fields(template.content, with_name_like='include|inline'))
Example #4
0
    def next_date_field():
        """ Return the next probable date field. """

        return first(fields(template.content, with_name_like='date'))
Example #5
0
    def next_image_field() -> TemplateField:
        """ Return the next probable image field. """

        return first(fields(template.content, with_name_like=supported_images_pattern))
Example #6
0
    def next_include_field():
        """ Return the next probable include/inline field. """

        return first(fields(template.content, with_name_like='include|inline'))
Example #7
0
    def next_date_field():
        """ Return the next probable date field. """

        return first(fields(template.content, with_name_like='date'))
Example #8
0
    def next_image_field() -> TemplateField:
        """ Return the next probable image field. """

        return first(
            fields(template.content, with_name_like=supported_images_pattern))