GData.PicasaWebService

g GData.PicasaWebService GData.PicasaWebService GData.Service GData.Service GData.Service->GData.PicasaWebService GObject.Object GObject.Object GObject.Object->GData.Service

Subclasses:

None

Methods

Inherited:

GData.Service (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_primary_authorization_domain ()

class

new (authorizer)

finish_file_upload (upload_stream)

get_user (username, cancellable)

get_user_async (username, cancellable, callback, *user_data)

get_user_finish (result)

insert_album (album, cancellable)

insert_album_async (album, cancellable, callback, *user_data)

query_all_albums (query, username, cancellable, progress_callback, *progress_user_data)

query_all_albums_async (query, username, cancellable, progress_callback, progress_user_data, callback, *user_data)

query_files (album, query, cancellable, progress_callback, *progress_user_data)

query_files_async (album, query, cancellable, progress_callback, progress_user_data, callback, *user_data)

upload_file (album, file_entry, slug, content_type, cancellable)

Virtual Methods

Inherited:

GData.Service (2), GObject.Object (7)

Properties

Inherited:

GData.Service (5)

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GData.Service

r

Class Details

class GData.PicasaWebService(**kwargs)
Bases:

GData.Service

Abstract:

No

Structure:

GData.PicasaWebServiceClass

All the fields in the GData.PicasaWebService structure are private and should never be accessed directly.

New in version 0.4.0.

classmethod get_primary_authorization_domain()
Returns:

the service’s authorization domain

Return type:

GData.AuthorizationDomain

The primary GData.AuthorizationDomain for interacting with PicasaWeb. This will not normally need to be used, as it’s used internally by the GData.PicasaWebService methods. However, if using the plain GData.Service methods to implement custom queries or requests which libgdata does not support natively, then this domain may be needed to authorize the requests.

The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.

New in version 0.9.0.

classmethod new(authorizer)
Parameters:

authorizer (GData.Authorizer or None) – a GData.Authorizer to authorize the service’s requests, or None

Returns:

a new GData.PicasaWebService, or None; unref with GObject.Object.unref()

Return type:

GData.PicasaWebService

Creates a new GData.PicasaWebService using the given GData.Authorizer. If authorizer is None, all requests are made as an unauthenticated user.

New in version 0.9.0.

finish_file_upload(upload_stream)
Parameters:

upload_stream (GData.UploadStream) – the GData.UploadStream from the operation

Raises:

GLib.Error

Returns:

the new GData.PicasaWebFile, or None; unref with GObject.Object.unref()

Return type:

GData.PicasaWebFile

Finish off a file upload operation started by GData.PicasaWebService.upload_file(), parsing the result and returning the new GData.PicasaWebFile.

If an error occurred during the upload operation, it will have been returned during the operation (e.g. by Gio.OutputStream.splice() or one of the other stream methods). In such a case, None will be returned but error will remain unset. error is only set in the case that the server indicates that the operation was successful, but an error is encountered in parsing the result sent by the server.

New in version 0.8.0.

get_user(username, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a GData.PicasaWebUser; unref with GObject.Object.unref()

Return type:

GData.PicasaWebUser

Queries the service to return the user specified by username.

New in version 0.6.0.

get_user_async(username, cancellable, callback, *user_data)
Parameters:

Queries the service to return the user specified by username.

For more details, see GData.PicasaWebService.get_user() which is the synchronous version of this method.

When the operation is finished, callback will be called. You can then call GData.PicasaWebService.get_user_finish() to get the results of the operation.

New in version 0.9.1.

get_user_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

a GData.PicasaWebUser; unref with GObject.Object.unref()

Return type:

GData.PicasaWebUser

Finishes an asynchronous user retrieval operation started with GData.PicasaWebService.get_user_async().

New in version 0.9.1.

insert_album(album, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the inserted GData.PicasaWebAlbum; unref with GObject.Object.unref()

Return type:

GData.PicasaWebAlbum

Inserts a new album described by album. A user must be authenticated to use this function.

New in version 0.6.0.

insert_album_async(album, cancellable, callback, *user_data)
Parameters:

Inserts a new album described by album. The user must be authenticated to use this function. self and album are both reffed when this function is called, so can safely be unreffed after this function returns.

callback should call GData.Service.insert_entry_finish() to obtain a GData.PicasaWebAlbum representing the inserted album and to check for possible errors.

For more details, see GData.PicasaWebService.insert_album(), which is the synchronous version of this function, and GData.Service.insert_entry_async(), which is the base asynchronous insertion function.

New in version 0.8.0.

query_all_albums(query, username, cancellable, progress_callback, *progress_user_data)
Parameters:
Raises:

GLib.Error

Returns:

a GData.Feed of query results; unref with GObject.Object.unref()

Return type:

GData.Feed

Queries the service to return a list of all albums belonging to the specified username which match the given query. If a user is authenticated with the service, username can be set as None to return a list of albums belonging to the currently-authenticated user.

Note that the GData.Query :q query parameter cannot be set on query for album queries.

For more details, see GData.Service.query().

New in version 0.4.0.

query_all_albums_async(query, username, cancellable, progress_callback, progress_user_data, callback, *user_data)
Parameters:

Queries the service to return a list of all albums belonging to the specified username which match the given query. self, query and username are all reffed/copied when this function is called, so can safely be unreffed/freed after this function returns.

For more details, see GData.PicasaWebService.query_all_albums(), which is the synchronous version of this function, and GData.Service.query_async(), which is the base asynchronous query function.

New in version 0.9.1.

query_files(album, query, cancellable, progress_callback, *progress_user_data)
Parameters:
Raises:

GLib.Error

Returns:

a GData.Feed of query results; unref with GObject.Object.unref()

Return type:

GData.Feed

Queries the specified album for a list of the files which match the given query. If album is None and a user is authenticated with the service, the user’s default album will be queried.

For more details, see GData.Service.query().

New in version 0.4.0.

query_files_async(album, query, cancellable, progress_callback, progress_user_data, callback, *user_data)
Parameters:

Queries the specified album for a list of the files which match the given query. If album is None and a user is authenticated with the service, the user’s default album will be queried. self, album and query are all reffed when this function is called, so can safely be unreffed after this function returns.

For more details, see GData.PicasaWebService.query_files(), which is the synchronous version of this function, and GData.Service.query_async(), which is the base asynchronous query function.

New in version 0.9.1.

upload_file(album, file_entry, slug, content_type, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a GData.UploadStream to write the file data to, or None; unref with GObject.Object.unref()

Return type:

GData.UploadStream

Uploads a file (photo or video) to the given PicasaWeb album, using the metadata from file and the file data written to the resulting GData.UploadStream. If album is None, the file will be uploaded to the currently-authenticated user’s “Drop Box” album. A user must be authenticated to use this function.

If file has already been inserted, a GData.ServiceError.ENTRY_ALREADYSERTED error will be returned.

If no user is authenticated with the service, GData.ServiceError.AUTHENTICATION_REQUIRED will be returned. It is recommended to retry the upload after refreshing the authorization tokens held by the associated GData.Authorizer using GData.Authorizer.refresh_authorization().

The stream returned by this function should be written to using the standard Gio.OutputStream methods, asynchronously or synchronously. Once the stream is closed (using Gio.OutputStream.close()), GData.PicasaWebService.finish_file_upload() should be called on it to parse and return the updated GData.PicasaWebFile for the uploaded file. This must be done, as file_entry isn’t updated in-place.

In order to cancel the upload, a Gio.Cancellable passed in to cancellable must be cancelled using Gio.Cancellable.cancel(). Cancelling the individual Gio.OutputStream operations on the GData.UploadStream will not cancel the entire upload; merely the write or close operation in question. See the GData.UploadStream :cancellable for more details.

Any upload errors will be thrown by the stream methods, and may come from the GData.ServiceError domain.

New in version 0.8.0.