Skip to content
Permalink
Browse files

Moving taxonomy plugin collection to Nikola.init_plugins().

  • Loading branch information
felixfontein committed Dec 1, 2016
1 parent 7349d52 commit d11fee91358d56a0ace379624a92f688f5060999
Showing with 11 additions and 8 deletions.
  1. +9 −0 nikola/nikola.py
  2. +2 −8 nikola/plugins/misc/taxonomies_classifier.py
@@ -1023,6 +1023,15 @@ def plugin_position_in_places(plugin):
self.plugin_manager.loadPlugins()

self._activate_plugins_of_category("Taxonomy")
self.taxonomy_plugins = {}
for taxonomy in [p.plugin_object for p in self.plugin_manager.getPluginsOfCategory('Taxonomy')]:
if not taxonomy.is_enabled():
continue
if taxonomy.classification_name in self.taxonomy_plugins:
utils.LOGGER.error("Found more than one taxonomy with classification name '{}'!".format(taxonomy.classification_name))
sys.exit(1)
self.taxonomy_plugins[taxonomy.classification_name] = taxonomy

self._activate_plugins_of_category("SignalHandler")

# Emit signal for SignalHandlers which need to start running immediately.
@@ -310,12 +310,6 @@ def set_site(self, site):
super(TaxonomiesClassifier, self).set_site(site)
# Add hook for after post scanning
blinker.signal("scanned").connect(self._do_classification)
# Register path handlers and check for uniqueness of classification name
site.taxonomy_plugins = {}
for taxonomy in [p.plugin_object for p in site.plugin_manager.getPluginsOfCategory('Taxonomy')]:
if not taxonomy.is_enabled():
continue
if taxonomy.classification_name in site.taxonomy_plugins:
raise Exception("Found more than one taxonomy with classification name '{}'!".format(taxonomy.classification_name))
site.taxonomy_plugins[taxonomy.classification_name] = taxonomy
# Register path handlers
for taxonomy in site.taxonomy_plugins.values():
self._register_path_handlers(taxonomy)

0 comments on commit d11fee9

Please sign in to comment.
You can’t perform that action at this time.