EBookContacts.VCard¶
| Subclasses: | EBookContacts.Contact | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | escape_string(s) | 
| class | new() | 
| class | new_from_string(str) | 
| class | unescape_string(s) | 
| add_attribute(attr) | |
| add_attribute_with_value(attr, value) | |
| append_attribute(attr) | |
| append_attribute_with_value(attr, value) | |
| construct(str) | |
| construct_full(str, len, uid) | |
| construct_with_uid(str, uid) | |
| dump_structure() | |
| get_attribute(name) | |
| get_attribute_if_parsed(name) | |
| get_attributes() | |
| is_parsed() | |
| remove_attribute(attr) | |
| remove_attributes(attr_group, attr_name) | |
| to_string(format) | |
| util_dup_x_attribute(x_name) | |
| util_set_x_attribute(x_name, value) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class EBookContacts.VCard(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - EBookContacts.VCardClass- 
classmethod escape_string(s)¶
- Parameters: - s ( - str) – the string to escape- Returns: - A newly allocated, escaped string. - Return type: - str- Escapes a string according to RFC2426, section 5. 
 - 
classmethod new()¶
- Returns: - A new, blank - EBookContacts.VCard.- Return type: - EBookContacts.VCard- Creates a new, blank - EBookContacts.VCard.
 - 
classmethod new_from_string(str)¶
- Parameters: - str ( - str) – a string representation of the vcard to create- Returns: - A new - EBookContacts.VCard.- Return type: - EBookContacts.VCard- Creates a new - EBookContacts.VCardfrom the passed-in string representation.
 - 
classmethod unescape_string(s)¶
- Parameters: - s ( - str) – the string to unescape- Returns: - A newly allocated, unescaped string. - Return type: - str- Unescapes a string according to RFC2426, section 5. 
 - 
add_attribute(attr)¶
- Parameters: - attr ( - EBookContacts.VCardAttribute) – an- EBookContacts.VCardAttributeto add- Prepends attr to self. This takes ownership of attr. 
 - 
add_attribute_with_value(attr, value)¶
- Parameters: - attr (EBookContacts.VCardAttribute) – anEBookContacts.VCardAttributeto add
- value (str) – a value to assign to the attribute
 - Prepends attr to self, setting it to value. This takes ownership of attr. - This is a convenience wrapper around - EBookContacts.VCardAttribute.add_value() and- EBookContacts.VCard.add_attribute().
- attr (
 - 
append_attribute(attr)¶
- Parameters: - attr ( - EBookContacts.VCardAttribute) – an- EBookContacts.VCardAttributeto append- Appends attr to self to the end of a list of attributes. This takes ownership of attr. - New in version 2.32. 
 - 
append_attribute_with_value(attr, value)¶
- Parameters: - attr (EBookContacts.VCardAttribute) – anEBookContacts.VCardAttributeto append
- value (str) – a value to assign to the attribute
 - Appends attr to self, setting it to value. This takes ownership of attr. - This is a convenience wrapper around - EBookContacts.VCardAttribute.add_value() and- EBookContacts.VCard.append_attribute().- New in version 2.32. 
- attr (
 - 
construct(str)¶
- Parameters: - str ( - str) – a vCard string- Constructs the existing - EBookContacts.VCard, self, setting its vCard data to str.- This modifies self. 
 - 
construct_full(str, len, uid)¶
- Parameters: - Similar to - EBookContacts.VCard.construct_with_uid(), but can also be used with an str that is not- Noneterminated.- New in version 3.12. 
 - 
construct_with_uid(str, uid)¶
- Parameters: - Constructs the existing - EBookContacts.VCard, self, setting its vCard data to str, and adding a new UID attribute with the value given in uid (if uid is non-- None).- This modifies self. - New in version 3.4. 
 - 
dump_structure()¶
- Prints a dump of self’s structure to stdout. Used for debugging. 
 - 
get_attribute(name)¶
- Parameters: - name ( - str) – the name of the attribute to get- Returns: - An - EBookContacts.VCardAttributeif found, or- None.- Return type: - EBookContacts.VCardAttributeor- None- Get the attribute name from self. The - EBookContacts.VCardAttributeis owned by evcard and should not be freed. If the attribute does not exist,- Noneis returned.- This will only return the first attribute with the given name. To get other attributes of that name (for example, other TEL attributes if a contact has multiple telephone numbers), use - EBookContacts.VCard.get_attributes() and iterate over the list searching for matching attributes.- This method iterates over all attributes in the - EBookContacts.VCard, so should not be called often. If extracting a large number of attributes from a vCard, it is more efficient to iterate once over the list returned by- EBookContacts.VCard.get_attributes().
 - 
get_attribute_if_parsed(name)¶
- Parameters: - name ( - str) – the name of the attribute to get- Returns: - An - EBookContacts.VCardAttributeif found, or- None.- Return type: - EBookContacts.VCardAttributeor- None- Similar to - EBookContacts.VCard.get_attribute() but this method will not attempt to parse the vCard if it is not already parsed.- New in version 3.4. 
 - 
get_attributes()¶
- Returns: - A list of attributes of type - EBookContacts.VCardAttribute.- Return type: - [ - EBookContacts.VCardAttribute]- Gets the list of all attributes from self. The list and its contents are owned by self, and must not be freed. 
 - 
is_parsed()¶
- Returns: - Trueif self has been parsed,- Falseotherwise.- Return type: - bool- Check if the self has been parsed already, as - EBookContacts.VCardimplements lazy parsing of its vCard data. Used for debugging.- New in version 3.2. 
 - 
remove_attribute(attr)¶
- Parameters: - attr ( - EBookContacts.VCardAttribute) – an- EBookContacts.VCardAttributeto remove- Removes attr from self and frees it. This takes ownership of attr. 
 - 
remove_attributes(attr_group, attr_name)¶
- Parameters: - Removes all the attributes with group name and attribute name equal to the passed in values. If attr_group is - Noneor an empty string, it removes all the attributes with passed in name irrespective of their group names.
 - 
to_string(format)¶
- Parameters: - format ( - EBookContacts.VCardFormat) – the format to export to- Returns: - A newly allocated string representing the vcard. - Return type: - str- Exports self to a string representation, specified by the format argument. 
 
- 
classmethod