lpod.list

class lpod.list.odf_list(native_element, cache=None)

Bases: lpod.element.odf_element

Specialised element for lists.

append_item(item)
get_formatted_text(context)
get_item(position=0, content=None)

Return the list item that matches the criteria. In nested lists, return the list item that really contains that content.

Arguments:

position – int

content – unicode regex

Return: odf_element or None if not found

get_items(content=None)

Return all the list items that match the criteria.

Arguments:

style – unicode

content – unicode regex

Return: list of odf_paragraph

get_style()
insert_item(item, position=None, before=None, after=None)
set_header(text_or_element)
set_style(name)
lpod.list.odf_create_list(text=[], style=None)

Create a list element.

Arguments:

text – a list of unicode

style – unicode

The “text” argument is just a shortcut for the most common case. To create complex lists, first create an empty list, and fill it using built list items.

Return: odf_element

lpod.list.odf_create_list_item(text_or_element=None)

Create a list item element.

Sending a unicode text is just a shortcut for the most common case. To create a list item with several paragraphs or anything else (except tables), first create an empty list item, and fill it using the other “odf_create_*” functions.

Arguments:

text – unicode or odf_element

Return: odf_element

Previous topic

lpod.link

Next topic

lpod.manifest

This Page