Package conduit :: Package dataproviders :: Module Image :: Class ImageSink
[hide private]

Class ImageSink

source code


Abstract Base class for Image DataSinks

Instance Methods [hide private]
 
__init__(self, *args)
All sync functionality should be provided by derived classes
source code
bool
initialize(self)
Called when the module is loaded by the module loader.
source code
 
_resize_combobox_build(self, combobox, selected) source code
 
_resize_combobox_get_active(self, combobox) source code
 
_get_photo_info(self, photoID)
This should return the info for a given photo id, If this returns anything different from None, it will be passed onto _get_raw_photo_url
source code
 
_get_raw_photo_url(self, photoInfo)
This should return the url of the online photo
source code
 
_upload_photo(self, uploadInfo)
Upload a photo
source code
 
_replace_photo(self, id, uploadInfo)
Replace a photo with a new version
source code
 
_get_photo_formats(self)
This should return the allowed photo mimetypes
source code
 
_get_default_format(self)
This should return the preferred format of images the sink accepts
source code
 
_get_photo_size(self)
Return the preferred photo size string for rescaling, or None
source code
 
put(self, photo, overwrite, LUID=None)
Accepts a vfs file.
source code
 
delete(self, LUID)
Deletes data with LUID.
source code
 
get_input_conversion_args(self)
Provides a way to pass arguments to conversion functions.
source code

Inherited from DataProvider.DataProviderBase: configure, emit, emit_change_detected, finish, get_UID, get_configuration, get_configuration_xml, get_input_type, get_name, get_output_conversion_args, get_output_type, get_status, is_busy, is_configured, refresh, set_configuration, set_configuration_xml, set_status, uninitialize

Class Variables [hide private]
  _category_ = DataProviderCategory.DataProviderCategory("Photos...
  _module_type_ = "sink"
  _in_type_ = "file/photo"
  _out_type_ = "file/photo"
  IMAGE_SIZES = ["640x480", "800x600", "1024x768"]
  NO_RESIZE = "None"

Inherited from DataProvider.DataProviderBase: __gsignals__, _configurable_, _description_, _icon_, _name_

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 
All sync functionality should be provided by derived classes
Overrides: DataProvider.DataSink.__init__

initialize(self)

source code 

Called when the module is loaded by the module loader.

It is called in the main thread so should NOT block. It should perform simple tests to determine whether the dataprovider is applicable to the user and whether is should be presented to them. For example it may check if a specific piece of hardware is loaded, or check if a user has the specific piece of software installed with which it synchronizes.
Returns: bool
True if the module initialized correctly (is appropriate for the user), False otherwise
Overrides: DataProvider.DataProviderBase.initialize
(inherited documentation)

put(self, photo, overwrite, LUID=None)

source code 
Accepts a vfs file. Must be made local. I also store a md5 of the photos uri to check for duplicates
Overrides: DataProvider.DataSink.put

delete(self, LUID)

source code 
Deletes data with LUID.
Overrides: DataProvider.DataSink.delete
(inherited documentation)

get_input_conversion_args(self)

source code 
Provides a way to pass arguments to conversion functions. For example when transcoding a music file the dataprovider may return a dictionary specifying the conversion encoding, quality, etc
Returns:
a dict of conversion arguments
Overrides: DataProvider.DataProviderBase.get_input_conversion_args
(inherited documentation)

Class Variable Details [hide private]

_category_

Value:
DataProviderCategory.DataProviderCategory("Photos", "image-x-generic")