Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- EDataServer.binding_bind_property(source, source_property, target, target_property, flags)¶
- Parameters:
source (
GObject.Object
) – the sourceGObject.Object
source_property (
str
) – the property on source to bindtarget (
GObject.Object
) – the targetGObject.Object
target_property (
str
) – the property on target to bindflags (
GObject.BindingFlags
) – flags to pass toGObject.Binding
- Return type:
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:
source (
GObject.Object
) – the sourceGObject.Object
source_property (
str
) – the property on source to bindtarget (
GObject.Object
) – the targetGObject.Object
target_property (
str
) – the property on target to bindflags (
GObject.BindingFlags
) – flags to pass toGObject.Binding
transform_to (
GObject.Closure
orNone
) – aGObject.Closure
wrapping the transformation function from the source to the target, orNone
to use the defaulttransform_from (
GObject.Closure
orNone
) – aGObject.Closure
wrapping the transformation function from the target to the source, orNone
to use the default
- Returns:
the
GObject.Binding
instance representing the binding between the twoGObject.Object
instances. The binding is released whenever theGObject.Binding
reference count reaches zero.- Return type:
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:
binding (
GObject.Binding
) – aGObject.Binding
source_value (
GObject.Value
) – aGObject.Value
of typeGObject.TYPE_STRING
target_value (
GObject.Value
) – aGObject.Value
whose type is derived fromGObject.TYPE_ENUM
- Returns:
True
if the enum nickname has a corresponding value- Return type:
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:
binding (
GObject.Binding
) – aGObject.Binding
source_value (
GObject.Value
) – aGObject.Value
whose type is derived fromGObject.TYPE_ENUM
target_value (
GObject.Value
) – aGObject.Value
of typeGObject.TYPE_STRING
- Returns:
True
if the enum value has a corresponding nickname- Return type:
Transforms an enumeration value to its corresponding nickname.
New in version 3.4.
- EDataServer.categories_add(category, unused, icon_file, searchable)¶
- Parameters:
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:
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 usingGLib.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:
- Return type:
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:
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)¶
-
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
orNone
) – 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)¶
-
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
orNone
) – 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.data_server_util_get_dbus_call_timeout()¶
- Returns:
the D-Bus call timeout in milliseconds
- Return type:
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:
- Returns:
whether succeeded
- Return type:
Saves current log information to the given filename.
New in version 2.32.
- EDataServer.debug_log_dump_to_dated_file()¶
- Raises:
- Returns:
whether succeeded
- Return type:
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_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:
New in version 2.32.
- EDataServer.debug_log_load_configuration(filename)¶
- Parameters:
filename (
str
) – a configuration file name- Raises:
- Returns:
whether succeeded
- Return type:
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:
- 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:
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 typestring (
str
) – The string containing the enum value or nickenum_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:
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 typeenum_value (
int
) – The enum value to convert
- Returns:
the string representing eval
- Return type:
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:
io_priority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – data to pass to the callback function
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:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
- Return type:
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:
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
- Return type:
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 errorGio.IOErrorEnum.CANCELLED
will be returned.New in version 3.6.
- EDataServer.filename_mkdir_encoded(basepath, fileprefix, filename, fileindex)¶
- Parameters:
- 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:
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:
free_form_exp (
str
) – a Free Form Expressionsymbols (
EDataServer.FreeFormExpSymbol
) – known symbols, which can be used in the Free From Expression
- Returns:
converted free_form_exp into S-Expression,
None
on error. Free the returned string with aGLib.free
(), when done with it.- Return type:
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. TheNone
should be set for the symbol’s name.New in version 3.16.
- EDataServer.gdata_task_add_completed(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object membervalue (
int
) – a Task::completed property value, as Unix time
Adds a Task:completed property value into the builder, which should have started an object member.
When the value is 0, then adds a
None
-object, to indicate removal of the property.New in version 3.46.
- EDataServer.gdata_task_add_due(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object membervalue (
int
) – a Task::due property value, as Unix time
Adds a Task::due property value into the builder, which should have started an object member.
When the value is 0, then adds a
None
-object, to indicate removal of the property.New in version 3.46.
- EDataServer.gdata_task_add_id(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object membervalue (
str
) – a Task::id property value
Adds a Task::id property value into the builder, which should have started an object member.
New in version 3.46.
- EDataServer.gdata_task_add_notes(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object member
Adds a Task::notes property value into the builder, which should have started an object member.
When the value is
None
, then adds aNone
-object, to indicate removal of the property.New in version 3.46.
- EDataServer.gdata_task_add_status(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object membervalue (
EDataServer.GDataTaskStatus
) – a Task::status property value
Adds a Task::status property value into the builder, which should have started an object member.
When the value is
EDataServer.GDataTaskStatus.UNKNOWN
, then adds aNone
-object, to indicate removal of the property.New in version 3.46.
- EDataServer.gdata_task_add_title(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object membervalue (
str
) – a Task::title property value
Adds a Task::title property value into the builder, which should have started an object member.
New in version 3.46.
- EDataServer.gdata_task_get_completed(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::completed property or 0, when not found
- Return type:
Returns Task::completed property, as Unix time.
New in version 3.46.
- EDataServer.gdata_task_get_deleted(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::deleted property or
False
, when not found- Return type:
Returns Task::deleted property, as Unix time.
New in version 3.46.
- EDataServer.gdata_task_get_due(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::due property or 0, when not found
- Return type:
Returns Task::due property, as Unix time.
New in version 3.46.
- EDataServer.gdata_task_get_etag(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::etag property or
None
, when not found- Return type:
Returns Task::etag property.
New in version 3.46.
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::hidden property or
False
, when not found- Return type:
Returns Task::hidden property, as Unix time.
New in version 3.46.
- EDataServer.gdata_task_get_id(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::id property or
None
, when not found- Return type:
Returns Task::id property.
New in version 3.46.
- EDataServer.gdata_task_get_notes(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::notes property or
None
, when not found- Return type:
Returns Task::notes property.
New in version 3.46.
- EDataServer.gdata_task_get_parent(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::parent property or
None
, when not found- Return type:
Returns Task::parent property.
New in version 3.46.
- EDataServer.gdata_task_get_position(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::position property or
None
, when not found- Return type:
Returns Task::position property.
New in version 3.46.
- EDataServer.gdata_task_get_self_link(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
TaskList- Returns:
Task::selfLink property or
None
, when not found- Return type:
Returns Task::selfLink property.
New in version 3.46.
- EDataServer.gdata_task_get_status(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::status property as
EDataServer.GDataTaskStatus
orEDataServer.GDataTaskStatus.UNKNOWN
, when not found or has set an unknown value.- Return type:
Returns Task::status property.
New in version 3.46.
- EDataServer.gdata_task_get_title(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::title property or
None
, when not found- Return type:
Returns Task::title property.
New in version 3.46.
- EDataServer.gdata_task_get_updated(task)¶
- Parameters:
task (
Json.Object
) – aGLib.Data
Task- Returns:
Task::updated property or 0, when not found
- Return type:
Returns Task::updated property, as Unix time.
New in version 3.46.
- EDataServer.gdata_tasklist_add_id(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object membervalue (
str
) – a TaskList::id property value
Adds a TaskList::id property value into the builder, which should have started an object member.
New in version 3.46.
- EDataServer.gdata_tasklist_add_title(builder, value)¶
- Parameters:
builder (
Json.Builder
) – aJson.Builder
with a started object membervalue (
str
) – a TaskList::title property value
Adds a TaskList::title property value into the builder, which should have started an object member.
New in version 3.46.
- EDataServer.gdata_tasklist_get_etag(tasklist)¶
- Parameters:
tasklist (
Json.Object
) – aGLib.Data
TaskList- Returns:
TaskList::etag property or
None
, when not found- Return type:
Returns TaskList::etag property.
New in version 3.46.
- EDataServer.gdata_tasklist_get_id(tasklist)¶
- Parameters:
tasklist (
Json.Object
) – aGLib.Data
TaskList- Returns:
TaskList::id property or
None
, when not found- Return type:
Returns TaskList::id property.
New in version 3.46.
- EDataServer.gdata_tasklist_get_self_link(tasklist)¶
- Parameters:
tasklist (
Json.Object
) – aGLib.Data
TaskList- Returns:
TaskList::selfLink property or
None
, when not found- Return type:
Returns TaskList::selfLink property.
New in version 3.46.
- EDataServer.gdata_tasklist_get_title(tasklist)¶
- Parameters:
tasklist (
Json.Object
) – aGLib.Data
TaskList- Returns:
TaskList::title property or
None
, when not found- Return type:
Returns TaskList::title property.
New in version 3.46.
- EDataServer.gdata_tasklist_get_updated(tasklist)¶
- Parameters:
tasklist (
Json.Object
) – aGLib.Data
TaskList- Returns:
TaskList::updated property or 0, when not found
- Return type:
Returns TaskList::updated property, as Unix time.
New in version 3.46.
- EDataServer.get_user_cache_dir()¶
- Returns:
base directory for user-specific, non-essential data
- Return type:
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:
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:
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:
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
orNone
) – The #tm to convert to a calendar time representation.- Returns:
The calendar time representation of tm.
- Return type:
Like mktime(3), but assumes UTC instead of local timezone.
- EDataServer.oauth2_service_util_compile_value(compile_value, out_glob_buff_size)¶
- Parameters:
- Returns:
processed compile_value, saved into *out_glob_buff
- out_glob_buff:
a global buffer to store the processed value to
- Return type:
Processes the compile_value and returns the result, which is stored into the out_glob_buff. The out_glob_buff should be large enough to hold the processed value and it should be a global memory buffer (usually statically allocated) initialized to 0, which is used to short-circuit the call, because the processing is done only if the first element of the out_glob_buff is 0, in all other cases the function immediately returns the out_glob_buff.
New in version 3.46.
- EDataServer.oauth2_service_util_extract_from_uri(in_uri)¶
- Parameters:
in_uri (
str
) – a URI returned from the server- Returns:
True
, when any of the non-None
out arguments had been populated.- Return type:
(
bool
, out_authorization_code:str
orNone
, out_error_code:str
orNone
, out_error_description:str
orNone
)
Extracts either an authorization code from a ‘code’ argument of the in_uri, or an error code from an ‘error’ argument of the in_uri and an error description from the ‘error_description’ argument of the in_uri.
New in version 3.48.
- 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
() orEDataServer.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 inEDataServer.OAuth2Service.prepare_authentication_uri_query
(),EDataServer.OAuth2Service.prepare_get_token_form
() orEDataServer.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:
src_queue (
GLib.Queue
) – a sourceGLib.Queue
dst_queue (
GLib.Queue
) – a destinationGLib.Queue
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:
uid (
str
) – a unique identifier of the secretcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
- Return type:
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 returnsFalse
.New in version 3.18.
- EDataServer.secret_store_lookup_sync(uid, cancellable)¶
- Parameters:
uid (
str
) – a unique identifier of the secretcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
True
on success,False
on error- out_secret:
return location for the secret, or
None
- Return type:
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 returnTrue
. If an error occurs, the function sets error and returnsFalse
.New in version 3.18.
- EDataServer.secret_store_store_sync(uid, secret, label, permanently, cancellable)¶
- Parameters:
uid (
str
) – a unique identifier of the secretsecret (
str
) – the secret to storelabel (
str
) – human readable description of the secretpermanently (
bool
) – store permanently or just for the sessioncancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
- Return type:
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 returnsFalse
.New in version 3.18.
- EDataServer.soup_ssl_trust_connect(soup_message, source)¶
- Parameters:
soup_message (
Soup.Message
) – aSoup.Message
about to be sent to the sourcesource (
EDataServer.Source
) – anEDataServer.Source
that uses WebDAV
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 aGio.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:
- Returns:
The number of characters placed in s.
- Return type:
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:
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 isFalse
, 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:
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:
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:
- Returns:
An
EDataServer.TimeParseStatus
result code indicating whether value was an empty string, a valid date, or an invalid date.- Return type:
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:
- Returns:
EDataServer.TimeParseStatus.OK
if the string was successfully parsed,EDataServer.TimeParseStatus.NONE
if the string was empty, orEDataServer.TimeParseStatus.INVALID
if the string could not be parsed.- Return type:
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:
- Returns:
EDataServer.TimeParseStatus.OK
if the string was successfully parsed,EDataServer.TimeParseStatus.NONE
if the string was empty, orEDataServer.TimeParseStatus.INVALID
if the string could not be parsed.- Return type:
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:
- Returns:
An
EDataServer.TimeParseStatus
result code indicating whether value was an empty string, a valid date, or an invalid date.- Return type:
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_date_format(value, format)¶
- Parameters:
- Returns:
An
EDataServer.TimeParseStatus
result code indicating whether the value was an empty string, a valid date, or an invalid date.- Return type:
(
EDataServer.TimeParseStatus
, out_result:object
, out_two_digit_year:bool
)
Parses value using the format saving the parsed date into out_result. Optionally sets whether there had been used two-digit year.
New in version 3.50.
- EDataServer.time_parse_time(value, result)¶
- Parameters:
- Returns:
An
EDataServer.TimeParseStatus
result code indicating whether value was an empty string, a valid date, or an invalid date.- Return type:
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:
priority (
int
) – the priority of the timeout source, typically in the range betweenGLib.PRIORITY_DEFAULT
andGLib.PRIORITY_HIGH
interval (
int
) – the time between calls to the function, in secondsfunction (
GLib.SourceFunc
) – function to call
- Returns:
the ID (greater than 0) of the event source
- Return type:
Similar to
GLib.timeout_add_seconds
(), but also names theGLib.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:
priority (
int
) – the priority of the timeout source, typically in the range betweenGLib.PRIORITY_DEFAULT
andGLib.PRIORITY_HIGH
interval (
int
) – the time between calls to the function, in milliseconds (1/1000ths of a second)function (
GLib.SourceFunc
) – function to call
- Returns:
the ID (greather than 0) of the event source
- Return type:
Similar to
GLib.timeout_add
(), but also names theGLib.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:
parent_type (
GObject.GType
) – the rootGObject.GType
to traverse fromfunc (
EDataServer.TypeFunc
) – the function to call for each visitedGObject.GType
user_data (
object
orNone
) – user data to pass to the function
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 callEDataServer.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:
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:
- Returns:
The number of characters placed in s.
- Return type:
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:
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 returnsFalse
.New in version 3.28.
- EDataServer.util_change_uri_component(inout_uri, component, value)¶
- Parameters:
component (
Soup.URIComponent
) – a stringSoup.URIComponent
to change
- Returns:
a
GLib.Uri
- Return type:
inout_uri:
GLib.Uri
Changes component component in the inout_uri to value value. As the
GLib.Uri
cannot be modified the inout_uri points to a newGLib.Uri
at the end of the call and the previous structure is unreffed.See:
EDataServer.util_change_uri_port
()New in version 3.46.
- EDataServer.util_change_uri_port(inout_uri, port)¶
-
Changes the port in the inout_uri to value port. As the
GLib.Uri
cannot be modified the inout_uri points to a newGLib.Uri
at the end of the call and the previous structure is unreffed.See:
EDataServer.util_change_uri_component
()New in version 3.46.
- EDataServer.util_copy_object_slist(copy_to, objects)¶
- Parameters:
copy_to ([
GObject.Object
] orNone
) – Where to copy; can beNone
objects ([
GObject.Object
]) –GLib.SList
ofGObject.Object
s to be copied
- Returns:
New head of copy_to. Returned pointer can be freed with
EDataServer.util_free_object_slist
().- Return type:
Copies
GLib.SList
ofGObject.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:
strings ([
str
]) –GLib.SList
of strings to be copied
- 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:
- Returns:
a valid UTF-8 string
- Return type:
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 withGLib.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
]) – aGLib.SList
of nullableGObject.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
]) – aGLib.SList
ofGObject.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
]) – aGLib.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:
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_directory_variants(main_path, replace_prefix, with_modules_dir)¶
- Parameters:
- Returns:
a
GLib.PtrArray
with paths to use, including the main_path. Free it with g_ptr_array_unref(), when no longer needed.- Return type:
[
str
]
The main_path is a directory, which will be always used. It should have as its prefix the replace_prefix, otherwise the function returns only the main_path in the paths array.
When there’s exported an environment variable EDS_EXTRA_PREFIXES, it is used as a list of alternative prefixes where to look for the main_path (rest after the replace_prefix).
When the with_modules_dir is
True
, there’s also addedGLib.get_user_data_dir
() + “evolution/modules/”, aka ~/.local/share/evolution/modules/, into the resulting array.New in version 3.40.
- EDataServer.util_get_source_full_name(registry, source)¶
- Parameters:
registry (
object
orNone
) – anEDataServer.SourceRegistry
source (
object
orNone
) – anEDataServer.Source
- Returns:
Full name of the source as a newly allocated string, which should be freed with
GLib.free
() when done with it.- Return type:
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
) – AGLib.Thread
pointer- Returns:
A 64-bit integer.
- Return type:
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_guess_source_is_readonly(source)¶
- Parameters:
source (
object
orNone
) – anEDataServer.Source
- Returns:
True
, when the source is well-known read-only source, orFalse
otherwise- Return type:
Guesses whether the source is read only. This is done on some heuristic like the source backend, where some are known to be read only. That this function returns
False
does not necessarily mean the source is writable, it only means the source is not well-known read-only source. To know for sure open the correspondingEDataServer.Client
, if the source references such, and useEDataServer.Client.is_readonly
().New in version 3.50.
- EDataServer.util_identity_can_send(registry, identity_source)¶
- Parameters:
registry (
object
orNone
) – anEDataServer.SourceRegistry
identity_source (
object
orNone
) – anEDataServer.Source
with mail identity extension
- Returns:
Whether identity_source can be used to send messages
- Return type:
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
]) – aGLib.SList
of strings (conststr
*)- Returns:
Newly allocated
None
-terminated array of strings. Returned pointer should be freed withGLib.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_source_compare_for_sort(source_a, source_b)¶
- Parameters:
source_a (
object
orNone
) – the firstEDataServer.Source
source_b (
object
orNone
) – the secondEDataServer.Source
- Returns:
an integer less than, equal to, or greater than zero, if source_a is <, == or > than source_b.
- Return type:
Compares two
EDataServer.Source
-s in a way suitable for user interface. It can be used as aGLib.CompareFunc
.This is also used by e_source_registry_build_display_tree().
New in version 3.40.
- EDataServer.util_strcmp0(str1, str2)¶
- Parameters:
- 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:
Compares str1 and str2 like
GLib.strcmp0
(), except it handlesNone
and empty strings as equal.New in version 3.32.
- EDataServer.util_strdup_strip(string)¶
- Parameters:
- Returns:
a newly-allocated, stripped copy of string, or
None
- Return type:
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 returnsNone
.Free the returned string with
GLib.free
().New in version 3.6.
- EDataServer.util_strstrcase(haystack, needle)¶
- Parameters:
- Returns:
A pointer to the start of needle in haystack, or
None
if needle is not found.- Return type:
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:
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
) – aNone
-terminated array of strings (conststr
*)- Returns:
Newly allocated
GLib.SList
of newly allocated strings. The returned pointer should be freed withEDataServer.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:
- Returns:
A pointer to the next character in text after out.
- Return type:
Get a UTF-8 character from the beginning of text.
- EDataServer.util_unref_in_thread(object)¶
- Parameters:
object (
object
orNone
) – aGObject.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:
- Returns:
a newly-allocated string
- Return type:
Returns a newly-allocated
None
-terminated string with invalid characters replaced by Unicode replacement characters (U+FFFD). ForNone
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:
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)¶
-
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:
- Returns:
The normalized version of str, or
None
if str was not valid UTF-8- Return type:
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:
- Returns:
a newly-allocated string
- Return type:
Returns a newly-allocated copy of str with accents removed.
New in version 2.28.
- EDataServer.util_utf8_strcasecmp(s1, s2)¶
- Parameters:
- Returns:
< 0 if s1 compares before s2, 0 if they compare equal, > 0 if s1 compares after s2
- Return type:
Compares two UTF-8 strings using approximate case-insensitive ordering.
- EDataServer.util_utf8_strstrcase(haystack, needle)¶
- Parameters:
- 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:
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:
- 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:
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
orNone
) – anEDataServer.WebDAVAccessControlEntry
Frees an
EDataServer.WebDAVAccessControlEntry
previously created withEDataServer.WebDAVAccessControlEntry.new
() orEDataServer.WebDAVAccessControlEntry.copy
(). The function does nothing, if ptr isNone
.New in version 3.26.
- EDataServer.webdav_discover_free_discovered_sources(discovered_sources)¶
- Parameters:
discovered_sources ([
EDataServer.WebDAVDiscoveredSource
]) – AGLib.SList
of discovered sources
Frees a GSList of discovered sources returned from
EDataServer.webdav_discover_sources_finish
() orEDataServer.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:
source (
EDataServer.Source
) – anEDataServer.Source
from which to take connection detailsonly_supports (
int
) – bit-or ofEDataServer.WebDAVDiscoverSupports
, to limit what type of sources to searchcredentials (
EDataServer.NamedParameters
orNone
) – credentials to use for authentication to the servercancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – data to pass to the callback function
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:
source (
EDataServer.Source
) – anEDataServer.Source
on which the operation was startedresult (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- 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 returnFalse
. 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 withGio.TlsError.BAD_CERTIFICATE
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:
source (
EDataServer.Source
) – anEDataServer.Source
from which to take connection detailsonly_supports (
int
) – bit-or ofEDataServer.WebDAVDiscoverSupports
, to limit what type of sources to searchcredentials (
EDataServer.NamedParameters
orNone
) – credentials to use for authentication to the serverref_source_func (
EDataServer.WebDAVDiscoverRefSourceFunc
orNone
) – optional callback to use to get anEDataServer.Source
ref_source_func_user_data (
object
orNone
) – user data for ref_source_funccancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – data to pass to the callback function
This is the same as
EDataServer.webdav_discover_sources
(), it only allows to provide a callback function (with its user_data), to reference an additionalEDataServer.Source
. It’s good to avoid creating its ownEDataServer.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:
source (
EDataServer.Source
) – anEDataServer.Source
from which to take connection detailsonly_supports (
int
) – bit-or ofEDataServer.WebDAVDiscoverSupports
, to limit what type of sources to searchcredentials (
EDataServer.NamedParameters
orNone
) – credentials to use for authentication to the serverref_source_func (
EDataServer.WebDAVDiscoverRefSourceFunc
orNone
) – optional callback to use to get anEDataServer.Source
ref_source_func_user_data (
object
orNone
) – user data for ref_source_funccancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- 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
])
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 additionalEDataServer.Source
. It’s good to avoid creating its ownEDataServer.SourceRegistry
instance to get it.New in version 3.30.
- EDataServer.webdav_discover_sources_sync(source, url_use_path, only_supports, credentials, cancellable)¶
- Parameters:
source (
EDataServer.Source
) – anEDataServer.Source
from which to take connection detailsonly_supports (
int
) – bit-or ofEDataServer.WebDAVDiscoverSupports
, to limit what type of sources to searchcredentials (
EDataServer.NamedParameters
orNone
) – credentials to use for authentication to the servercancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- 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 withGio.TlsError.BAD_CERTIFICATE
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
orNone
) – anEDataServer.WebDAVPrivilege
Frees an
EDataServer.WebDAVPrivilege
previously created withEDataServer.WebDAVPrivilege.new
() orEDataServer.WebDAVPrivilege.copy
(). The function does nothing, if ptr isNone
.New in version 3.26.
- EDataServer.webdav_property_change_free(ptr)¶
- Parameters:
ptr (
object
orNone
) – anEDataServer.WebDAVPropertyChange
Frees an
EDataServer.WebDAVPropertyChange
previously created withEDataServer.WebDAVPropertyChange.new_set
(),EDataServer.WebDAVPropertyChange.new_remove
() or orEDataServer.WebDAVPropertyChange.copy
(). The function does nothing, if ptr isNone
.New in version 3.26.
- EDataServer.webdav_resource_free(ptr)¶
- Parameters:
ptr (
object
orNone
) – anEDataServer.WebDAVResource
Frees an
EDataServer.WebDAVResource
previously created withEDataServer.WebDAVResource.new
() orEDataServer.WebDAVResource.copy
(). The function does nothing, if ptr isNone
.New in version 3.26.
- EDataServer.xml_destroy_hash(hash)¶
- Parameters:
hash ({
str
:str
}) – theGLib.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 todoc (
libxml2.Doc
) – an XML document structure
- Returns:
0 on success, -1 on failure
- Return type:
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:
doc (
libxml2.Doc
) – Thelibxml2.Doc
to store in a hash table.type (
EDataServer.XmlHashType
) – The value type to use as a key in the hash table.
- Returns:
The newly-created
GLib.HashTable
representation of doc.- Return type:
Creates a
GLib.HashTable
representation of thelibxml2.Doc
doc. If type is *EDataServer.XmlHashType.PROPERTY
, all XML nodes will be indexed in theGLib.HashTable
by name. If type isEDataServer.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:
hash (
EDataServer.XmlHash
) – theEDataServer.XmlHash
to add an entry tokey (
str
) – the key to use for the entrydata (
str
) – the value of the new entry
Adds a new key/value pair to the
EDataServer.XmlHash
hash.
- EDataServer.xmlhash_compare(hash, key, compare_data)¶
- Parameters:
hash (
EDataServer.XmlHash
) – theEDataServer.XmlHash
to compare againstkey (
str
) – the key of the hash entry to compare withcompare_data (
str
) – the data to compare against the hash entry
- Returns:
EDataServer.XmlHashStatus.SAME
if the value and compare_data are equal,:obj:EDataServer.XmlHashStatus.DIFFERENT if they are different, orEDataServer.XmlHashStatus.NOT_FOUND
if there is no entry in hash with its key equal to key.- Return type:
Compares the value with key equal to key in hash against compare_data.
- EDataServer.xmlhash_destroy(hash)¶
- Parameters:
hash (
EDataServer.XmlHash
) – TheEDataServer.XmlHash
to destroy.
Frees the memory associated with hash.
- EDataServer.xmlhash_foreach_key(hash, func, *user_data)¶
- Parameters:
hash (
EDataServer.XmlHash
) – anEDataServer.XmlHash
func (
EDataServer.XmlHashFunc
) – theEDataServer.XmlHashFunc
to execute on the data in hash
Executes func against each key/value pair in hash.
- EDataServer.xmlhash_foreach_key_remove(hash, func, *user_data)¶
- Parameters:
hash (
EDataServer.XmlHash
) – anEDataServer.XmlHash
func (
EDataServer.XmlHashRemoveFunc
) – theEDataServer.XmlHashFunc
to execute on the data in hash
Calls
GLib.HashTable.foreach_remove
() on hash ‘s internal hash table. SeeGLib.HashTable.foreach_remove
() for details.
- EDataServer.xmlhash_remove(hash, key)¶
- Parameters:
hash (
EDataServer.XmlHash
) – theEDataServer.XmlHash
to remove an entry fromkey (
str
) – the key of the entry to remove
Remove the entry in hash with key equal to key, if it exists.
- EDataServer.xmlhash_write(hash)¶
- Parameters:
hash (
EDataServer.XmlHash
) – TheEDataServer.XmlHash
to write.
Writes the XML represented by hash to the file originally passed to e_xmlhash_new().