Functions

  binding_bind_property (source, source_property, target, target_property, flags)
  binding_bind_property_full (source, source_property, target, target_property, flags, transform_to, transform_from)
  binding_transform_enum_nick_to_value (binding, source_value, target_value, not_used)
  binding_transform_enum_value_to_nick (binding, source_value, target_value, not_used)
  categories_add (category, unused, icon_file, searchable)
  categories_dup_icon_file_for (category)
  categories_dup_list ()
  categories_exist (category)
  categories_get_icon_file_for (category)
  categories_get_list ()
  categories_is_searchable (category)
  categories_register_change_listener (listener, *user_data)
  categories_remove (category)
  categories_set_icon_file_for (category, icon_file)
  categories_unregister_change_listener (listener, *user_data)
  collator_error_quark ()
  data_server_util_get_dbus_call_timeout ()
  data_server_util_set_dbus_call_timeout (timeout_msec)
  debug_log_clear ()
  debug_log_disable_domains (domains)
  debug_log_dump (filename)
  debug_log_dump_to_dated_file ()
  debug_log_enable_domains (domains)
  debug_log_get_max_lines ()
  debug_log_is_domain_enabled (domain)
  debug_log_load_configuration (filename)
  debug_log_set_max_lines (num_lines)
  eds_check_version (required_major, required_minor, required_micro)
  enum_from_string (enum_type, string, enum_value)
  enum_to_string (enum_type, enum_value)
  file_recursive_delete (file, io_priority, cancellable, callback, *user_data)
  file_recursive_delete_finish (file, result)
  file_recursive_delete_sync (file, cancellable)
  filename_make_safe (string)
  filename_mkdir_encoded (basepath, fileprefix, filename, fileindex)
  free_form_exp_to_sexp (free_form_exp, symbols)
  get_user_cache_dir ()
  get_user_config_dir ()
  get_user_data_dir ()
  localtime_with_offset (tt, tm, offset)
  mktime_utc (tm)
  oauth2_service_util_set_to_form (form, name, value)
  oauth2_service_util_take_to_form (form, name, value)
  queue_transfer (src_queue, dst_queue)
  secret_store_delete_sync (uid, cancellable)
  secret_store_lookup_sync (uid, cancellable)
  secret_store_store_sync (uid, secret, label, permanently, cancellable)
  soup_ssl_trust_connect (soup_message, source)
  strftime (string, max, fmt, tm)
  time_format_date_and_time (date_tm, use_24_hour_format, show_midnight, show_zero_seconds, buffer, buffer_size)
  time_format_time (date_tm, use_24_hour_format, show_zero_seconds, buffer, buffer_size)
  time_get_d_fmt_with_4digit_year ()
  time_parse_date (value, result)
  time_parse_date_and_time (value, result)
  time_parse_date_and_time_ex (value, result, two_digit_year)
  time_parse_date_ex (value, result, two_digit_year)
  time_parse_time (value, result)
  timeout_add_seconds_with_name (priority, interval, name, function, *data)
  timeout_add_with_name (priority, interval, name, function, *data)
  type_traverse (parent_type, func, *user_data)
  uid_new ()
  utf8_strftime (string, max, fmt, tm)
  util_can_use_collection_as_credential_source (collection_source, child_source)
  util_copy_object_slist (copy_to, objects)
  util_copy_string_slist (copy_to, strings)
  util_ensure_gdbus_string (str, gdbus_str)
  util_free_nullable_object_slist (objects)
  util_free_object_slist (objects)
  util_free_string_slist (strings)
  util_generate_uid ()
  util_get_source_full_name (registry, source)
  util_gthread_id (thread)
  util_identity_can_send (registry, identity_source)
  util_safe_free_string (str)
  util_slist_to_strv (strings)
  util_strcmp0 (str1, str2)
  util_strdup_strip (string)
  util_strstrcase (haystack, needle)
  util_strv_equal (v1, v2)
  util_strv_to_slist (strv)
  util_unicode_get_utf8 (text, out)
  util_unref_in_thread (object)
  util_utf8_data_make_valid (data, data_bytes)
  util_utf8_decompose (text)
  util_utf8_make_valid (str)
  util_utf8_normalize (str)
  util_utf8_remove_accents (str)
  util_utf8_strcasecmp (s1, s2)
  util_utf8_strstrcase (haystack, needle)
  util_utf8_strstrcasedecomp (haystack, needle)
  webdav_access_control_entry_free (ptr)
  webdav_discover_free_discovered_sources (discovered_sources)
  webdav_discover_sources (source, url_use_path, only_supports, credentials, cancellable, callback, *user_data)
  webdav_discover_sources_finish (source, result)
  webdav_discover_sources_full (source, url_use_path, only_supports, credentials, ref_source_func, ref_source_func_user_data, cancellable, callback, *user_data)
  webdav_discover_sources_full_sync (source, url_use_path, only_supports, credentials, ref_source_func, ref_source_func_user_data, cancellable)
  webdav_discover_sources_sync (source, url_use_path, only_supports, credentials, cancellable)
  webdav_privilege_free (ptr)
  webdav_property_change_free (ptr)
  webdav_resource_free (ptr)
  xml_destroy_hash (hash)
  xml_save_file (filename, doc)
  xml_to_hash (doc, type)
  xmlhash_add (hash, key, data)
  xmlhash_compare (hash, key, compare_data)
  xmlhash_destroy (hash)
  xmlhash_foreach_key (hash, func, *user_data)
  xmlhash_foreach_key_remove (hash, func, *user_data)
  xmlhash_remove (hash, key)
  xmlhash_write (hash)

Details

EDataServer.binding_bind_property(source, source_property, target, target_property, flags)
Parameters:
Return type:

GObject.Binding

Thread safe variant of GObject.Object.bind_property(). See its documentation for more information on arguments and return value.

New in version 3.16.

EDataServer.binding_bind_property_full(source, source_property, target, target_property, flags, transform_to, transform_from)
Parameters:
Returns:

the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.

Return type:

GObject.Binding

Thread safe variant of GObject.Object.bind_property_full(). See its documentation for more information on arguments and return value.

New in version 3.16.

EDataServer.binding_transform_enum_nick_to_value(binding, source_value, target_value, not_used)
Parameters:
Returns:

True if the enum nickname has a corresponding value

Return type:

bool

Transforms an enumeration nickname to its corresponding value.

New in version 3.4.

EDataServer.binding_transform_enum_value_to_nick(binding, source_value, target_value, not_used)
Parameters:
Returns:

True if the enum value has a corresponding nickname

Return type:

bool

Transforms an enumeration value to its corresponding nickname.

New in version 3.4.

EDataServer.categories_add(category, unused, icon_file, searchable)
Parameters:
  • category (str) – name of category to add.
  • unused (str) – DEPRECATED! associated color. DEPRECATED!
  • icon_file (str) – full path of the icon associated to the category.
  • searchable (bool) – whether the category can be used for searching in the GUI.

Adds a new category, with its corresponding icon, to the configuration database.

This function is thread safe.

EDataServer.categories_dup_icon_file_for(category)
Parameters:category (str) – category to retrieve the icon file for.
Returns:icon file name; free with GLib.free().
Return type:str

Gets the icon file associated with the given category and returns a copy of it.

This function is thread safe.

New in version 3.16.

EDataServer.categories_dup_list()
Returns:a sorted GLib.List containing the names of the categories. The list should be freed using g_list_free(), and the names of the categories should be freed using GLib.free(). Everything can be freed simultaneously using g_list_free_full().
Return type:[str]

Returns a sorted list of all the category names currently configured.

This function is thread safe.

New in version 3.16.

EDataServer.categories_exist(category)
Parameters:category (str) – category to be searched.
Returns:True if the category is available, False otherwise.
Return type:bool

Checks whether the given category is available in the configuration.

This function is thread safe.

EDataServer.categories_get_icon_file_for(category)
Parameters:category (str) – category to retrieve the icon file for.
Returns:icon file name.
Return type:str

Gets the icon file associated with the given category.

This function is mostly thread safe, but as the icon file name is not copied, it may be freed by another thread after being returned by this function. Use EDataServer.categories_dup_icon_file_for() instead.

Deprecated since version 3.16: This function is not entirely thread safe. Use EDataServer.categories_dup_icon_file_for() instead.

EDataServer.categories_get_list()
Returns:a sorted GLib.List containing the names of the categories. The list should be freed using g_list_free(), but the names of the categories should not be touched at all, they are internal strings.
Return type:[str]

Returns a sorted list of all the category names currently configured.

This function is mostly thread safe, but as the category names are not copied, they may be freed by another thread after being returned by this function. Use EDataServer.categories_dup_list() instead.

Deprecated since version 3.16: This function is not entirely thread safe. Use EDataServer.categories_dup_list() instead.

EDataServer.categories_is_searchable(category)
Parameters:category (str) – category name.
Return type:bool

Gets whether the given calendar is to be used for searches in the GUI.

This function is thread safe.

Return value; True% if the category is searchable, False% if not.

EDataServer.categories_register_change_listener(listener, *user_data)
Parameters:
  • listener (GObject.Callback) – the callback to be called on any category change.
  • user_data (object or None) – used data passed to the listener when called.

Registers callback to be called on change of any category. Pair listener and user_data is used to distinguish between listeners. Listeners can be unregistered with e_categories_unregister_change_listener.

This function is thread safe.

New in version 2.24.

EDataServer.categories_remove(category)
Parameters:category (str) – category to be removed.

Removes the given category from the configuration.

This function is thread safe.

EDataServer.categories_set_icon_file_for(category, icon_file)
Parameters:
  • category (str) – category to set the icon file for.
  • icon_file (str) – icon file.

Sets the icon file associated with the given category.

This function is thread safe.

EDataServer.categories_unregister_change_listener(listener, *user_data)
Parameters:
  • listener (GObject.Callback) – Callback to be removed.
  • user_data (object or None) – User data as passed with call to e_categories_register_change_listener.

Removes previously registered callback from the list of listeners on changes. If it was not registered, then does nothing.

This function is thread safe.

New in version 2.24.

EDataServer.collator_error_quark()
Return type:int
EDataServer.data_server_util_get_dbus_call_timeout()
Returns:the D-Bus call timeout in milliseconds
Return type:int

Returns the value set by EDataServer.data_server_util_set_dbus_call_timeout().

New in version 3.0.

Deprecated since version 3.8: This value is not used anywhere.

EDataServer.data_server_util_set_dbus_call_timeout(timeout_msec)
Parameters:timeout_msec (int) – default timeout for D-Bus calls in miliseconds

Sets default timeout, in milliseconds, for calls of Gio.DBusProxy.call() family functions.

-1 means the default value as set by D-Bus itself. GObject.G_MAXINT means no timeout at all.

Default value is set also by configure option –with-dbus-call-timeout=ms and -1 is used when not set.

New in version 3.0.

Deprecated since version 3.8: This value is not used anywhere.

EDataServer.debug_log_clear()

New in version 2.32.

EDataServer.debug_log_disable_domains(domains)
Parameters:domains ([str]) – an array of domains to disable

Disables all domains from the domains array.

New in version 2.32.

EDataServer.debug_log_dump(filename)
Parameters:filename (str) – a filename to save logged information to
Raises:GLib.Error
Returns:whether succeeded
Return type:bool

Saves current log information to the given filename.

New in version 2.32.

EDataServer.debug_log_dump_to_dated_file()
Raises:GLib.Error
Returns:whether succeeded
Return type:bool

Saves current log information to a file “e-debug-log-YYYY-MM-DD-HH-mm-ss.txt” in the user’s HOME directory.

New in version 2.32.

EDataServer.debug_log_enable_domains(domains)
Parameters:domains ([str]) – an array of domains to enable

Enables all domains from the domains array.

New in version 2.32.

EDataServer.debug_log_get_max_lines()
Return type:int

New in version 2.32.

EDataServer.debug_log_is_domain_enabled(domain)
Parameters:domain (str) – a log domain
Returns:whether the given log domain is enabled, which means that any logging to this domain is recorded.
Return type:bool

New in version 2.32.

EDataServer.debug_log_load_configuration(filename)
Parameters:filename (str) – a configuration file name
Raises:GLib.Error
Returns:whether succeeded
Return type:bool

Loads configuration for the logging from the given filename.

New in version 2.32.

EDataServer.debug_log_set_max_lines(num_lines)
Parameters:num_lines (int) – number of lines

Limits how many lines the log can have.

New in version 2.32.

EDataServer.eds_check_version(required_major, required_minor, required_micro)
Parameters:
  • required_major (int) – the required major version
  • required_minor (int) – the required minor version
  • required_micro (int) – the required micro version
Returns:

None if the Evolution-Data-Server library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by libedataserver and must not be modified or freed.

Return type:

str

Checks that the Evolution-Data-Server library in use is compatible with the given version. Generally you would pass in the constants EDataServer.EDS_MAJOR_VERSION, EDataServer.EDS_MINOR_VERSION, EDataServer.EDS_MICRO_VERSION as the three arguments to this function. That produces a check that the library in use is compatible with the version of Evolution-Data-Server the application or module was compiled against.

New in version 2.24.

EDataServer.enum_from_string(enum_type, string, enum_value)
Parameters:
  • enum_type (GObject.GType) – The enum type
  • string (str) – The string containing the enum value or nick
  • enum_value (int) – A return location to store the result
Returns:

True if the string was a valid name or nick for the given type, False if the conversion failed.

Return type:

bool

Fetches the appropriate enumeration value for string in the given enum type type and stores the result in enum_value

New in version 3.8.

EDataServer.enum_to_string(enum_type, enum_value)
Parameters:
  • enum_type (GObject.GType) – An enum type
  • enum_value (int) – The enum value to convert
Returns:

the string representing eval

Return type:

str

Converts an enum value to a string using strings from the GObject.GType system.

New in version 3.8.

EDataServer.file_recursive_delete(file, io_priority, cancellable, callback, *user_data)
Parameters:

Asynchronously deletes file. If file is a directory, its contents are deleted recursively before file itself is deleted. The recursive delete operation will stop on the first error.

If cancellable is not None, then the operation can be cancelled by triggering the cancellable object before the operation finishes.

When the operation is finished, callback will be called. You can then call EDataServer.file_recursive_delete_finish() to get the result of the operation.

New in version 3.6.

EDataServer.file_recursive_delete_finish(file, result)
Parameters:
Raises:

GLib.Error

Returns:

True if the file was deleted, False otherwise

Return type:

bool

Finishes the operation started with EDataServer.file_recursive_delete().

If the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED will be returned.

New in version 3.6.

EDataServer.file_recursive_delete_sync(file, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the file was deleted, False otherwise

Return type:

bool

Deletes file. If file is a directory, its contents are deleted recursively before file itself is deleted. The recursive delete operation will stop on the first error.

If cancellable is not None, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error Gio.IOErrorEnum.CANCELLED will be returned.

New in version 3.6.

EDataServer.filename_make_safe(string)
Parameters:string (str) –
EDataServer.filename_mkdir_encoded(basepath, fileprefix, filename, fileindex)
Parameters:
  • basepath (str) – base path of a file name; this is left unchanged
  • fileprefix (str) – prefix for the filename; this is encoded
  • filename (str) – file name to use; this is encoded; can be None
  • fileindex (int) – used when filename is None, then the filename is generated as “file” + fileindex
Returns:

Full local path like g_build_filename() except that fileprefix and filename are encoded to create a proper file elements for a file system. Free returned pointer with GLib.free().

Return type:

str

Creates a local path constructed from basepath / fileprefix + “-” + filename, and makes sure the path basepath exists. If creation of the path fails, then None is returned.

New in version 3.4.

EDataServer.free_form_exp_to_sexp(free_form_exp, symbols)
Parameters:
Returns:

converted free_form_exp into S-Expression, None on error. Free the returned string with a GLib.free(), when done with it.

Return type:

str

Converts the free_form_exp to an S-Expression using the S-Expression builders defined in the symbols. The symbols should have one symbol with an empty string as its name, which is used for words which do not have a symbol name prefix.

The symbols is a None-terminated array of known symbols. The None should be set for the symbol’s name.

New in version 3.16.

EDataServer.get_user_cache_dir()
Returns:base directory for user-specific, non-essential data
Return type:str

Returns a base directory in which to store user-specific, non-essential cached data for Evolution or Evolution-Data-Server.

The returned string is owned by libedataserver and must not be modified or freed.

New in version 2.32.

EDataServer.get_user_config_dir()
Returns:base directory for user-specific configuration information
Return type:str

Returns a base directory in which to store user-specific configuration information for Evolution or Evolution-Data-Server.

The returned string is owned by libedataserver and must not be modified or freed.

New in version 2.32.

EDataServer.get_user_data_dir()
Returns:base directory for user-specific data
Return type:str

Returns a base directory in which to store user-specific data for Evolution or Evolution-Data-Server.

The returned string is owned by libedataserver and must not be modified or freed.

New in version 2.32.

EDataServer.localtime_with_offset(tt, tm, offset)
Parameters:
  • tt (int) – The #time_t to convert.
  • tm (object or None) – The #tm to store the result in.
  • offset (int) – The #int to store the offset in.

Converts the calendar time time representation tt to a broken-down time representation, store in tm, and provides the offset in seconds from UTC time, stored in offset.

EDataServer.mktime_utc(tm)
Parameters:tm (object or None) – The #tm to convert to a calendar time representation.
Returns:The calendar time representation of tm.
Return type:int

Like mktime(3), but assumes UTC instead of local timezone.

EDataServer.oauth2_service_util_set_to_form(form, name, value)
Parameters:

Sets value for name to form. The form should be the one used in EDataServer.OAuth2Service.prepare_authentication_uri_query(), EDataServer.OAuth2Service.prepare_get_token_form() or EDataServer.OAuth2Service.prepare_refresh_token_form().

If the value is None, then the property named name is removed from the form instead.

New in version 3.28.

EDataServer.oauth2_service_util_take_to_form(form, name, value)
Parameters:

Takes ownership of value and sets it for name to form. The value will be freed with GLib.free(), when no longer needed. The form should be the one used in EDataServer.OAuth2Service.prepare_authentication_uri_query(), EDataServer.OAuth2Service.prepare_get_token_form() or EDataServer.OAuth2Service.prepare_refresh_token_form().

If the value is None, then the property named name is removed from the form instead.

New in version 3.28.

EDataServer.queue_transfer(src_queue, dst_queue)
Parameters:

Transfers the contents of src_queue to the tail of dst_queue. When the operation is complete, src_queue will be empty.

New in version 3.8.

EDataServer.secret_store_delete_sync(uid, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

Deletes the secret for uid from either the default keyring or session keyring.

Note the boolean return value indicates whether the delete operation itself completed successfully, not whether the secret was found and deleted. If no such secret was found, the function will still return True. If an error occurs, the function sets error and returns False.

New in version 3.18.

EDataServer.secret_store_lookup_sync(uid, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on error

out_secret:return location for the secret, or None

Return type:

(bool, out_secret: str)

Looks up a secret for the uid. Both the default and session keyrings are queried.

Note the boolean return value indicates whether the lookup operation itself completed successfully, not whether the secret was found. If no secret was found, the function will set out_secret to None, but still return True. If an error occurs, the function sets error and returns False.

New in version 3.18.

EDataServer.secret_store_store_sync(uid, secret, label, permanently, cancellable)
Parameters:
  • uid (str) – a unique identifier of the secret
  • secret (str) – the secret to store
  • label (str) – human readable description of the secret
  • permanently (bool) – store permanently or just for the session
  • cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, or None
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

Stores the secret for the uid.

If permanently is True, the secret is stored in the default keyring. Otherwise the secret is stored in the memory-only session keyring. If an error occurs, the function sets error and returns False.

New in version 3.18.

EDataServer.soup_ssl_trust_connect(soup_message, source)
Parameters:

Sets up automatic SSL certificate trust handling for soup_message using the trust data stored in source’s WebDAV extension. If soup_message is about to be sent on an SSL connection with an invalid certificate, the code checks if the WebDAV extension already has a trust response for that certificate and verifies it with EDataServer.SourceWebdav.verify_ssl_trust(). If the verification fails, then the soup_message send also fails.

This works by connecting to the “network-event” signal on soup_message and connecting to the “accept-certificate” signal on each Gio.TlsConnection for which soup_message reports a Gio.SocketClientEvent.TLS_HANDSHAKING event. These handlers are torn down automatically when soup_message is disposed. This process is not thread-safe; it is sufficient for safety if all use of soup_message’s session and the disposal of soup_message occur in the same thread.

New in version 3.16.

EDataServer.strftime(string, max, fmt, tm)
Parameters:
  • string (str) – The string array to store the result in.
  • max (int) – The size of array s.
  • fmt (str) – The formatting to use on tm.
  • tm (object or None) – The time value to format.
Returns:

The number of characters placed in s.

Return type:

int

This function is a wrapper around the strftime (3) function, which converts the %l and %k (12h and 24h) format variables if necessary.

EDataServer.time_format_date_and_time(date_tm, use_24_hour_format, show_midnight, show_zero_seconds, buffer, buffer_size)
Parameters:
  • date_tm (object or None) – The #tm to convert to a string.
  • use_24_hour_format (bool) – A bool.
  • show_midnight (bool) – A bool.
  • show_zero_seconds (bool) – A bool.
  • buffer (str) – A str buffer to store the time string in.
  • buffer_size (int) – The length of buffer.

Creates a string representation of the time value date_tm and stores it in buffer. buffer_size should be at least 64 to be safe. If show_midnight is False, and the time is midnight, then only the date is stored in buffer. If show_zero_seconds is False, then if the time has zero seconds only the hour and minute of the time are stored in buffer.

EDataServer.time_format_time(date_tm, use_24_hour_format, show_zero_seconds, buffer, buffer_size)
Parameters:
  • date_tm (object or None) – The #tm to convert to a string.
  • use_24_hour_format (bool) – A bool.
  • show_zero_seconds (bool) – A bool.
  • buffer (str) – The str buffer to store the result in.
  • buffer_size (int) – The length of buffer.

Creates a string representation of a time value in date_tm and stores it in buffer. buffer_size should be at least 64.

EDataServer.time_get_d_fmt_with_4digit_year()
Returns:a newly-allocated date format string
Return type:str

Retrieves a date format string with a 4-digit year (D_FMT on systems with nl_langinfo() available). In case the current locale doesn’t support 4-digit year, the function returns format as specified by the locale.

Free the returned string with GLib.free().

New in version 2.22.

EDataServer.time_parse_date(value, result)
Parameters:
  • value (str) – A date string.
  • result (object or None) – Return value for the parsed date.
Returns:

An EDataServer.TimeParseStatus result code indicating whether value was an empty string, a valid date, or an invalid date.

Return type:

EDataServer.TimeParseStatus

Takes in a date string entered by the user and tries to convert it to a struct #tm.

EDataServer.time_parse_date_and_time(value, result)
Parameters:
  • value (str) – the string to parse a date and time from
  • result (object or None) – a #tm to store the result in
Returns:

EDataServer.TimeParseStatus.OK if the string was successfully parsed, EDataServer.TimeParseStatus.NONE if the string was empty, or EDataServer.TimeParseStatus.INVALID if the string could not be parsed.

Return type:

EDataServer.TimeParseStatus

Parses a string value containing a date and a time and stores the result in result. The date in value is expected to be in a format like “Wed 3/13/00 14:20:00”, though gettext() is used to support the appropriate local formats. There is also some leniency on the format of the string, e.g. the weekday can be skipped or 12-hour formats with am/pm can be used.

EDataServer.time_parse_date_and_time_ex(value, result, two_digit_year)
Parameters:
  • value (str) – The string to parse a date and time from.
  • result (object or None) – A #tm to store the result in.
  • two_digit_year (bool) – set to True, is parsing with two-digit year, else False, but only when not None.
Returns:

EDataServer.TimeParseStatus.OK if the string was successfully parsed, EDataServer.TimeParseStatus.NONE if the string was empty, or EDataServer.TimeParseStatus.INVALID if the string could not be parsed.

Return type:

EDataServer.TimeParseStatus

Parses a string value containing a date and a time and stores the result in result. The date in value is expected to be in a format like “Wed 3/13/00 14:20:00”, though gettext() is used to support the appropriate local formats. There is also some leniency on the format of the string, e.g. the weekday can be skipped or 12-hour formats with am/pm can be used.

New in version 2.22.

EDataServer.time_parse_date_ex(value, result, two_digit_year)
Parameters:
  • value (str) – A date string.
  • result (object or None) – Return value for the parsed date.
  • two_digit_year (bool) – set to True, is parsing with two-digit year, else False, but only when not None.
Returns:

An EDataServer.TimeParseStatus result code indicating whether value was an empty string, a valid date, or an invalid date.

Return type:

EDataServer.TimeParseStatus

Takes in a date string entered by the user and tries to convert it to a struct #tm.

New in version 2.22.

EDataServer.time_parse_time(value, result)
Parameters:
  • value (str) – The string to parse a time from.
  • result (object or None) – A #tm to store the result in.
Returns:

An EDataServer.TimeParseStatus result code indicating whether value was an empty string, a valid date, or an invalid date.

Return type:

EDataServer.TimeParseStatus

Parses value, a string containing a time. value is expected to be in a format like “14:20:00”. gettext() is used to support the appropriate local formats and slightly different formats, such as 12-hour formats with am/pm, are accepted as well.

EDataServer.timeout_add_seconds_with_name(priority, interval, name, function, *data)
Parameters:
Returns:

the ID (greater than 0) of the event source

Return type:

int

Similar to GLib.timeout_add_seconds(), but also names the GLib.Source as name.

You might find e_named_timeout_add_seconds() or e_named_timeout_add_seconds_full() more convenient. Those macros name the GLib.Source implicitly.

New in version 3.12.

EDataServer.timeout_add_with_name(priority, interval, name, function, *data)
Parameters:
Returns:

the ID (greather than 0) of the event source

Return type:

int

Similar to GLib.timeout_add(), but also names the GLib.Source as name.

You might find e_named_timeout_add() or e_named_timeout_add_full() more convenient. Those macros name the GLib.Source implicitly.

New in version 3.12.

EDataServer.type_traverse(parent_type, func, *user_data)
Parameters:

Calls func for all instantiable subtypes of parent_type.

This is often useful for extending functionality by way of EDataServer.Module. A module may register a subtype of parent_type in its e_module_load() function. Then later on the application will call EDataServer.type_traverse() to instantiate all registered subtypes of parent_type.

New in version 3.4.

EDataServer.uid_new()
Returns:The newly generated UID. The caller should free the string when it’s done with it.
Return type:str

Generate a new unique string for use e.g. in account lists.

Deprecated since version 3.26: Use EDataServer.util_generate_uid() instead.

EDataServer.utf8_strftime(string, max, fmt, tm)
Parameters:
  • string (str) – The string array to store the result in.
  • max (int) – The size of array s.
  • fmt (str) – The formatting to use on tm.
  • tm (object or None) – The time value to format.
Returns:

The number of characters placed in s.

Return type:

int

The UTF-8 equivalent of EDataServer.strftime ().

EDataServer.util_can_use_collection_as_credential_source(collection_source, child_source)
Parameters:
Returns:

whether collection_source can be used as a credential source for child_source, that is, whether they share credentials.

Return type:

bool

Checks whether the collection_source can be used as a credential source for the child_source. The relationship is not tested in the function. When the collection_source is None, then it simply returns False.

New in version 3.28.

EDataServer.util_copy_object_slist(copy_to, objects)
Parameters:
Returns:

New head of copy_to. Returned pointer can be freed with EDataServer.util_free_object_slist().

Return type:

[GObject.Object]

Copies GLib.SList of GObject.Object s at the end of copy_to.

New in version 3.4.

Deprecated since version 3.8: Use g_slist_copy_deep() instead, and optionally g_slist_concat() to concatenate the copied list to another GLib.SList.

EDataServer.util_copy_string_slist(copy_to, strings)
Parameters:
Returns:

New head of copy_to. Returned pointer can be freed with EDataServer.util_free_string_slist().

Return type:

[str]

Copies GLib.SList of strings at the end of copy_to.

New in version 3.4.

Deprecated since version 3.8: Use g_slist_copy_deep() instead, and optionally g_slist_concat() to concatenate the copied list to another GLib.SList.

EDataServer.util_ensure_gdbus_string(str, gdbus_str)
Parameters:
  • str (str) – a possibly invalid UTF-8 string, or None
  • gdbus_str (str) – return location for the corrected string
Returns:

a valid UTF-8 string

Return type:

str

If str is a valid UTF-8 string, the function returns str and does not set gdbus_str.

If str is an invalid UTF-8 string, the function calls EDataServer.util_utf8_make_valid() and points gdbus_str to the newly-allocated, valid UTF-8 string, and also returns it. The caller should free the string pointed to by gdbus_str with GLib.free().

If str is None, the function returns an empty string and does not set gdbus_str.

Admittedly, the function semantics are a little awkward. The example below illustrates the easiest way to cope with the gdbus_str argument:

const gchar *trusted_utf8;
gchar *allocated = NULL;

trusted_utf8 = e_util_ensure_gdbus_string (untrusted_utf8, &allocated);

Do stuff with trusted_utf8, then clear it.

trusted_utf8 = NULL;

g_free (allocated);
allocated = NULL;

New in version 3.0.

EDataServer.util_free_nullable_object_slist(objects)
Parameters:objects ([GObject.Object]) – a GLib.SList of nullable GObject.Object s

Calls GObject.Object.unref() on each member of objects if non-None and then frees also objects itself.

New in version 3.6.

EDataServer.util_free_object_slist(objects)
Parameters:objects ([GObject.Object]) – a GLib.SList of GObject.Object s

Calls GObject.Object.unref() on each member of objects and then frees also objects itself.

New in version 3.4.

Deprecated since version 3.8: Use g_slist_free_full() instead.

EDataServer.util_free_string_slist(strings)
Parameters:strings ([str]) – a GLib.SList of strings (str *)

Frees memory previously allocated by EDataServer.util_strv_to_slist().

New in version 3.4.

Deprecated since version 3.8: Use g_slist_free_full() instead.

EDataServer.util_generate_uid()
Returns:generated unique identificator as a newly allocated string
Return type:str

Generates a unique identificator, which can be used as Camel.part of the Message-ID header, or iCalendar component UID, or vCard UID. The resulting string doesn’t contain any host name, it’s a hexa-decimal string with no particular meaning.

Free the returned string with GLib.free(), when no longer needed.

New in version 3.26.

EDataServer.util_get_source_full_name(registry, source)
Parameters:
Returns:

Full name of the source as a newly allocated string, which should be freed with GLib.free() when done with it.

Return type:

str

Constructs a full name of the source with all of its parents of the form: “<account-name> : <parent>/<source>” where the “<parent>/” Camel.part can be repeated zero or more times, depending on the deep level of the source.

EDataServer.util_gthread_id(thread)
Parameters:thread (GLib.Thread) – A GLib.Thread pointer
Returns:A 64-bit integer.
Return type:int

Returns a 64-bit integer hopefully uniquely identifying the thread. To be used in debugging output and logging only. The returned value is just a cast of a pointer to the 64-bit integer.

There is no guarantee that calling EDataServer.util_gthread_id () on one thread first and later after that thread has dies on another won’t return the same integer.

On Linux and Win32, known to really return a unique id for each thread existing at a certain time. No guarantee that ids won’t be reused after a thread has terminated, though.

New in version 2.32.

EDataServer.util_identity_can_send(registry, identity_source)
Parameters:
Returns:

Whether identity_source can be used to send messages

Return type:

bool

Checks whether the identity_source can be used for sending, which means whether it has configures send mail source.

New in version 3.26.

EDataServer.util_safe_free_string(str)
Parameters:str (str) – a string to free

Calls GLib.free() on string, but before it rewrites its content with zeros. This is suitable to free strings with passwords.

New in version 3.16.

EDataServer.util_slist_to_strv(strings)
Parameters:strings ([str]) – a GLib.SList of strings (const str *)
Returns:Newly allocated None-terminated array of strings. Returned pointer should be freed with GLib.strfreev().

Note: Pair function for this is EDataServer.util_strv_to_slist().

Return type:[str]

Convert list of strings into None-terminates array of strings.

New in version 3.4.

EDataServer.util_strcmp0(str1, str2)
Parameters:
  • str1 (str) – a C string on None
  • str2 (str) – another C string or None
Returns:

an integer less than 0 when str1 is before str2; 0 when the strings are equal and an integer greated than 0 when str1 is after str2.

Return type:

int

Compares str1 and str2 like GLib.strcmp0(), except it handles None and empty strings as equal.

New in version 3.32.

EDataServer.util_strdup_strip(string)
Parameters:string (str or None) – a string value, or None
Returns:a newly-allocated, stripped copy of string, or None
Return type:str

Duplicates string and strips off any leading or trailing whitespace. The resulting string is returned unless it is empty or None, in which case the function returns None.

Free the returned string with GLib.free().

New in version 3.6.

EDataServer.util_strstrcase(haystack, needle)
Parameters:
  • haystack (str) – The string to search in.
  • needle (str) – The string to search for.
Returns:

A pointer to the start of needle in haystack, or None if needle is not found.

Return type:

str

Find the first instance of needle in haystack, ignoring case for bytes that are ASCII characters.

EDataServer.util_strv_equal(v1, v2)
Parameters:
Returns:

whether v1 and v2 are identical

Return type:

bool

Compares v1 and v2 for equality, handling None gracefully.

The arguments types are generic for compatibility with GLib.EqualFunc.

New in version 3.12.

EDataServer.util_strv_to_slist(strv)
Parameters:strv (str) – a None-terminated array of strings (const str *)
Returns:Newly allocated GLib.SList of newly allocated strings. The returned pointer should be freed with EDataServer.util_free_string_slist().

Note: Pair function for this is EDataServer.util_slist_to_strv().

Return type:[str]

Convert None-terminated array of strings to a list of strings.

New in version 3.4.

EDataServer.util_unicode_get_utf8(text, out)
Parameters:
  • text (str) – The string to take the UTF-8 character from.
  • out (str) – The location to store the UTF-8 character in.
Returns:

A pointer to the next character in text after out.

Return type:

str

Get a UTF-8 character from the beginning of text.

EDataServer.util_unref_in_thread(object)
Parameters:object (object or None) – a GObject.Object

Unrefs the given object in a dedicated thread. This is useful when unreffing object deep in call stack when the caller might still use the object and this being the last reference to it.

New in version 3.26.

EDataServer.util_utf8_data_make_valid(data, data_bytes)
Parameters:
  • data (str) – UTF-8 binary data
  • data_bytes (int) – length of the binary data
Returns:

a newly-allocated string

Return type:

str

Returns a newly-allocated None-terminated string with invalid characters replaced by Unicode replacement characters (U+FFFD). For None data returns newly allocated empty string (“”).

New in version 3.6.

EDataServer.util_utf8_decompose(text)
Parameters:text (str) – a UTF-8 string
Returns:A newly allocated string, a decomposed variant of the text. Free with GLib.free(), when no longer needed.
Return type:str

Converts the text into a decomposed variant and strips it, which allows also cheap case insensitive comparision afterwards. This produces an output as being used in EDataServer.util_utf8_strstrcasedecomp().

New in version 3.26.

EDataServer.util_utf8_make_valid(str)
Parameters:str (str) – a UTF-8 string
Returns:a newly-allocated string
Return type:str

Returns a newly-allocated copy of str, with invalid characters replaced by Unicode replacement characters (U+FFFD). For None str returns newly allocated empty string (“”).

New in version 3.0.

EDataServer.util_utf8_normalize(str)
Parameters:str (str) – a UTF-8 string
Returns:The normalized version of str, or None if str was not valid UTF-8
Return type:str

Normalizes str by making it all lower case and removing any accents from it.

New in version 3.8.

EDataServer.util_utf8_remove_accents(str)
Parameters:str (str) – a UTF-8 string, or None
Returns:a newly-allocated string
Return type:str

Returns a newly-allocated copy of str with accents removed.

New in version 2.28.

EDataServer.util_utf8_strcasecmp(s1, s2)
Parameters:
  • s1 (str) – a UTF-8 string
  • s2 (str) – another UTF-8 string
Returns:

< 0 if s1 compares before s2, 0 if they compare equal, > 0 if s1 compares after s2

Return type:

int

Compares two UTF-8 strings using approximate case-insensitive ordering.

EDataServer.util_utf8_strstrcase(haystack, needle)
Parameters:
  • haystack (str) – The string to search in.
  • needle (str) – The string to search for.
Returns:

A pointer to the first instance of needle in haystack, or None if no match is found, or if either of the strings are not legal UTF-8 strings.

Return type:

str

Find the first instance of needle in haystack, ignoring case. (No proper case folding or decomposing is done.) Both needle and haystack are UTF-8 strings.

EDataServer.util_utf8_strstrcasedecomp(haystack, needle)
Parameters:
  • haystack (str) – The string to search in.
  • needle (str) – The string to search for.
Returns:

A pointer to the first instance of needle in haystack, or None if either of the strings are not legal UTF-8 strings.

Return type:

str

Find the first instance of needle in haystack, where both needle and haystack are UTF-8 strings. Both strings are stripped and decomposed for comparison, and case is ignored.

EDataServer.webdav_access_control_entry_free(ptr)
Parameters:ptr (object or None) – an EDataServer.WebDAVAccessControlEntry

Frees an EDataServer.WebDAVAccessControlEntry previously created with EDataServer.WebDAVAccessControlEntry.new() or EDataServer.WebDAVAccessControlEntry.copy(). The function does nothing, if ptr is None.

New in version 3.26.

EDataServer.webdav_discover_free_discovered_sources(discovered_sources)
Parameters:discovered_sources ([EDataServer.WebDAVDiscoveredSource]) – A GLib.SList of discovered sources

Frees a GSList of discovered sources returned from EDataServer.webdav_discover_sources_finish() or EDataServer.webdav_discover_sources_sync().

New in version 3.18.

EDataServer.webdav_discover_sources(source, url_use_path, only_supports, credentials, cancellable, callback, *user_data)
Parameters:

Asynchronously runs discovery of the WebDAV sources (CalDAV and CardDAV), eventually limited by the only_supports filter, which can be EDataServer.WebDAVDiscoverSupports.NONE to search all types. Note that the list of returned calendars can be more general, thus check for its actual support type for further filtering of the results. The url_use_path can be used to override actual server path, or even complete URL, for the given source.

When the operation is finished, callback will be called. You can then call EDataServer.webdav_discover_sources_finish() to get the result of the operation.

New in version 3.18.

EDataServer.webdav_discover_sources_finish(source, result)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on failure

out_certificate_pem:
 optional return location for a server SSL certificate in PEM format, when the operation failed with an SSL error
out_certificate_errors:
 optional Gio.TlsCertificateFlags, with certificate error flags when the operation failed with SSL error
out_discovered_sources:
 a GLib.SList of all discovered sources
out_calendar_user_addresses:
 a GLib.SList of all discovered mail addresses for calendar sources

Return type:

(bool, out_certificate_pem: str, out_certificate_errors: Gio.TlsCertificateFlags, out_discovered_sources: [EDataServer.WebDAVDiscoveredSource], out_calendar_user_addresses: [str])

Finishes the operation started with EDataServer.webdav_discover_sources(). If an error occurred, the function will set error and return False. The function can return success and no discovered sources, the same as it can return failure, but still set some output arguments, like the certificate related output arguments with Soup.Status.SSL_FAILED error.

The return value of out_certificate_pem should be freed with GLib.free() when no longer needed.

The return value of out_discovered_sources should be freed with EDataServer.webdav_discover_free_discovered_sources() when no longer needed.

The return value of out_calendar_user_addresses should be freed with g_slist_free_full (calendar_user_addresses, GLib.free); when no longer needed.

New in version 3.18.

EDataServer.webdav_discover_sources_full(source, url_use_path, only_supports, credentials, ref_source_func, ref_source_func_user_data, cancellable, callback, *user_data)
Parameters:

This is the same as EDataServer.webdav_discover_sources(), it only allows to provide a callback function (with its user_data), to reference an additional EDataServer.Source. It’s good to avoid creating its own EDataServer.SourceRegistry instance to get it.

When the operation is finished, callback will be called. You can then call EDataServer.webdav_discover_sources_finish() to get the result of the operation.

New in version 3.30.

EDataServer.webdav_discover_sources_full_sync(source, url_use_path, only_supports, credentials, ref_source_func, ref_source_func_user_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on failure

out_certificate_pem:
 optional return location for a server SSL certificate in PEM format, when the operation failed with an SSL error
out_certificate_errors:
 optional Gio.TlsCertificateFlags, with certificate error flags when the operation failed with SSL error
out_discovered_sources:
 a GLib.SList of all discovered sources
out_calendar_user_addresses:
 a GLib.SList of all discovered mail addresses for calendar sources

Return type:

(bool, out_certificate_pem: str or None, out_certificate_errors: Gio.TlsCertificateFlags, out_discovered_sources: [EDataServer.WebDAVDiscoveredSource], out_calendar_user_addresses: [str])

This is the same as EDataServer.webdav_discover_sources_sync(), it only allows to provide a callback function (with its user_data), to reference an additional EDataServer.Source. It’s good to avoid creating its own EDataServer.SourceRegistry instance to get it.

New in version 3.30.

EDataServer.webdav_discover_sources_sync(source, url_use_path, only_supports, credentials, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on failure

out_certificate_pem:
 optional return location for a server SSL certificate in PEM format, when the operation failed with an SSL error
out_certificate_errors:
 optional Gio.TlsCertificateFlags, with certificate error flags when the operation failed with SSL error
out_discovered_sources:
 a GLib.SList of all discovered sources
out_calendar_user_addresses:
 a GLib.SList of all discovered mail addresses for calendar sources

Return type:

(bool, out_certificate_pem: str, out_certificate_errors: Gio.TlsCertificateFlags, out_discovered_sources: [EDataServer.WebDAVDiscoveredSource], out_calendar_user_addresses: [str])

Synchronously runs discovery of the WebDAV sources (CalDAV and CardDAV), eventually limited by the only_supports filter, which can be EDataServer.WebDAVDiscoverSupports.NONE to search all types. Note that the list of returned calendars can be more general, thus check for its actual support type for further filtering of the results. The url_use_path can be used to override actual server path, or even complete URL, for the given source.

If an error occurred, the function will set error and return False. The function can return success and no discovered sources, the same as it can return failure, but still set some output arguments, like the certificate related output arguments with Soup.Status.SSL_FAILED error.

The return value of out_certificate_pem should be freed with GLib.free() when no longer needed.

The return value of out_discovered_sources should be freed with EDataServer.webdav_discover_free_discovered_sources() when no longer needed.

The return value of out_calendar_user_addresses should be freed with g_slist_free_full (calendar_user_addresses, GLib.free); when no longer needed.

New in version 3.18.

EDataServer.webdav_privilege_free(ptr)
Parameters:ptr (object or None) – an EDataServer.WebDAVPrivilege

Frees an EDataServer.WebDAVPrivilege previously created with EDataServer.WebDAVPrivilege.new() or EDataServer.WebDAVPrivilege.copy(). The function does nothing, if ptr is None.

New in version 3.26.

EDataServer.webdav_property_change_free(ptr)
Parameters:ptr (object or None) – an EDataServer.WebDAVPropertyChange

Frees an EDataServer.WebDAVPropertyChange previously created with EDataServer.WebDAVPropertyChange.new_set(), EDataServer.WebDAVPropertyChange.new_remove() or or EDataServer.WebDAVPropertyChange.copy(). The function does nothing, if ptr is None.

New in version 3.26.

EDataServer.webdav_resource_free(ptr)
Parameters:ptr (object or None) – an EDataServer.WebDAVResource

Frees an EDataServer.WebDAVResource previously created with EDataServer.WebDAVResource.new() or EDataServer.WebDAVResource.copy(). The function does nothing, if ptr is None.

New in version 3.26.

EDataServer.xml_destroy_hash(hash)
Parameters:hash ({str: str}) – the GLib.HashTable to destroy

Frees the memory used by hash and its contents.

EDataServer.xml_save_file(filename, doc)
Parameters:
  • filename (str) – path to a file to save to
  • doc (libxml2.Doc) – an XML document structure
Returns:

0 on success, -1 on failure

Return type:

int

Writes the given XML document structure to the file given by filename. If an error occurs while saving, the function returns -1 and sets errno.

EDataServer.xml_to_hash(doc, type)
Parameters:
Returns:

The newly-created GLib.HashTable representation of doc.

Return type:

{str: str}

Creates a GLib.HashTable representation of the libxml2.Doc doc. If type is * EDataServer.XmlHashType.PROPERTY, all XML nodes will be indexed in the GLib.HashTable by name. If type is EDataServer.XmlHashType.OBJECT_UID, then XML objects will be indexed in the hash by their UID (other nodes will still be indexed by name).

EDataServer.xmlhash_add(hash, key, data)
Parameters:

Adds a new key/value pair to the EDataServer.XmlHash hash.

EDataServer.xmlhash_compare(hash, key, compare_data)
Parameters:
Returns:

EDataServer.XmlHashStatus.SAME if the value and compare_data are equal,:obj:EDataServer.XmlHashStatus.DIFFERENT if they are different, or EDataServer.XmlHashStatus.NOT_FOUND if there is no entry in hash with its key equal to key.

Return type:

EDataServer.XmlHashStatus

Compares the value with key equal to key in hash against compare_data.

EDataServer.xmlhash_destroy(hash)
Parameters:hash (EDataServer.XmlHash) – The EDataServer.XmlHash to destroy.

Frees the memory associated with hash.

EDataServer.xmlhash_foreach_key(hash, func, *user_data)
Parameters:

Executes func against each key/value pair in hash.

EDataServer.xmlhash_foreach_key_remove(hash, func, *user_data)
Parameters:

Calls g_hash_table_foreach_remove() on hash ‘s internal hash table. See g_hash_table_foreach_remove() for details.

EDataServer.xmlhash_remove(hash, key)
Parameters:

Remove the entry in hash with key equal to key, if it exists.

EDataServer.xmlhash_write(hash)
Parameters:hash (EDataServer.XmlHash) – The EDataServer.XmlHash to write.

Writes the XML represented by hash to the file originally passed to e_xmlhash_new().