Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a debug message on multiple plugin copies
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jun 4, 2016
1 parent cb3ad31 commit fc52c42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nikola/nikola.py
Expand Up @@ -933,7 +933,8 @@ def init_plugins(self, commands_only=False, load_all=False):

# Find repeated plugins and discard the less local copy
def plugin_position_in_places(plugin):
# plugin here is a tuple, the 1st element is the path to the .plugin file
# plugin here is a tuple:
# (path to the .plugin file, path to plugin module w/o .py, plugin metadata)
for i, place in enumerate(self._plugin_places):
if plugin[0].startswith(place):
return i
Expand All @@ -946,6 +947,8 @@ def plugin_position_in_places(plugin):
if len(plugins) > 1:
# Sort by locality
plugins.sort(key=plugin_position_in_places)
utils.LOGGER.debug("Plugin {} exists in multiple places, using {}".format(
plugins[-1][2].name, plugins[-1][0]))
self.plugin_manager._candidates.append(plugins[-1])

self.plugin_manager.loadPlugins()
Expand Down

0 comments on commit fc52c42

Please sign in to comment.