Package elisa :: Package core :: Module plugin_registry

Module plugin_registry

source code

Classes
  InvalidComponentPath
  ComponentNotFound
  PluginNotFound
  PluginAlreadyEnabled
  PluginAlreadyDisabled
  DeserializationError
  PluginStatusMessage
A plugin has been enabled or disabled.
  PluginRegistry
The plugin registry is responsible for finding, loading, downloading, enabling plugins and providing facilities to access their contents and properties.
Functions
 
is_development_egg(dist)
Check if the distribution is a development egg.
source code
 
get_plugin_toplevel_directory(dist)
Get the top level directory of a plugin distribution.
source code
Variables
  json = None
hash(x)
  default_plugin_dirs = []

Imports: os, sys, pkg_resources, DistributionNotFound, shutil, task, reflect, Failure, common, core_version, default_config, ComponentError, Message, Loggable, defer, locale_helper, get_page, enum, md5


Function Details

is_development_egg(dist)

source code 

Check if the distribution is a development egg.

Development eggs store egg-info and python code in the same toplevel directory.

Parameters:
  • dist (Distribution) - plugin distribution

get_plugin_toplevel_directory(dist)

source code 

Get the top level directory of a plugin distribution.

Regular eggs and development eggs store files in different locations. Use this function to access the top level directory of a plugin eg:

   toplevel_directory = get_plugin_toplevel_directory(dist)
   sub_directory = '%s/%s' % (toplevel_directory, 'sub')
   requirement = pkg_resources.Requirement.parse(dist.project_name)
   if pkg_resources.resource_isdir(requirement, sub_directory):
       real_sub_path = pkg_resources.resource_filename(requirement,
               sub_directory)
Parameters:
  • dist (Distribution) - plugin distribution