Package elisa :: Package plugins :: Package ugly :: Package flickr :: Module flickr_media :: Class FlickrMedia
[hide private]
[frames] | no frames]

Class FlickrMedia

source code


DOCME

Nested Classes [hide private]

Inherited from core.component.Component: __metaclass__

Instance Methods [hide private]
 
initialize(self)
Initialize various variables internal to the Component.
source code
 
_connected_cb(self, auth) source code
 
_error_cb(self, failure) source code
 
_connect_flickr(self) source code
 
scannable_uri_schemes__get(self)
Retrieve the URI schemes that can be scanned by the media_scanner.
source code
 
supported_uri_schemes__get(self)
Retrieve the URI schemes supported by the provider, for each scheme there's a priority.
source code
elisa.core.media_uri.MediaUri
get_real_uri(self, uri)
Returns the original uri (acesable) from a virtual uri representation.
source code
 
_build_uri(self, id, server, secret, size) source code
twisted.internet.defer.Deferred
get_media_type(self, uri)
Same as blocking_get_media_type but without blocking (in theory).
source code
dict
_blocking_get_media_type(self, uri)
Try to guess the maximum information from the media located at given uri by looking at eventual file extension.
source code
twisted.internet.defer.Deferred
is_directory(self, uri)
Same as _blocking_is_directory but without blocking (in theory).
source code
bool
_blocking_is_directory(self, uri)
return True if a directory
source code
twisted.internet.defer.Deferred
has_children_with_types(self, uri, media_types)
Same as _blocking_has_children_with_types but without blocking (in theory).
source code
bool
_blocking_has_children_with_types(self, uri, media_types)
Detect whether the given uri has children for given media types which can be one of media_provider.media_types.
source code
twisted.internet.defer.Deferred
get_direct_children(self, uri, children_with_info)
Same as _blocking_get_direct_children but without blocking (in theory).
source code
twisted.internet.defer.Deferred
next_location(self, from_uri, root='frontend')
Same as _blocking_next_location but without blocking (in theory).
source code
 
_dispatch(self, uri, children_with_info) source code
 
_build_mine_menu(self, list_of_children) source code
 
_build_main_menu(self, list_of_children) source code
 
_from_list(self, list_of_children, menu) source code
 
_make_uri(self, uri, label='frontend') source code
 
_got_images(self, ret, list_of_children, url='') source code
 
_got_images_in_photoset(self, ret, list_of_children, url='') source code
 
_add_photo(self, nu, list_of_children) source code
 
_got_hottags(self, ret, list_of_children) source code
 
_got_whotags(self, ret, list_of_children) source code
 
_got_photosets(self, ret, list_of_children) source code

Inherited from base_components.media_provider.MediaProvider: close, copy, delete, monitor_uri, move, open, previous_location, read, seek, unmonitor_uri, uri_is_monitorable, uri_is_monitored

Inherited from core.component.Component: __init__, clean, load_config, save_config

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

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

Static Methods [hide private]

Inherited from core.component.Component: __classinit__

Class Variables [hide private]
  secret = '14693e87a1349c20'
  key = '4bb9b930c2f01fab6b3fd20e02d165fb'
dict config_doc = {'locations': 'A list of tags or flickr:// URIs',...
documentation for each option of the default configuration.
dict default_config = {'locations': [], 'login': '', 'password': ''...
used when nothing found in Application's config
string name = 'flickr_media'
Component's name

Inherited from core.component.Component: checked, id, plugin

Inherited from extern.log.log.Loggable: logCategory

Instance Variables [hide private]

Inherited from core.component.Component: config, path

Properties [hide private]
list scannable_uri_schemes
DOCME
dict mapping string to int supported_uri_schemes
DOCME

Inherited from object: __class__

Method Details [hide private]

initialize(self)

source code 

Initialize various variables internal to the Component.

This method is called by the plugin_registry after the component's config has been loaded.

Override this method if you need to perform some initializations that would normally go in Component's constructor but can't be done there because they require access to the component's config.
Overrides: core.component.Component.initialize
(inherited documentation)

scannable_uri_schemes__get(self)

source code 

Retrieve the URI schemes that can be scanned by the media_scanner. Since media scanning can be an heavy and long task the MediaProvider developer can choose to make the media_scanner skip URIs with scheme not appearing in returned list.

By default the return value of this method corresponds to the keys of supported_uri_schemes__get return value.

# FIXME: this should be documented in the class docstring as a class # variable
Overrides: base_components.media_provider.MediaProvider.scannable_uri_schemes__get
(inherited documentation)

supported_uri_schemes__get(self)

source code 

Retrieve the URI schemes supported by the provider, for each scheme there's a priority. Higher priority == 0 means the provider will always be used to read data from a given scheme.

This function is called by the MediaManager to know which media provider it has to use to access a specified URI. You should return a dict containing the uri scheme (such as 'file', 'cdda', ...) and its priority between 0 to 255 (0 being the topmost priority). The prority is used by the MediaManager to know which media provider it should use in case there are more than one who support the desired uri scheme. You might have for example a component which supports more than one scheme, but the support of one of them is not very efficient compared to what it could be. In this case you could modify its priority to tell the MediaManager that another component should be used instead of it to access this scheme.

example: { 'file': 0, 'smb': 10 }

# FIXME: this should be documented in the class docstring as a class # variable
Overrides: base_components.media_provider.MediaProvider.supported_uri_schemes__get
(inherited documentation)

get_real_uri(self, uri)

source code 
Returns the original uri (acesable) from a virtual uri representation.
Returns: elisa.core.media_uri.MediaUri
Overrides: base_components.media_provider.MediaProvider.get_real_uri
(inherited documentation)

get_media_type(self, uri)

source code 
Same as blocking_get_media_type but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using blocking_get_media_type result.
Returns: twisted.internet.defer.Deferred
Overrides: base_components.media_provider.MediaProvider.get_media_type
(inherited documentation)

_blocking_get_media_type(self, uri)

source code 
Try to guess the maximum information from the media located at given uri by looking at eventual file extension. Will return something like:
 {'file_type': string (values: one of media_provider.media_types)
  'mime_type': string (example: 'audio/mpeg' for .mp3 uris. can be
                      empty string if unguessable)
  }
'file_type' and 'mime_type' can be empty strings if it failed recognizing them.
Returns: dict
Overrides: base_components.media_provider.MediaProvider._blocking_get_media_type
(inherited documentation)

is_directory(self, uri)

source code 
Same as _blocking_is_directory but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using _blocking_is_directory result.
Returns: twisted.internet.defer.Deferred
Overrides: base_components.media_provider.MediaProvider.is_directory
(inherited documentation)

_blocking_is_directory(self, uri)

source code 
return True if a directory
Returns: bool
Overrides: base_components.media_provider.MediaProvider._blocking_is_directory
(inherited documentation)

has_children_with_types(self, uri, media_types)

source code 
Same as _blocking_has_children_with_types but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using _blocking_has_children_with_types result.
Returns: twisted.internet.defer.Deferred
Overrides: base_components.media_provider.MediaProvider.has_children_with_types
(inherited documentation)

_blocking_has_children_with_types(self, uri, media_types)

source code 
Detect whether the given uri has children for given media types which can be one of media_provider.media_types. Implies the URI is a directory as well.
Returns: bool
Overrides: base_components.media_provider.MediaProvider._blocking_has_children_with_types
(inherited documentation)

get_direct_children(self, uri, children_with_info)

source code 
Same as _blocking_get_direct_children but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using _blocking_get_direct_children result.
Returns: twisted.internet.defer.Deferred
Overrides: base_components.media_provider.MediaProvider.get_direct_children
(inherited documentation)

next_location(self, from_uri, root='frontend')

source code 
Same as _blocking_next_location but without blocking (in theory). This method by default triggers a succeeded callback on a Twisted deferred, using _blocking_next_location result.
Returns: twisted.internet.defer.Deferred
Overrides: base_components.media_provider.MediaProvider.next_location
(inherited documentation)

Class Variable Details [hide private]

config_doc

documentation for each option of the default configuration. Keys should be same as the ones in default_config and values should be strings
Type:
dict
Value:
{'locations': 'A list of tags or flickr:// URIs',
 'login': 'Your Flickr username (optional)',
 'password': 'Your Flickr password (optional)',
 'per_page': 'show so many entries should beshown per page?'}

default_config

used when nothing found in Application's config
Type:
dict
Value:
{'locations': [], 'login': '', 'password': '', 'per_page': '30'}

Property Details [hide private]

scannable_uri_schemes

DOCME
Get Method:
elisa.plugins.ugly.flickr.flickr_media.FlickrMedia.scannable_uri_schemes__get(self) - Retrieve the URI schemes that can be scanned by the media_scanner.
Set Method:
'frontend'
Delete Method:
'frontend'

supported_uri_schemes

DOCME
Get Method:
elisa.plugins.ugly.flickr.flickr_media.FlickrMedia.supported_uri_schemes__get(self) - Retrieve the URI schemes supported by the provider, for each scheme there's a priority.
Set Method:
'frontend'
Delete Method:
'frontend'