# Class e.c.e.e.EggRegistry(Loggable):

Part of elisa.core.epm.egg_registry View In Hierarchy

Elisa egg registry.

Knows about static repositories and discovers dynamic repositories, update the local cache and answers to queries about plugins: installed ones, uninstalled, upgradeables, dependencies.

Line # | Kind | Name | Docs
--- | --- | --- | ---
70 | Method | __init__ | Initialize repositories and set the local cache file.
130 | Method | get_repositories | Get the list of known static and dynamic repositories.
173 | Method | list_plugins | Undocumented
176 | Method | update_cache | Cache locally information about plugins from static repositories.
234 | Method | get_plugin | Get the plugin by name, version and repository source.
281 | Method | get_plugin_deps_for | Retrieve the dependencies for a plugin.
308 | Method | get_uninstalled_plugin_deps_for | Retrieve the uninstalled dependencies for a plugin.
369 | Method | get_installed_plugins | Retrieve the list of installed plugins.
389 | Method | get_upgradeable_plugins | Get the list of upgradeable plugins.
418 | Method | get_installed_dependent_plugins | Retrieve the plugins that depend on the specified one.
530 | Method | easy_install_plugin | Undocumented
783 | Method | upgrade | Undocumented
865 | Method | remove | Remove an installed plugin by name.
899 | Method | get_info | Get information about a plugin.

def __init__(self, cache_file=None, static_sources=, plugin_dirs=None):
overrides elisa.core.log.Loggable.__init__

Initialize repositories and set the local cache file.

Loads the statically configured repositories and discovers the dynamic ones actually present at this time. Set the user's local cache file location, creating it if doesn't exist, using a sensible default in the Elisa user directory.

Parameters | cache_file | the absolute path to the user's local cache file.
| chache_file | (type: a string )
| static_sources | an alternative sources' list (type: list of strings )
| plugin_dirs | the directory where to search for installed plugins (type: list of strings )

def get_repositories(self):
Get the list of known static and dynamic repositories.

Returns | the list of repositories (type: list of `epm.egg_repository.EggRepository` )

def list_plugins(self, source=None):
Undocumented
def update_cache(self):

Cache locally information about plugins from static repositories.

Try to contact all known static repositories: if a problem occurs with one of those, just retrieve that information from the local cache, in order not to clean the cache just for a missing Internet connection (for example.)

Returns | a deferred trigged when all work is done (type: `twisted.internet.defer.Defer` )

def get_plugin(self, name, version=None, source=None):

Get the plugin by name, version and repository source.

The information about the plugin is retrieved through "self.cached_plugin_list", if possible. Otherwise we launch "self._blocking_list_plugins()", even if the first time can block...

If the version is not specified the plugin with gratest version number should be reported; if more than one with the same version number is found, the first in the list is returned.

Parameters | name | the name of the plugin (type: string )
| version | the version of the plugin. None to get the latest one (type: string )
| source | the source URL of the repository (type: string )
Returns | the plugin, if found in the repositories. None, otherwise (type: `epm.egg_plugin.EggPlugin` )

def get_plugin_deps_for(self, plugin_name, plugin_version=None):

Retrieve the dependencies for a plugin.

Search the dependencies graph, assuming that there are no circular dependencies.

Parameters | plugin_name | the name of the plugin (type: string )
| plugin_version | the version of the plugin (type: string )
Returns | the list of dependencies (type: a list of dicts )

def get_uninstalled_plugin_deps_for(self, plugin_name, plugin_version=None, installed_plugins=):

Retrieve the uninstalled dependencies for a plugin.

Also report the dependencies needing an upgrade.

Search the dependencies graph, pruning trees when a dependence is known to be already installed, because we assume that is has already its dependecies satisfied. Assume that there are no circular dependencies.

Parameters | plugin_name | the name of the plugin (type: string )
| plugin_version | the version of the plugin
| plugin_name | (type: string )
| installed_plugins | a cached list of installed plugins (type: list of strings )
Returns | the list of uninstalled dependecies (type: a list of dicts )

def get_installed_plugins(self):

Retrieve the list of installed plugins.

Can filter by plugin name, returning at most one plugin.

Parameters | plugin_name | the optional plugin name to search for (type: string )
Returns | the list of installed plugins (type: list of `epm.egg_plugin.EggPlugin`s )

def get_upgradeable_plugins(self, update_states=):

Get the list of upgradeable plugins.

If a plugin is no more in the repository, sure it is not upgradeable.

Parameters | update_states | the update states you want to filter on (type: list of string )
Returns | the list of upgradeable plugins (type: a list of `epm.egg_plugin.EggPlugin` )

def get_installed_dependent_plugins(self, plugin_name, installed_plugins=):

Retrieve the plugins that depend on the specified one.

Assume that there are not circular dependencies.

Parameters | plugin_name | the name of the plugin (type: string )
| installed_plugins | a cached list of installed plugins (type: list of strings )
Returns | the list of plugins that depends on the specified one (type: list of strings )

def easy_install_plugin(self, plugin_name, plugin_version=None, directory=ELISA_PLUGINS_DIR, upgrade=False):
Undocumented
def upgrade(self, plugin_name=None, directory=ELISA_PLUGINS_DIR, update_states=):
Undocumented
def remove(self, plugin_name):
Remove an installed plugin by name.

Parameters | plugin_name | the name of the installed plugin (type: string )
Returns | a deferred (type: `twisted.internet.defer.Deferred` )

def get_info(self, plugin_name, plugin_version=None):
Get information about a plugin.

Parameters | plugin_name | the name (or file path) of the plugin (type: string )
| plugin_version | the version of the plugin (type: string )
Returns | the retrieved information (type: `twisted.internet.defer.Deferred` )