Skip to content

Commit

Permalink
Add a name to the EventManagerPlugin (#571)
Browse files Browse the repository at this point in the history
This tiny PR adds a name to the `EventManagerPlugin`, to prevent a
WARNING being logged on computing the `repr` of the plugin.

On main:
```python
Python 3.11.9 (main, Apr  4 2024, 05:29:26) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.basicConfig()
>>> from envisage.plugins.event_manager.api import EventManagerPlugin
>>> plugin = EventManagerPlugin()
>>> plugin
WARNING:envisage.plugin:plugin <envisage.plugins.event_manager.plugin.EventManagerPlugin object at 0x100d8a160> has no name - using <Event Manager Plugin>
EventManagerPlugin(id='envisage.event_manager', name='Event Manager Plugin')
```

On this branch:
```python
Python 3.11.9 (main, Apr  4 2024, 05:29:26) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.basicConfig()
>>> from envisage.plugins.event_manager.api import EventManagerPlugin
>>> plugin = EventManagerPlugin()
>>> plugin
EventManagerPlugin(id='envisage.event_manager', name='Event Manager')
```
  • Loading branch information
mdickinson committed Jun 5, 2024
1 parent f229deb commit d358e7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions envisage/plugins/event_manager/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
class EventManagerPlugin(Plugin):
"""Plugin to add event manager to the application."""

#: The plugin's unique identifier.
id = "envisage.event_manager"

#: The plugin's name (suitable for displaying to the user).
name = "Event Manager"

SERVICE_OFFERS = "envisage.service_offers"
service_offers = List(contributes_to=SERVICE_OFFERS)

Expand Down

0 comments on commit d358e7d

Please sign in to comment.