Skip to content
Permalink
Browse files
nicer code, don't load compiler extensions you don't need
  • Loading branch information
ralsina committed Aug 15, 2015
1 parent 145d9f3 commit da89a410fbc40c11060f53e18d019950942fed32
Showing with 15 additions and 4 deletions.
  1. +15 −4 nikola/nikola.py
@@ -745,10 +745,21 @@ def __init__(self, **config):

self.plugin_manager.getPluginLocator().setPluginPlaces(places)
self.plugin_manager.locatePlugins()
# Remove compilers we don't use
self.plugin_manager._candidates = [p for p in self.plugin_manager._candidates if p[-1].name not in bad_compilers]
# Remove blacklisted plugins
self.plugin_manager._candidates = [p for p in self.plugin_manager._candidates if p[-1].name not in self.config['DISABLED_PLUGINS']]
bad_candidates = set([])
for p in self.plugin_manager._candidates:
# Remove compilers we don't use
if p[-1].name in bad_compilers:
bad_candidates.add(p)
utils.LOGGER.debug('Not loading unneeded compiler {}', p[-1].name)
# Remove blacklisted plugins
if p[-1].name in self.config['DISABLED_PLUGINS']:
bad_candidates.add(p)
utils.LOGGER.debug('Not loading disabled plugin {}', p[-1].name)
# Remove compiler extensions we don't need
if p[-1].details.has_option('Nikola', 'compiler') and p[-1].details.get('Nikola', 'compiler') in bad_compilers:
bad_candidates.add(p)
utils.LOGGER.debug('Not loading comopiler extension {}', p[-1].name)
self.plugin_manager._candidates = list(set(self.plugin_manager._candidates) - bad_candidates)
self.plugin_manager.loadPlugins()

self._activate_plugins_of_category("SignalHandler")

0 comments on commit da89a41

Please sign in to comment.