File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -831,6 +831,7 @@ def __init__(self, **config):
831
831
832
832
def _activate_plugins_of_category (self , category ):
833
833
"""Activate all the plugins of a given category and return them."""
834
+ # this code duplicated in tests/base.py
834
835
plugins = []
835
836
for plugin_info in self .plugin_manager .getPluginsOfCategory (category ):
836
837
if plugin_info .name in self .config .get ('DISABLED_PLUGINS' ):
Original file line number Diff line number Diff line change 34
34
MarkdownExtension ,
35
35
RestExtension
36
36
)
37
- import nikola
38
37
39
38
40
39
if sys .version_info < (2 , 7 ):
@@ -243,7 +242,18 @@ def __init__(self):
243
242
self .template_system = self
244
243
self .name = 'mako'
245
244
246
- _activate_plugins_of_category = nikola .Nikola ._activate_plugins_of_category
245
+ def _activate_plugins_of_category (self , category ):
246
+ """Activate all the plugins of a given category and return them."""
247
+ # this code duplicated in nikola/nikola.py
248
+ plugins = []
249
+ for plugin_info in self .plugin_manager .getPluginsOfCategory (category ):
250
+ if plugin_info .name in self .config .get ('DISABLED_PLUGINS' ):
251
+ self .plugin_manager .removePluginFromCategory (plugin_info , category )
252
+ else :
253
+ self .plugin_manager .activatePluginByName (plugin_info .name )
254
+ plugin_info .plugin_object .set_site (self )
255
+ plugins .append (plugin_info )
256
+ return plugins
247
257
248
258
def render_template (self , name , _ , context ):
249
259
return ('<img src="IMG.jpg">' )
You can’t perform that action at this time.
0 commit comments