exopy.app.dependencies.plugin module

Plugin handling dependencies declarations.

exopy.app.dependencies.plugin.clean_dict(mapping)[source]

Keep only the non False entry from a dict.

class exopy.app.dependencies.plugin.BuildContainer[source]

Bases: atom.atom.Atom

Class used to store infos about collected build dependencies.

dependencies

Dictionary storing the collected dependencies, grouped by id.

errors

Dictionary storing the errors which occurred during collection.

clean()[source]

Remove all empty entries from dictionaries.

class exopy.app.dependencies.plugin.RuntimeContainer[source]

Bases: exopy.app.dependencies.plugin.BuildContainer

Class used to store infos about collected runtime dependencies.

unavailable

Runtime dependencies which exists but are currently used by another part of the application and hence are unavailable.

clean()[source]

Remove all empty entries from dictionaries.

class exopy.app.dependencies.plugin.DependenciesPlugin[source]

Bases: enaml.workbench.plugin.Plugin

Dependencies manager for the application.

build_deps

Contributed build dependencies.

run_deps_analysers

Contributed runtime dependencies analysers.

run_deps_collectors

Contributed runtime dependencies collectors.

start()[source]

Start the manager and load all contributions.

stop()[source]

Stop the manager.

analyse_dependencies(obj, dependencies=['build'])[source]

Analyse the dependencies of a given object.

The object must either be a configobj.Section object or have a traverse method yielding the object and all its subcomponent suceptible to add more dependencies.

Parameters
  • obj (object) – Obj whose dependencies should be analysed.

  • dependencies ({['build'], ['runtime'], ['build', 'runtime']}) – Kind of dependencies which should be gathered. Note that only build dependencies can be retrieved from a configobj.Section object.

Returns

dependencies – BuildContainer, RuntimeContaineror tuple of both according to the requested dependencies.

Return type

BuildContainer | RuntimeContainer | tuple

validate_dependencies(kind, dependencies)[source]

Validate that a set of dependencies is valid (ie exists).

Parameters
  • kind ({'build', 'runtime'}) – Kind of dependency to validate.

  • dependencies (dict) – Dictionary of dependencies sorted by id. This is typically the content of the dependencies attribute of BuildContainer or RuntimeContainer.

Returns

  • result (bool) – Boolean indicating whether or not all dependencies are valid.

  • errors (dict) – Dictionary containing the errors which occured. Those are stored by dependency id and by dependency.

collect_dependencies(kind, dependencies, owner=None)[source]

Collect that a set of dependencies.

For runtime dependencies if permissions are necessary to use a dependence they are requested and should released when they are no longer needed.

Parameters
  • kind ({'build', 'runtime'}) – Kind of dependency to validate.

  • dependencies (dict) – Dictionary of dependencies sorted by id. This is typically the content of the dependencies attribute of BuildContainer or RuntimeContainer.

  • owner (unicode, optional) – Calling plugin id. Used for some runtime dependencies needing to know the ressource owner.

Returns

dependencies – BuildContainer, RuntimeContainer or tuple of both according to the requested dependencies.

Return type

BuildContainer | RuntimeContainer | tuple

release_runtimes(owner, dependencies)[source]

Release runtime dependencies previously acquired (collected).

Parameters
  • owner (unicode) – Id of the plugin releasing the ressources.

  • dependencies (dict) – Dictionary containing the runtime dependencies to release organised by id.