Package conduit :: Package dataproviders :: Module File :: Class FolderTwoWay
[hide private]

Class FolderTwoWay

source code


TwoWay dataprovider for synchronizing a folder

Instance Methods [hide private]
 
__init__(self, folder, folderGroupName, includeHidden, compareIgnoreMtime, followSymlinks)
All sync functionality should be provided by derived classes
source code
 
_transfer_file(self, vfsFile, newURI, overwrite) source code
bool
initialize(self)
Called when the module is loaded by the module loader.
source code
 
is_configured(self, isSource, isTwoWay)
Checks if the dp has been configured or not (and if it needs to be)
source code
 
refresh(self)
Performs any (conduit.logging in, etc) which must be undertaken on the dataprovider prior to calling get_all().
source code
 
put(self, vfsFile, overwrite, LUID=None)
Puts vfsFile at the correct location.
source code
 
delete(self, LUID)
Deletes data with LUID.
source code
conduit.DataType.DataType
get(self, uid)
Returns data with the specified LUID.
source code
 
get_all(self)
Returns an array of all the LUIDs this dataprovider holds.
source code
 
finish(self, aborted, error, conflict)
Perform any post-sync cleanup.
source code
 
add(self, LUID)
Adds an item to the datasource according to LUID.
source code

Inherited from DataProvider.DataSource: get_changes, get_num_items

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

Class Variables [hide private]
  _category_ = DataProviderCategory.DataProviderCategory("Files ...
  _module_type_ = "twoway"
  _in_type_ = "file"
  _out_type_ = "file"
  _icon_ = "folder"

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

Method Details [hide private]

__init__(self, folder, folderGroupName, includeHidden, compareIgnoreMtime, followSymlinks)
(Constructor)

source code 
All sync functionality should be provided by derived classes
Overrides: DataProvider.TwoWay.__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)

is_configured(self, isSource, isTwoWay)

source code 
Checks if the dp has been configured or not (and if it needs to be)
Overrides: DataProvider.DataProviderBase.is_configured
(inherited documentation)

refresh(self)

source code 

Performs any (conduit.logging in, etc) which must be undertaken on the dataprovider prior to calling get_all(). Should gather all information so a subsequent call to get_all() can return the uids of all the data this dataprovider holds

This function may be called multiple times so derived classes should be aware of this.

Derived classes should call this function to ensure the dataprovider status is updated.
Overrides: DataProvider.DataProviderBase.refresh
(inherited documentation)

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

source code 

Puts vfsFile at the correct location. There are three scenarios
1) File came from a foreign DP like tomboy
2) File came from another file dp

Behaviour:
1) The foreign DP should have encoded enough information (such as
the filename) so that we can go ahead and put the file in the dir
2) First we see if the file has a group attribute.
    a) If so, and the group matches the groupName here then we 
    put the files into the directory.
    b) If not we put the file in a subdir by the name of the group 
    
We always retain the relative path for the files

Overrides: DataProvider.DataSink.put

delete(self, LUID)

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

get(self, uid)

source code 

Returns data with the specified LUID. This function must be overridden by the appropriate dataprovider.

Derived classes should call this function to ensure the dataprovider status is updated.
Returns: conduit.DataType.DataType
An item of data
Overrides: DataProvider.DataSource.get
(inherited documentation)

get_all(self)

source code 
Returns an array of all the LUIDs this dataprovider holds.
Overrides: DataProvider.DataSource.get_all
(inherited documentation)

finish(self, aborted, error, conflict)

source code 
Perform any post-sync cleanup. For example, free any structures created in refresh that were used in the synchronization.
Overrides: DataProvider.DataProviderBase.finish
(inherited documentation)

add(self, LUID)

source code 
Adds an item to the datasource according to LUID. This method is used by the DBus interface
Returns:
True if the data was successfully added
Overrides: DataProvider.DataSource.add
(inherited documentation)

Class Variable Details [hide private]

_category_

Value:
DataProviderCategory.DataProviderCategory("Files and Folders", "comput\
er")