Bases: lpod.image.odf_image
Bases: lpod.style.odf_style
Bases: lpod.style.odf_style
Bases: lpod.style.odf_style, lpod.image.odf_image
Bases: lpod.style.odf_style
Bases: lpod.style.odf_style
Bases: lpod.style.odf_style
A list style is a container for list level styles.
Arguments:
level – int
num_format (for number) – int
bullet_char (for bullet) – unicode
url (for image) – str
display_levels – int
prefix – unicode
suffix – unicode
start_value – int
style – unicode
clone – odf_list_style
Bases: lpod.style.odf_style
Bases: lpod.style.odf_style
A master page is the style of a page.
Physical presentation is in the associated page layout.
XXX to verify
Get the element that contains the footer contents.
If None, no footer was set.
Get the element that contains the header contents.
If None, no header was set.
Create or replace the footer by the given content. It can already be a complete footer.
If you only want to update the existing footer, get it and use the API.
Arguments:
text_or_element – unicode or odf_element or a list of them
Create or replace the header by the given content. It can already be a complete header.
If you only want to update the existing header, get it and use the API.
Arguments:
text_or_element – unicode or odf_element or a list of them
Bases: lpod.style.odf_style
Bases: lpod.style.odf_list_style
Bases: lpod.style.odf_style
Physical presentation of a page.
XXX to verify
Bases: lpod.style.odf_style
Bases: lpod.style.odf_style
Bases: lpod.element.odf_element
Specialised element for styles, yet generic to all style types.
Delete the given properties, either by list argument or positional argument (or both). Remove only from the given area, identical to the style family by default.
Arguments:
properties – list
area – str
Will only return a name, not an object, because we don’t have access to the XML part from here.
See odf_styles.get_parent_style
Get the mapping of all properties of this style. By default the properties of the same family, e.g. a paragraph style and its paragraph properties. Specify the area to get the text properties of a paragraph style for example.
Arguments:
area – str
Return: dict
Set the background color of a text style, or the background color or image of a paragraph style or page layout.
With no argument, remove any existing background.
The position is one or two of ‘center’, ‘left’, ‘right’, ‘top’ or ‘bottom’.
The repeat is ‘no-repeat’, ‘repeat’ or ‘stretch’.
The opacity is a percentage integer (not a string with the ‘%s’ sign)
The filter is an application-specific filter name defined elsewhere.
Though this method is defined on the base style class, it will raise an error if the style type is not compatible.
Arguments:
color – ‘#rrggbb’
url – str
position – str
repeat – str
opacity – int
filter – str
Set the properties of the “area” type of this style. Properties are given either as a dict or as named arguments (or both). The area is identical to the style family by default. If the properties element is missing, it is created.
Instead of properties, you can pass a style with properties of the same area. These will be copied.
Arguments:
properties – dict
style – odf_style
area – ‘paragraph’, ‘text’...
Bases: lpod.style.odf_style
Turns a “#RRGGBB” hexadecimal color representation into a (R, G, B) tuple. Arguments:
color: str
Return: tuple
Returns a string for style:table-cell-properties fo:border, with default : “0.06pt solid #000000”
thick – str or float line – str color – str or rgb 3-tuple, str is ‘black’, ‘grey’, ... or ‘#012345’
Returns : str
Create a style of the given family. The name is not mandatory at this point but will become required when inserting in a document as a common style.
The display name is the name the user sees in an office application.
The parent is the name of the style this style will inherit from.
To set properties, pass them as keyword arguments. The area properties apply to is optional and defaults to the family.
Arguments:
- family – ‘paragraph’, ‘text’, ‘section’, ‘table’, ‘table-column’,
- ‘table-row’, ‘table-cell’, ‘table-page’, ‘chart’, ‘drawing-page’, ‘graphic’, ‘presentation’, ‘control’, ‘ruby’, ‘list’, ‘number’, ‘page-layout’ ‘font-face’, or ‘master-page’
name – unicode
display_name – unicode
parent – unicode
area – str
‘text’ Properties:
italic – bool
bold – bool
‘paragraph’ Properties:
master_page – unicode
‘master-page’ Properties:
page_layout – unicode
next_style – unicode
‘table-cell’ Properties:
border, border_top, border_right, border_bottom, border_left – str, e.g. “0.002cm solid #000000” or ‘none’
shadow – str, e.g. “#808080 0.176cm 0.176cm”
‘table-row’ Properties:
height – str, e.g. ‘5cm’
use_optimal_height – bool
‘table-column’ Properties:
width – str, e.g. ‘5cm’
break_before – ‘page’, ‘column’ or ‘auto’
break_after – ‘page’, ‘column’ or ‘auto’
Return: odf_style
Turns a color name or a (R, G, B) color tuple into a “#RRGGBB” hexadecimal representation. Arguments:
color – str or tuple
Return: str
Examples:
>>> rgb2hex('yellow')
'#FFFF00'
>>> rgb2hex((238, 130, 238))
'#EE82EE'