Package elisa :: Package core :: Module component
[hide private]
[frames] | no frames]

Module component

source code

Component base class. Plugins create them. This is where the Plugins logic stands.

Classes [hide private]
  ComponentError
Generic exception raised when Component related error happens.
  UnSupportedPlatform
Raised when the component does not support user's platform
  UnMetDependency
Raised by Component.check_dependencies() when it finds an un-met dependency.
  InitializeFailure
Raised by Component.initialize() when it fails to initialize internal variables of the component.
  Component
A Component is a simple object created by Plugins.
Functions [hide private]
3-tuple (name: string, sign: string, version: string)
parse_dependency(dependency)
Scan an input string and detect dependency name, requirement sign (>,<,...) and version:
source code
 
_check_version(component_name, module_name, module, sign, required_version)
Check the version of the given module, given its version requirements, for the given component name.
source code
list of strings
check_platforms(component_path, platforms)
Check if the platforms list complies with the host's platform, for the given component name.
source code
bool
check_python_dependencies(component_path, deps)
Verify that the Python dependencies are correctly installed for the given component name.
source code
Variables [hide private]
  __maintainer__ = 'Philippe Normand <philippe@fluendo.com>'
Function Details [hide private]

parse_dependency(dependency)

source code 
Scan an input string and detect dependency name, requirement sign (>,<,...) and version:
  >>> parse_dependency("pgm >= 0.3")
  >>> ("pgm", ">=", "0.3")
Parameters:
  • dependency (string) - the dependency requirement to parse
Returns: 3-tuple (name: string, sign: string, version: string)

_check_version(component_name, module_name, module, sign, required_version)

source code 
Check the version of the given module, given its version requirements, for the given component name.
Parameters:
  • component_name (string) - name of the component we are checking module's version for
  • module_name (string) - name of the module we're checking version for
  • module (object) - module we're checking version for
  • sign (string) - requirement sign (one of >,<,==,>=,<=)
  • required_version (string) - expected version of the module
Raises:

check_platforms(component_path, platforms)

source code 
Check if the platforms list complies with the host's platform, for the given component name.
Parameters:
  • component_path (string) - name of the component we are checking platform for
  • platforms (list) - list of platforms supported by the component
Returns: list of strings
the valud names for current platform
Raises:
  • UnSupportedPlatform - when none of component's supported platforms complies with host platform

check_python_dependencies(component_path, deps)

source code 
Verify that the Python dependencies are correctly installed for the given component name. We first try to import each dependency (using __import__) and then we check if the version matches the required one specified in the dependency string.
Parameters:
  • component_path (string) - name of the component we are checking python dependencies for
  • deps (list) - list of component's dependencies, as strings
Returns: bool
Raises: