Skip to content
Permalink
Browse files
Optimizing WordPress plugin finding.
  • Loading branch information
felixfontein committed Jul 12, 2015
1 parent 220d27b commit 6a1813bedb78a5c31fa73537466095e124ff3fa3
Showing with 8 additions and 7 deletions.
  1. +8 −7 nikola/plugins/command/import_wordpress.py
@@ -180,13 +180,14 @@ class CommandImportWordpress(Command, ImportMixin):
all_tags = set([])

def _find_wordpress_compiler(self):
for plugin_info in self.site.plugin_manager.getPluginsOfCategory('PageCompiler'):
if plugin_info.name == 'wordpress':
if not plugin_info.is_activated:
self.site.plugin_manager.activatePluginByName(plugin_info.name)
plugin_info.plugin_object.set_site(self.site)
self.wordpress_page_compiler = plugin_info.plugin_object
break
if self.wordpress_page_compiler is not None:
return
plugin_info = self.site.plugin_manager.getPluginByName('wordpress', 'PageCompiler')
if plugin_info is not None:
if not plugin_info.is_activated:
self.site.plugin_manager.activatePluginByName(plugin_info.name)
plugin_info.plugin_object.set_site(self.site)
self.wordpress_page_compiler = plugin_info.plugin_object

def _read_options(self, options, args):
options['filename'] = args.pop(0)

0 comments on commit 6a1813b

Please sign in to comment.