Debian Codegraph @

envisage/extension_point_changed_event.py

raw
1 # (C) Copyright 2007-2025 Enthought, Inc., Austin, TX
2 # All rights reserved.
3 #
4 # This software is provided without warranty under the terms of the BSD
5 # license included in LICENSE.txt and may be redistributed only under
6 # the conditions described in the aforementioned license. The license
7 # is also available online at http://www.enthought.com/licenses/BSD.txt
8 #
9 # Thanks for using Enthought open source!
10 """ An event fired when an extension point's extensions have changed. """
11
12
13 # Enthought library imports.
14 from traits.api import TraitListEvent
15
16
17 class ExtensionPointChangedEvent(TraitListEvent):
18 """An event fired when an extension point's extensions have changed."""
19
20 def __init__(self, extension_point_id=None, **kw):
21 """Constructor."""
22
23 # The base class has the 'index', 'removed' and 'added' attributes.
24 super().__init__(**kw)
25
26 # We add the extension point Id.
27 self.extension_point_id = extension_point_id
28
29 def __repr__(self):
30 return (
31 "ExtensionPointChangedEvent(extension_point_id={!r}, "
32 "index={!r}, removed={!r}, added={!r})"
33 ).format(self.extension_point_id, self.index, self.removed, self.added)