Line # | Kind | Name | Docs |
---|---|---|---|
51 | Function | sign_arguments | Compute the 'api_sig' argument for methods that need signing (see |
104 | Function | get_cached_token | Return the authentication token that has been locally cached. |
121 | Function | generate_call_uri | Generate the URI to use for a Flickr API call using an HTTP GET method. |
164 | Function | authenticate_1 | First step of the authentication to the Flickr API: request a Frob (see |
205 | Function | authenticate_2 | Second step of the authentication to the Flickr API: return the auth token |
230 | Function | build_photo_url | Build the real URL corresponding to a photo model. |
66 | Function | _get_token_file | Return the filename that contains the authentication token for the API key. |
75 | Function | _read_token | Extract the authentication token from an XML response to |
89 | Function | _save_token | Save the retrieved authentication token to the local cache. |
This method updates the dictionary of arguments passed as a parameter, setting the value of the 'api_sig' argument.
Parameters | arguments | the arguments passed to the method that need signing
(type: dict of {str}
) |
Returns | the filename where to store the authentication token
(type: str
) |
Parameters | response | the response to flickr.auth.getToken
(type: str or unicode
) |
Returns | the authentication token
(type: str
) |
Parameters | token | the authentication token as returned by flickr.auth.getToken
(type: str
) |
Returns | the authentication token
(type: str
) | |
Raises | IOError | if the token cache file cannot be found |
The 'method' and 'api_key' arguments are automatically added if not present. If authentication is required, the 'auth_token' argument will be automatically added. If signing is required, the signature will be computed and the 'api_sig' argument added.
Parameters | base_uri | the base URI of the request
(type: str
) |
method | the Flickr API method name
(type: str
) | |
arguments | the arguments (key-value) of the method
(type: dict of str
) | |
authenticated | whether the method requires authentication
(type: bool
) | |
sign | whether the method requires signing
(type: bool
) | |
Returns | the complete URI of the request to send
(type: str
) |
If the application is already authenticated (authentication token locally cached), return the token. No subsequent call to authenticate_2 is needed.
Parameters | provider | the Flickr resource provider
(type: elisa.plugins.flickr.resource_provider.FlickrResourceProvider
) |
Returns | a deferred that when fired returns a dictionary containing either the login
URL and the frob, or the token if already authenticated.
(type: twisted.internet.defer.Deferred
) |
Parameters | provider | the Flickr resource provider
(type: elisa.plugins.flickr.resource_provider.FlickrResourceProvider
) |
frob | the frob
(type: str
) | |
Returns | the authentication token if existing, None otherwise
(type: str
) |
See http://www.flickr.com/services/api/misc.urls.html for details on how to build the URL of a photo. Once built this URL is cached in the model itself for faster subsequent accesses.
Parameters | model | a photo model
(type: elisa.plugins.flickr.models.FlickrPhotoModel
) |