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

Fix #3555: Let plugin name be correctly accessed. #3566

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions nikola/nikola.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,8 @@ def init_plugins(self, commands_only=False, load_all=False):
command_plugins = self._activate_plugins_of_category("Command")
for plugin_info in command_plugins:
plugin_info.plugin_object.short_help = plugin_info.description
self._commands[plugin_info.name] = plugin_info.plugin_object
name = getattr(plugin_info.plugin_object, 'name', plugin_info.name)
self._commands[name] = plugin_info.plugin_object

self._activate_plugins_of_category("Task")
self._activate_plugins_of_category("LateTask")
Expand Down Expand Up @@ -1318,7 +1319,8 @@ def _activate_plugins_of_category(self, category):
# this code duplicated in tests/base.py
plugins = []
for plugin_info in self.plugin_manager.getPluginsOfCategory(category):
self.plugin_manager.activatePluginByName(plugin_info.name)
name = getattr(plugin_info.plugin_object, 'name', plugin_info.name)
self.plugin_manager.activatePluginByName(name)
plugin_info.plugin_object.set_site(self)
plugins.append(plugin_info)
return plugins
Expand Down