Callbacks¶
|
|
|
Details¶
- GData.BatchOperationCallback(operation_id, operation_type, entry, error, *user_data)¶
- Parameters:
operation_id (
int
) – the operation ID returned from gdata_batch_operation_add_*()operation_type (
GData.BatchOperationType
) – the type of operation which was requestedentry (
GData.Entry
) – the result of the operation, orNone
error (
GLib.Error
) – aGLib.Error
describing any error which occurred, orNone
user_data (
object
orNone
) – user data passed to the callback
Callback function called once for each operation in a batch operation run. The operation is identified by operation_id and operation_type (where operation_id is the ID returned by the relevant call to
GData.BatchOperation.add_query
(),GData.BatchOperation.add_insertion
(),GData.BatchOperation.add_update
() orGData.BatchOperation.add_deletion
(), and operation_type shows which one of the above was called).If the operation was successful, the resulting
GData.Entry
will be passed in as entry, and error will beNone
. Otherwise, entry will beNone
and a descriptive error will be in error. If operation_type isGData.BatchOperationType.DELETION
, entry will always beNone
, and error will beNone
or non-None
as appropriate.If the callback code needs to retain a copy of entry, it must be referenced (with
GObject.Object.ref
()). Similarly, error is owned by the calling code, and must not be freed.The callback is called in the main thread, and there is no guarantee on the order in which the callbacks for the operations in a run are executed, or whether they will be called in a timely manner. It is, however, guaranteed that they will all be called before the
Gio.AsyncReadyCallback
which signals the completion of the run (if initiated withGData.BatchOperation.run_async
()) is called; orGData.BatchOperation.run
() returns (if initiated synchronously).New in version 0.7.0.
- GData.QueryProgressCallback(entry, entry_key, entry_count, *user_data)¶
- Parameters:
entry (
GData.Entry
) – a newGData.Entry
entry_key (
int
) – the key of the entry (zero-based index of its position in the feed)entry_count (
int
) – the total number of entries in the feeduser_data (
object
orNone
) – user data passed to the callback
Callback function called for each
GData.Entry
parsed in aGData.Feed
when loading the results of a query.It is called in the main thread, so there is no guarantee on the order in which the callbacks are executed, or whether they will be called in a timely manner. It is, however, guaranteed that they will all be called before the
Gio.AsyncReadyCallback
which signals the completion of the query is called.