enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
80 stars 26 forks source link

Add a name to the EventManagerPlugin #571

Closed mdickinson closed 1 month ago

mdickinson commented 1 month ago

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 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 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')
mdickinson commented 1 month ago

@siddhantwahal Would you be willing to review? This warning was showing up unexpectedly during debugging in some project code that uses Envisage.