envisage.application module

An extensible, pluggable, application.

class envisage.application.Application(plugins=None, **traits)[source]

Bases: HasTraits

An extensible, pluggable, application.

This class handles the common case for non-GUI applications, and it is intended to be subclassed to change start/stop behaviour etc.

add_extension_point(extension_point)[source]

Add an extension point.

add_extension_point_listener(listener, extension_point_id=None)[source]

Add a listener for extensions being added/removed.

add_plugin(plugin)[source]

Add a plugin to the manager.

extension_registry = Instance(IExtensionRegistry)

The extension registry.

get_extension_point(extension_point_id)[source]

Return the extension point with the specified Id.

get_extension_points()[source]

Return all extension points that have been added to the registry.

get_extensions(extension_point_id)[source]

Return a list containing all contributions to an extension point.

get_plugin(plugin_id)[source]

Return the plugin with the specified Id.

get_required_service(protocol, query='', minimize='', maximize='')[source]

Return the service that matches the specified query.

Raise a ‘NoSuchServiceError’ exception if no such service exists.

get_service(protocol, query='', minimize='', maximize='')[source]

Return at most one service that matches the specified query.

get_service_from_id(service_id)[source]

Return the service with the specified id.

get_service_properties(service_id)[source]

Return the dictionary of properties associated with a service.

get_services(protocol, query='', minimize='', maximize='')[source]

Return all services that match the specified query.

home = Str

The name of a directory (created for you) to which the application can read and write non-user accessible data, i.e. configuration information, preferences, etc.

id = Str

The application’s globally unique identifier.

import_symbol(symbol_path)[source]

Import the symbol defined by the specified symbol path.

plugin_added = Delegate("plugin_manager", modify=True)

Fired when a plugin has been added.

plugin_manager = Instance(IPluginManager)

The plugin manager (starts and stops plugins etc).

plugin_removed = Delegate("plugin_manager", modify=True)

Fired when a plugin has been removed.

preferences = Instance(IPreferences)

The root preferences node.

register_service(protocol, obj, properties=None)[source]

Register a service.

remove_extension_point(extension_point_id)[source]

Remove an extension point.

remove_extension_point_listener(listener, extension_point_id=None)[source]

Remove a listener for extensions being added/removed.

remove_plugin(plugin)[source]

Remove a plugin from the manager.

run()[source]

Run the application.

service_registry = Instance(IServiceRegistry)

The service registry.

set_extensions(extension_point_id, extensions)[source]

Set the extensions contributed to an extension point.

set_service_properties(service_id, properties)[source]

Set the dictionary of properties associated with a service.

start()[source]

Start the plugin manager.

Returns True unless the start was vetoed.

start_plugin(plugin=None, plugin_id=None)[source]

Start the specified plugin.

started = Event(ApplicationEvent)

Fired when all plugins have been started.

starting = VetoableEvent(ApplicationEvent)

Fired when the application is starting.

stop()[source]

Stop the plugin manager.

Returns True unless the stop was vetoed.

stop_plugin(plugin=None, plugin_id=None)[source]

Stop the specified plugin.

stopped = Event(ApplicationEvent)

Fired when all plugins have been stopped.

stopping = VetoableEvent(ApplicationEvent)

Fired when the application is stopping.

unregister_service(service_id)[source]

Unregister a service.

user_data = Str

The name of a directory (created for you upon access) to which the application can read and write user-accessible data, e.g. projects created by the user.