Skip to content
Permalink
Browse files

Revert "Trying to de-duplicate code."

This reverts commit ceda8e9.
  • Loading branch information
Kwpolska committed Jul 5, 2015
1 parent ceda8e9 commit c9e6d8ca744b29e0bbaaed08caf4c42f2a8a39d9
Showing with 13 additions and 2 deletions.
  1. +1 −0 nikola/nikola.py
  2. +12 −2 tests/base.py
@@ -831,6 +831,7 @@ def __init__(self, **config):

def _activate_plugins_of_category(self, category):
"""Activate all the plugins of a given category and return them."""
# this code duplicated in tests/base.py
plugins = []
for plugin_info in self.plugin_manager.getPluginsOfCategory(category):
if plugin_info.name in self.config.get('DISABLED_PLUGINS'):
@@ -34,7 +34,6 @@
MarkdownExtension,
RestExtension
)
import nikola


if sys.version_info < (2, 7):
@@ -243,7 +242,18 @@ def __init__(self):
self.template_system = self
self.name = 'mako'

_activate_plugins_of_category = nikola.Nikola._activate_plugins_of_category
def _activate_plugins_of_category(self, category):
"""Activate all the plugins of a given category and return them."""
# this code duplicated in nikola/nikola.py
plugins = []
for plugin_info in self.plugin_manager.getPluginsOfCategory(category):
if plugin_info.name in self.config.get('DISABLED_PLUGINS'):
self.plugin_manager.removePluginFromCategory(plugin_info, category)
else:
self.plugin_manager.activatePluginByName(plugin_info.name)
plugin_info.plugin_object.set_site(self)
plugins.append(plugin_info)
return plugins

def render_template(self, name, _, context):
return('<img src="IMG.jpg">')

0 comments on commit c9e6d8c

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