List, view and manipulate user fields. More...
Public Member Functions | |
def | __init__ |
Constructor. More... | |
def | loaddoc |
def | savedoc |
def | list_fields |
List (extract) all known user-fields. More... | |
def | list_fields_and_values |
List (extract) user-fields with type and value. More... | |
def | list_values |
Extract the contents of given field names from the file. More... | |
def | get |
Extract the contents of this field from the file. More... | |
def | get_type_and_value |
Extract the type and contents of this field from the file. More... | |
def | update |
Set the value of user fields. More... | |
Public Attributes | |
document | |
Static Public Attributes | |
src_file = None | |
dest_file = None | |
List, view and manipulate user fields.
Definition at line 53 of file userfield.py.
def odf.userfield.UserFields.__init__ | ( | self, | |
src = None , |
|||
dest = None |
|||
) |
Constructor.
src | open file in binary mode: source document, or filename as a unicode string, or None for stdin. |
dest | opendile in binary mode: destination document, or filename as a unicode string, or None for stdout. |
Definition at line 67 of file userfield.py.
def odf.userfield.UserFields.get | ( | self, | |
field_name | |||
) |
Extract the contents of this field from the file.
field_name | unicode string: name of a field |
Definition at line 146 of file userfield.py.
def odf.userfield.UserFields.get_type_and_value | ( | self, | |
field_name | |||
) |
Extract the type and contents of this field from the file.
field_name | unicode string: name of a field |
Definition at line 160 of file userfield.py.
def odf.userfield.UserFields.list_fields | ( | self | ) |
List (extract) all known user-fields.
Definition at line 98 of file userfield.py.
def odf.userfield.UserFields.list_fields_and_values | ( | self, | |
field_names = None |
|||
) |
List (extract) user-fields with type and value.
field_names | list of field names as unicode strings to show, or None for all. |
) as type (unicode string, stringified type, unicode string).
Definition at line 111 of file userfield.py.
def odf.userfield.UserFields.list_values | ( | self, | |
field_names | |||
) |
Extract the contents of given field names from the file.
field_names | list of field names as unicode strings |
Definition at line 137 of file userfield.py.
def odf.userfield.UserFields.loaddoc | ( | self | ) |
Definition at line 74 of file userfield.py.
def odf.userfield.UserFields.savedoc | ( | self | ) |
def odf.userfield.UserFields.update | ( | self, | |
data | |||
) |
Set the value of user fields.
The field types will be the same.
data ... dict, with field name as key, field value as value Returns None
Definition at line 176 of file userfield.py.
|
static |
Definition at line 57 of file userfield.py.
odf.userfield.UserFields.document |
Definition at line 72 of file userfield.py.
|
static |
Definition at line 56 of file userfield.py.