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.
128 Method get_repositories Get the list of known static and dynamic repositories.
171 Method list_plugins Undocumented
174 Method update_cache Cache locally information about plugins from static repositories.
232 Method get_plugin Get the plugin by name, version and repository source.
279 Method get_plugin_deps_for Retrieve the dependencies for a plugin.
306 Method get_uninstalled_plugin_deps_for Retrieve the uninstalled dependencies for a plugin.
367 Method get_installed_plugins Retrieve the list of installed plugins.
385 Method get_upgradeable_plugins Get the list of upgradeable plugins.
414 Method get_installed_dependent_plugins Retrieve the plugins that depend on the specified one.
526 Method easy_install_plugin Undocumented
779 Method upgrade Undocumented
861 Method remove Remove an installed plugin by name.
895 Method get_info Get information about a plugin.
118 Method _load_static_repositories Undocumented
124 Method _discover_dynamic_repositories Discover actually existent dynamic repositories.
136 Method _blocking_list_plugins Load plugins from the cache and from dynamic repositories.
442 Method _blocking_easy_install_plugin Use easy_install internal API to install.
624 Method _custom_install Install a plugin resolving dependecies.
730 Method _blocking_upgrade Upgrade one or all the installed plugins.
784 Method _async_upgrade Upgrade one or all the installed plugins.
def __init__(self, cache_file=None, static_sources=, plugin_dirs=None):
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.

Parameterscache_filethe absolute path to the user's local cache file. (type: a string )
static_sourcesan alternative sources' list (type: list of strings )
plugin_dirsthe directory where to search for installed plugins (type: list of strings )
def _load_static_repositories(self):
Undocumented
def _discover_dynamic_repositories(self):
Discover actually existent dynamic repositories.
def get_repositories(self):
Get the list of known static and dynamic repositories.
Returnsthe list of repositories (type: list of epm.egg_repository.EggRepository )
def _blocking_list_plugins(self, source=None):
Load plugins from the cache and from dynamic repositories.
Parameterssourcethe source of the repository, to filter plugins' origin (type: string )
Returnsthe discovered plugins (type: list of epm.egg_plugin.EggPlugins )
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.)

Returnsa 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.

Parametersnamethe name of the plugin (type: string )
versionthe version of the plugin. None to get the latest one (type: string )
sourcethe source URL of the repository (type: string )
Returnsthe 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.

Parametersplugin_namethe name of the plugin (type: string )
plugin_versionthe version of the plugin (type: string )
Returnsthe 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.

Parametersplugin_namethe name of the plugin (type: string )
plugin_versionthe version of the plugin (type: string )
installed_pluginsa cached list of installed plugins (type: list of strings )
Returnsthe 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.

Returnsthe list of installed plugins (type: list of epm.egg_plugin.EggPlugins )
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.

Parametersupdate_statesthe update states you want to filter on (type: list of string )
Returnsthe 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.

Parametersplugin_namethe name of the plugin (type: string )
installed_pluginsa cached list of installed plugins (type: list of strings )
Returnsthe list of plugins that depends on the specified one (type: list of strings )
def _blocking_easy_install_plugin(self, plugin_name, plugin_version, directory):
Use easy_install internal API to install.
Parametersplugin_namethe name of the egg distribution to install. It should be something like "elisa-plugin-*" (type: string )
plugin_versionthe version to install, or None to get the latest found (type: string )
directorythe absolute path to the installation directory (type: string )
def easy_install_plugin(self, plugin_name, plugin_version=None, directory=ELISA_PLUGINS_DIR, upgrade=False):
Undocumented
def _custom_install(self, plugin_name, plugin_version=None):
Install a plugin resolving dependecies.

The dependencies are resolved from the repository plugins the registry is aware of.

Parametersplugin_namethe plugin name (or file path) to install (type: string )
plugin_versionthe plugin version to install (type: string )
Returnsa deferred (type: twisted.internet.defer.DeferredList )
def _blocking_upgrade(self, plugin_name=None, directory=ELISA_PLUGINS_DIR, update_states=):
Upgrade one or all the installed plugins.
Parametersplugin_namethe name of the installed plugin. Or None. (type: string )
Returnsa deferred (type: twisted.internet.defer.Deferred )
def upgrade(self, plugin_name=None, directory=ELISA_PLUGINS_DIR, update_states=):
Undocumented
def _async_upgrade(self, plugin_name=None, directory=ELISA_PLUGINS_DIR, update_states=):
Upgrade one or all the installed plugins.
Parametersplugin_namethe name of the installed plugin. Or None. (type: string )
Returnsa deferred (type: twisted.internet.defer.Deferred )
def remove(self, plugin_name):
Remove an installed plugin by name.
Parametersplugin_namethe name of the installed plugin (type: string )
Returnsa deferred (type: twisted.internet.defer.Deferred )
def get_info(self, plugin_name, plugin_version=None):
Get information about a plugin.
Parametersplugin_namethe name (or file path) of the plugin (type: string )
plugin_versionthe version of the plugin (type: string )
Returnsthe retrieved information (type: twisted.internet.defer.Deferred )
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.