Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bot, reload: log/show plugin source when reloading #1762

Merged
merged 4 commits into from
Dec 9, 2019
Merged

Conversation

dgw
Copy link
Member

@dgw dgw commented Nov 23, 2019

This would have saved me a good half-hour of confusion tonight, by showing me that my bot was using an (outdated) plugin file in .sopel/modules that shadowed the built-in plugin from sopel.modules.*.

I think the added bot.get_plugin_meta() function is helpful, and it was necessary to implement the output I wanted in reload, but there could be a reason I haven't thought of that makes it a bad idea. Definitely tell me if so!

Even just having the reloaded plugin's metadata in logs, and not on IRC, would have helped. I added it back to reload because 1) it used to show the file path before the plugin system rework, and 2) I like not having to check my terminal/log-files for things. 😛

Note: I'm putting this in 7.0 because let's face it: a lot of people are going to make updates to their plugins for this release, to take advantage of new features and/or fix compatibility problems. We should make it easy for them to verify that the correct file/module is being loaded during development, even if .reload is still buggy for some plugin types.

@dgw dgw added this to the 7.0.0 milestone Nov 23, 2019
@dgw dgw requested a review from a team November 23, 2019 07:29
Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

dgw added 4 commits November 23, 2019 23:51
For plugins like `reload`, it's useful to have access to metadata about
(other) loaded plugins. But we shouldn't normalize poking around in the
`bot._plugins` dict, so let's add an API function instead that gives
read access to the plugin's metadata only (and doesn't return the entire
plugin object to be messed with)
One of the many places where we still referred to "modules" instead of
"plugins", as is the current terminology.

I was here anyway, adding more details about the loaded plugin. But the
secondary changes to wording definitely dominate the diff.
@dgw dgw force-pushed the reload-show-source branch from 5516dae to c618070 Compare November 24, 2019 05:51
@dgw dgw merged commit f95641e into master Dec 9, 2019
@dgw dgw deleted the reload-show-source branch December 9, 2019 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants