示例#1
0
文件: list.py 项目: nctan/quneiform
    def get_item_list(self, content=None):
        """Return all the list items that match the criteria.

        Arguments:

            style -- unicode

            content -- unicode regex

        Return: list of odf_paragraph
        """
        return _get_element_list(self, 'text:list-item', content=content)
示例#2
0
    def get_item_list(self, content=None):
        """Return all the list items that match the criteria.

        Arguments:

            style -- unicode

            content -- unicode regex

        Return: list of odf_paragraph
        """
        return _get_element_list(self, 'text:list-item', content=content)
示例#3
0
    def get_note_list(self, note_class=None, regex=None):
        """Return the list of all note element, optionally the ones of the
        given class or that match the given regex.

        Arguments:

            note_class -- 'footnote' or 'endnote'

            regex -- unicode

        Return: list of odf_element
        """
        return _get_element_list(self, 'descendant::text:note',
                                 note_class=note_class,
                                 regex=regex)
示例#4
0
 def get_annotation_list(self, creator=None, start_date=None,
                         end_date=None, regex=None):
     """XXX end date is not included (as expected in Python).
     """
     annotations = []
     for annotation in _get_element_list(self,
             'descendant::office:annotation', regex=regex):
         if (creator is not None
                 and creator != annotation.get_dc_creator()):
             continue
         date = annotation.get_dc_date()
         if start_date is not None and date < start_date:
             continue
         if end_date is not None and date >= end_date:
             continue
         annotations.append(annotation)
     return annotations
示例#5
0
    def get_image_list(self, style=None, href=None, regex=None):
        """Get all image elements matching the criteria. Style is the style
        name. Set link to False to get only internal images, and True to
        get only external images (not in the container). Href is a regex to
        find all images with their path matching.

        Arguments:

            style -- str

            link -- bool

            href -- unicode regex

        Return: list of odf_element
        """
        return _get_element_list(self, 'descendant::draw:image',
                text_style=style, href=href, regex=regex)
示例#6
0
    def get_styled_elements(self, name=True):
        """Brute-force to find paragraphs, tables, etc. using the given style
        name (or all by default).

        Arguments:

            name -- unicode

        Return: list
        """
        # FIXME incomplete (and possibly inaccurate)
        return (_get_element_list(self, 'descendant::*', text_style=name)
                + _get_element_list(self, 'descendant::*', draw_style=name)
                + _get_element_list(self, 'descendant::*', style_name=name)
                + _get_element_list(self, 'descendant::*', draw_text_style=name)
                + _get_element_list(self, 'descendant::*', table_style=name)
                + _get_element_list(self, 'descendant::*', page_layout=name)
		)
示例#7
0
 def get_draw_rectangle_list(self, draw_style=None, draw_text_style=None,
                             regex=None):
     return _get_element_list(self, 'descendant::draw:rect',
                              draw_style=draw_style,
                              draw_text_style=draw_text_style, regex=regex)
示例#8
0
 def get_frame_list(self, style=None, title=None, description=None,
                    regex=None):
     return _get_element_list(self, 'descendant::draw:frame',
                              draw_style=style, svg_title=title,
                              svg_desc=description, regex=regex)
示例#9
0
 def get_heading_list(self, style=None, level=None, regex=None):
     return _get_element_list(self, 'descendant::text:h',
             text_style=style, outline_level=level, regex=regex)
示例#10
0
 def get_toc_list(self):
     return _get_element_list(self, 'text:table-of-content')
示例#11
0
 def get_variable_sets(self, name):
     return _get_element_list(self, 'descendant::text:variable-set',
                              text_name=name)
示例#12
0
 def get_variable_list(self):
     return _get_element_list(self, 'descendant::text:variable-decl')
示例#13
0
 def get_note_by_class(self, note_class):
     return _get_element_list(self, 'descendant::text:note',
                              note_class=note_class)
示例#14
0
 def get_table_list(self, style=None, regex=None):
     return _get_element_list(self, 'descendant::table:table',
             table_style=style, regex=regex)
示例#15
0
 def get_draw_ellipse_list(self, draw_style=None, draw_text_style=None,
                           regex=None):
     return _get_element_list(self, 'descendant::draw:ellipse',
                              draw_style=draw_style,
                              draw_text_style=draw_text_style, regex=regex)
示例#16
0
 def get_draw_connector_list(self, draw_style=None, draw_text_style=None,
                             regex=None):
     return _get_element_list(self, 'descendant::draw:connector',
                              draw_style=draw_style,
                              draw_text_style=draw_text_style, regex=regex)
示例#17
0
 def get_user_field_list(self):
     return _get_element_list(self, 'descendant::text:user-field-decl')
示例#18
0
 def get_style_list(self, family=None):
     # Both common and default styles
     tagname, famattr = self._get_style_tagname(family)
     return _get_element_list(self, tagname, family=famattr)
示例#19
0
 def get_draw_page_list(self, style=None, regex=None):
     return _get_element_list(self, 'descendant::draw:page',
                              draw_style=style, regex=regex)
示例#20
0
 def get_section_list(self, style=None, regex=None):
     return _get_element_list(self, 'text:section', text_style=style,
             regex=regex)
示例#21
0
 def get_link_list(self, name=None, title=None, href=None, regex=None):
     return _get_element_list(self, 'descendant::text:a', office_name=name,
                              office_title=title, href=href, regex=regex)
示例#22
0
 def get_list_list(self, style=None, regex=None):
     return _get_element_list(self, 'descendant::text:list',
             text_style=style, regex=regex)
示例#23
0
 def get_bookmark_start_list(self):
     return _get_element_list(self, 'descendant::text:bookmark-start')
示例#24
0
 def get_bookmark_end_list(self):
     return _get_element_list(self, 'descendant::text:bookmark-end')
示例#25
0
 def get_reference_mark_end_list(self):
     return _get_element_list(self, 'descendant::text:reference-mark-end')
示例#26
0
 def get_changed_region_list(self, creator=None, date=None, content=None):
     return _get_element_list(self, 'text:changed-region',
             dc_creator=creator, dc_date=date, content=content)
示例#27
0
 def get_item_list(self, regex=None):
     return _get_element_list(self, 'text:list-item', regex=regex)