Package flickyou :: Package backend :: Module base :: Class BaseBackend

Class BaseBackend

source code

object --+
         |
        BaseBackend
Known Subclasses:
json.JSONBackend

The abstract class representing the machinery of the request/response
formats.

Any implementor *must* override:
    * response_format
    * _get()
    * _get_backend_params()
    * _handle_error()
    * _parse_response()
    
    * auth_checkToken()
    * auth_getToken()
    * auth_getFrob()
    
For the authentication step also "authenticate_step_one()" can be overridden.

This backend uses REST as a Request format.



Instance Methods
 
__init__(self, api_key, secret_key)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
auth_checkToken(self)
flickr.auth.checkToken: Returns the credentials attached to an authentication token.
source code
 
auth_getFrob(self)
flickr.auth.getFrob: Returns a frob to be used during authentication.
source code
 
auth_getToken(self)
flickr.auth.getToken: Returns the auth token for the given frob, if one has been attached.
source code
 
authenticate(self, requested_perms='write')
All the authentication machinery.
source code
 
authenticate_step_one(self, perms='write', sleep_time=3)
This implement the first step of authentication machinery.
source code
 
call_api_method(self, api_method_name, auth, **params)
Calls the remote API method.
source code
 
photo_upload(self, filename=None, photo_data=None, data_content_type='image/jpeg', **params)
Uploading photos: It works outside the normal Flickr API framework because it involves sending binary files over the wire.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, api_key, secret_key)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

auth_checkToken(self)

source code 
flickr.auth.checkToken:
    Returns the credentials attached to an authentication token.
    This method call must be signed.

To be overridden.

See: <http://www.flickr.com/services/api/flickr.auth.checkToken.html>

auth_getFrob(self)

source code 
flickr.auth.getFrob:
    Returns a frob to be used during authentication.
    This method call must be signed.

To be overridden.

See: <http://www.flickr.com/services/api/flickr.auth.getFrob.html>

auth_getToken(self)

source code 
flickr.auth.getToken:
    Returns the auth token for the given frob, if one has been attached.
    This method call must be signed.

To be overridden.

See: <http://www.flickr.com/services/api/flickr.auth.getToken.html>

authenticate(self, requested_perms='write')

source code 

All the authentication machinery.

* requested_perms can be 'read', 'write', 'delete'

See: <http://www.flickr.com/services/api/auth.spec.html>

Takes also care of storing the token on the file system.

authenticate_step_one(self, perms='write', sleep_time=3)

source code 

This implement the first step of authentication machinery.

Note: override this to do your first step. By default uses the system browser to authenticate and desktop authentication.

call_api_method(self, api_method_name, auth, **params)

source code 

Calls the remote API method.

* api_method_name is the Flickr name (eg. flickr.photos.getInfo) * auth is a boolean indicating whether or not the call requires authentication * params contains any additional parameter

photo_upload(self, filename=None, photo_data=None, data_content_type='image/jpeg', **params)

source code 
Uploading photos:
    It works outside the normal Flickr API framework because it
    involves sending binary files over the wire.
    
You can specify either the filename or pass the binary image data.
The image content type defaults to JPEG.

See: <http://www.flickr.com/services/api/upload.api.html>