aeidon.MetadataItem¶
Source: aeidon/metadata.py
Anchestors: builtins.object
- class aeidon.MetadataItem¶
Metadata store for one item in a desktop-style file.
- MetadataItem.fields¶
Dictionary mapping field names to their string values
Common localized fields with custom handling are Name and Description; arbitrary fields are accessible with get_field(). Strings True and False are used for boolean fields.
For the string syntax and especially the localization handling, see freedesktop.org‘s Desktop Entry Specification.
Methods¶
- MetadataItem.__init__(fields=None)¶
Initialize a MetadataItem instance.
- MetadataItem.get_description(localize=True)¶
Return description as defined by the Description field.
- MetadataItem.get_field(name, fallback=None)¶
Return the string value of field or fallback.
- MetadataItem.get_field_boolean(name, fallback=None)¶
Return the boolean value of field or fallback.
- MetadataItem.get_field_list(name, fallback=None)¶
Return the list of strings value of field or fallback.
- MetadataItem.get_name(localize=True)¶
Return name as defined by the Name field.
- MetadataItem.has_field(name)¶
Return True if field exists.
- MetadataItem.set_field(name, value)¶
Set the string value of field.