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

Class FileSource

source code


Instance Methods [hide private]
 
__init__(self)
All sync functionality should be provided by derived classes
source code
 
_add_file(self, f) source code
 
_add_folder(self, f, groupname="") source code
bool
initialize(self)
Called when the module is loaded by the module loader.
source code
 
uninitialize(self)
Called just before the application quits.
source code
 
refresh(self)
Performs any (conduit.logging in, etc) which must be undertaken on the dataprovider prior to calling get_all().
source code
conduit.DataType.DataType
get(self, LUID)
Returns data with the specified LUID.
source code
 
add(self, LUID)
Adds an item to the datasource according to 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
 
_on_scan_folder_progress(self, folderScanner, numItems, oid, groupname)
Called by the folder scanner thread and used to update the estimate of the number of items in the directory
source code
 
_on_scan_folder_completed(self, folderScanner, oid, groupname) 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, is_configured, set_configuration, set_configuration_xml, set_status

Inherited from Vfs.FolderScannerThreadManager: cancel_all_threads, join_all_threads, make_thread

Inherited from Vfs.FolderScannerThreadManager (private): _register_thread_completed

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

Class Variables [hide private]
  _category_ = DataProviderCategory.DataProviderCategory("Files ...
  _module_type_ = "source"
  _in_type_ = "file"
  _out_type_ = "file"
  _icon_ = "text-x-generic"

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

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

uninitialize(self)

source code 
Called just before the application quits.
Overrides: DataProvider.DataProviderBase.uninitialize
(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)

get(self, LUID)

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)

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)

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)

Class Variable Details [hide private]

_category_

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