GData.PicasaWebService¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GData.PicasaWebService(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
The primary
GData.AuthorizationDomain
for interacting with PicasaWeb. This will not normally need to be used, as it’s used internally by theGData.PicasaWebService
methods. However, if using the plainGData.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
orNone
) – aGData.Authorizer
to authorize the service’s requests, orNone
- Returns:
a new
GData.PicasaWebService
, orNone
; unref withGObject.Object.unref
()- Return type:
Creates a new
GData.PicasaWebService
using the givenGData.Authorizer
. If authorizer isNone
, all requests are made as an unauthenticated user.New in version 0.9.0.
- finish_file_upload(upload_stream)¶
- Parameters:
upload_stream (
GData.UploadStream
) – theGData.UploadStream
from the operation- Raises:
- Returns:
the new
GData.PicasaWebFile
, orNone
; unref withGObject.Object.unref
()- Return type:
Finish off a file upload operation started by
GData.PicasaWebService.upload_file
(), parsing the result and returning the newGData.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:
username (
str
orNone
) – the username of the user whose information you wish to retrieve, orNone
for the currently authenticated user.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
a
GData.PicasaWebUser
; unref withGObject.Object.unref
()- Return type:
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:
username (
str
orNone
) – the username of the user whose information you wish to retrieve, orNone
for the currently authenticated usercancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the query is finisheduser_data (
object
orNone
) – data to pass to the callback function
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
) – aGio.AsyncResult
- Raises:
- Returns:
a
GData.PicasaWebUser
; unref withGObject.Object.unref
()- Return type:
Finishes an asynchronous user retrieval operation started with
GData.PicasaWebService.get_user_async
().New in version 0.9.1.
- insert_album(album, cancellable)¶
- Parameters:
album (
GData.PicasaWebAlbum
) – aGData.PicasaWebAlbum
to create on the servercancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
the inserted
GData.PicasaWebAlbum
; unref withGObject.Object.unref
()- Return type:
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:
album (
GData.PicasaWebAlbum
) – aGData.PicasaWebAlbum
to create on the servercancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when insertion is finisheduser_data (
object
orNone
) – data to pass to the callback function
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 aGData.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, andGData.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:
query (
GData.Query
orNone
) – aGData.Query
with the query parameters, orNone
username (
str
orNone
) – the username of the user whose albums you wish to retrieve, orNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
progress_callback (
GData.QueryProgressCallback
orNone
) – aGData.QueryProgressCallback
to call when an entry is loaded, orNone
progress_user_data (
object
orNone
) – data to pass to the progress_callback function
- Raises:
- Returns:
a
GData.Feed
of query results; unref withGObject.Object.unref
()- Return type:
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:
query (
GData.Query
orNone
) – aGData.Query
with the query parameters, orNone
username (
str
orNone
) – the username of the user whose albums you wish to retrieve, orNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
progress_callback (
GData.QueryProgressCallback
orNone
) – aGData.QueryProgressCallback
to call when an entry is loaded, orNone
progress_user_data (
object
orNone
) – data to pass to the progress_callback functioncallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when authentication is finisheduser_data (
object
orNone
) – data to pass to the callback function
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, andGData.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:
album (
GData.PicasaWebAlbum
orNone
) – aGData.PicasaWebAlbum
from which to retrieve the files, orNone
query (
GData.Query
orNone
) – aGData.Query
with the query parameters, orNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
progress_callback (
GData.QueryProgressCallback
orNone
) – aGData.QueryProgressCallback
to call when an entry is loaded, orNone
progress_user_data (
object
orNone
) – data to pass to the progress_callback function
- Raises:
- Returns:
a
GData.Feed
of query results; unref withGObject.Object.unref
()- Return type:
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:
album (
GData.PicasaWebAlbum
orNone
) – aGData.PicasaWebAlbum
from which to retrieve the files, orNone
query (
GData.Query
orNone
) – aGData.Query
with the query parameters, orNone
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
progress_callback (
GData.QueryProgressCallback
orNone
) – aGData.QueryProgressCallback
to call when an entry is loaded, orNone
progress_user_data (
object
orNone
) – data to pass to the progress_callback functioncallback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the query is finisheduser_data (
object
orNone
) – data to pass to the callback function
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, andGData.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:
album (
GData.PicasaWebAlbum
orNone
) – aGData.PicasaWebAlbum
into which to insert the file, orNone
file_entry (
GData.PicasaWebFile
) – aGData.PicasaWebFile
to insertslug (
str
) – the filename to give to the uploaded filecontent_type (
str
) – the content type of the uploaded datacancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
for the entire upload stream, orNone
- Raises:
- Returns:
a
GData.UploadStream
to write the file data to, orNone
; unref withGObject.Object.unref
()- Return type:
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 isNone
, 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 associatedGData.Authorizer
usingGData.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 (usingGio.OutputStream.close
()),GData.PicasaWebService.finish_file_upload
() should be called on it to parse and return the updatedGData.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 usingGio.Cancellable.cancel
(). Cancelling the individualGio.OutputStream
operations on theGData.UploadStream
will not cancel the entire upload; merely the write or close operation in question. See theGData.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.