Class e.p.f.r.FlickrResourceProvider(ResourceProvider):

Part of elisa.plugins.flickr.resource_provider View In Hierarchy

A resource provider that implements the GET and POST methods for use on the Flickr API (see http://www.flickr.com/services/api/ for details). The GET method is also able to retrieve image files from Flickr directly.
Line # Kind Name Docs
73 Method initialize Initialize the component.
104 Method clean Close all the open HTTP connections.
125 Method login Login to the Flickr webservice using the given credentials.
192 Method logout Remove any reference to the current Flickr authentication
206 Method get GET request to the Flickr servers.
509 Method post POST request to the Flickr servers.
475 Method __encodeForm Encode arguments and a file's contents in a multipart/form-data string.

Inherited from ResourceProvider:

Line # Kind Name Docs
116 Method put Put one resource into another. Both resources are identified with URIs.
138 Method delete Delete a Resource represented by a URI.

Inherited from Component (via ResourceProvider):

Line # Kind Name Docs
85 Class PathDescriptor Undocumented
97 Class Method create Create and initialize the component.

Inherited from Loggable (via ResourceProvider, Component):

Line # Kind Name Docs
81 Method __init__ Undocumented
def initialize(self):
Initialize the component.

This method is called by Component.create to finish the initialization of a component.

Returnsa deferred called when a component is fully initialized (type: twisted.internet.defer.Deferred )
def clean(self):
Close all the open HTTP connections.
def login(self, username=None, password=None):
Login to the Flickr webservice using the given credentials.
Parametersusernamelogin of the user (type: string )
passwordpassword of the user (type: string )
Returns (type: twisted.internet.defer.Deferred )
def logout(self):
Remove any reference to the current Flickr authentication token and remove the file storing the Flickr frob.
def get(self, uri, context_model=None):

GET request to the Flickr servers.

The request URI can be of one of the following forms:

   http://api.flickr.com/services/rest/?.*
   http://farm{farm_id}.static.flickr.com/.*\.jpg
ParametersuriURI pointing to the resource (type: elisa.core.media_uri.MediaUri )
context_model[not used] (type: None )
Returnsa new model and a deferred fired when the model is filled with the requested resource's data (type: tuple of elisa.core.components.model.Model elisa.core.utils.defer.Deferred )
def __encodeForm(self, arguments, filename):
Encode arguments and a file's contents in a multipart/form-data string.

This code is largely inspired by Ross Burton's flickrpc (see http://burtonini.com/bzr/flickrpc/).

def post(self, uri, arguments, filename):

POST request to the Flickr servers.

The request URI can be of one of the following forms:

   http://api.flickr.com/services/upload/
   http://api.flickr.com/services/replace/
ParametersuriURI pointing to the resource (type: elisa.core.media_uri.MediaUri )
argumentsthe arguments (including authentication and signing) (type: dict of str )
filenamethe name of a local photo file (type: str )
Returnsa deferred fired with the id of the photo uploaded/replaced when the operation is complete (type: elisa.core.utils.defer.Deferred )
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.