Package entropy :: Package db :: Module skel :: Class EntropyRepositoryPlugin

Class EntropyRepositoryPlugin

source code


This is the base class for implementing EntropyRepository plugin hooks.
You have to subclass this, implement not implemented methods and provide
it to EntropyRepository class as described below.

Every plugin hook function features this signature:
    int something_hook(entropy_repository_instance)
Where entropy_repository_instance is the calling EntropyRepository instance.
Every method should return a return status code which, when nonzero causes
a RepositoryPluginError exception to be thrown.
Every method returns 0 in the base class implementation.

Instance Methods
int
accept_license_hook(self, entropy_repository_instance)
Called during EntropyRepository acceptLicense call.
source code
int
add_package_hook(self, entropy_repository_instance, package_id, package_data)
Called after the addition of a package from EntropyRepository.
source code
int
add_plugin_hook(self, entropy_repository_instance)
Called during EntropyRepository plugin addition.
source code
int
clear_cache_hook(self, entropy_repository_instance)
Called during EntropyRepository cache cleanup (clearCache).
source code
int
close_repo_hook(self, entropy_repository_instance)
Called during EntropyRepository instance shutdown (close()).
source code
int
commit_hook(self, entropy_repository_instance)
Called during EntropyRepository data commit.
source code
string
get_id(self)
Return string identifier of myself.
source code
dict
get_metadata(self)
Developers reimplementing EntropyRepositoryPlugin can provide metadata along with every instance.
source code
int
initialize_repo_hook(self, entropy_repository_instance)
Called during EntropyRepository data initialization (not instance init).
source code
int
remove_package_hook(self, entropy_repository_instance, package_id, from_add_package)
Called after the removal of a package from EntropyRepository.
source code
int
remove_plugin_hook(self, entropy_repository_instance)
Called during EntropyRepository plugin removal.
source code
int
treeupdates_move_action_hook(self, entropy_repository_instance, package_id)
Called after EntropyRepository treeupdates move action execution for given package_id in given EntropyRepository instance.
source code
int
treeupdates_slot_move_action_hook(self, entropy_repository_instance, package_id)
Called after EntropyRepository treeupdates slot move action execution for given package_id in given EntropyRepository instance.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

accept_license_hook(self, entropy_repository_instance)

source code 

Called during EntropyRepository acceptLicense call.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

add_package_hook(self, entropy_repository_instance, package_id, package_data)

source code 

Called after the addition of a package from EntropyRepository.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
  • package_id (int) - Entropy repository package identifier
  • package_data (dict) - package metadata used for insertion (see addPackage)
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

add_plugin_hook(self, entropy_repository_instance)

source code 

Called during EntropyRepository plugin addition.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

clear_cache_hook(self, entropy_repository_instance)

source code 

Called during EntropyRepository cache cleanup (clearCache).

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

close_repo_hook(self, entropy_repository_instance)

source code 

Called during EntropyRepository instance shutdown (close()).

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

commit_hook(self, entropy_repository_instance)

source code 

Called during EntropyRepository data commit.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

get_id(self)

source code 

Return string identifier of myself.

Returns: string
EntropyRepositoryPlugin identifier.

get_metadata(self)

source code 

Developers reimplementing EntropyRepositoryPlugin can provide metadata along with every instance. If you want to provide read-only metadata, this method should really return a copy of the metadata object, otherwise, return its direct reference. Metadata format is a map-like object (dictionary, dict()). By default this method does return an empty dict. Make sure that your metadata dictionaries around don't have keys in common, otherwise those will be randomly overwritten eachothers.

Returns: dict
plugin metadata

initialize_repo_hook(self, entropy_repository_instance)

source code 

Called during EntropyRepository data initialization (not instance init).

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

remove_package_hook(self, entropy_repository_instance, package_id, from_add_package)

source code 

Called after the removal of a package from EntropyRepository.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
  • package_id (int) - Entropy repository package identifier
  • from_add_package - inform whether removePackage() is called inside addPackage()
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

remove_plugin_hook(self, entropy_repository_instance)

source code 

Called during EntropyRepository plugin removal.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

treeupdates_move_action_hook(self, entropy_repository_instance, package_id)

source code 

Called after EntropyRepository treeupdates move action execution for given package_id in given EntropyRepository instance.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
  • package_id (int) - Entropy repository package identifier
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.

treeupdates_slot_move_action_hook(self, entropy_repository_instance, package_id)

source code 

Called after EntropyRepository treeupdates slot move action execution for given package_id in given EntropyRepository instance.

Parameters:
  • entropy_repository_instance (EntropyRepository) - EntropyRepository instance
  • package_id (int) - Entropy repository package identifier
Returns: int
execution status code, return nonzero for errors, this will raise a RepositoryPluginError exception.