Skip to content
Permalink
Browse files
Try to fix #2496
  • Loading branch information
felixfontein committed Sep 15, 2016
1 parent 91c8957 commit d61927f1ff8462bea8fab904e85e60be3ee2baec
Showing with 18 additions and 3 deletions.
  1. +10 −3 nikola/nikola.py
  2. +4 −0 nikola/plugin_categories.py
  3. +4 −0 nikola/plugins/misc/scan_posts.py
@@ -885,14 +885,21 @@ def __init__(self, **config):
self.themes_dirs = ['themes'] + self.config['EXTRA_THEMES_DIRS']

# Avoid redundant compilers
# Remove compilers that match nothing in POSTS/PAGES
# Remove compilers that match nothing in POSTS/PAGES or what other post scanning plugins consider
# And put them in "bad compilers"
pp_exts = set([os.path.splitext(x[0])[1] for x in self.config['post_pages']])
pp_exts = set()
for p in self.plugin_manager.getPluginsOfCategory('PostScanner'):
exts = p.plugin_object.get_appearing_post_extensions()
if exts is None:
pp_exts = None
break
for ext in exts:
pp_exts.add(ext)
self.config['COMPILERS'] = {}
self.disabled_compilers = {}
self.bad_compilers = set([])
for k, v in compilers.items():
if pp_exts.intersection(v):
if pp_exts is None or pp_exts.intersection(v):
self.config['COMPILERS'][k] = sorted(list(v))
else:
self.bad_compilers.add(k)
@@ -136,6 +136,10 @@ def _execute(self, options, args):
"""
raise NotImplementedError()

def get_appearing_post_extensions(self):
"""Returns a list of post extensions which appear, or None if such a list cannot be computed efficiently."""
return None


def help(self):
"""Return help text for a command."""
@@ -99,3 +99,7 @@ def scan(self):
timeline.append(post)

return timeline

def get_appearing_post_extensions(self):
"""Returns a list of post extensions which appear, or None if such a list cannot be computed efficiently."""
return [os.path.splitext(x[0])[1] for x in self.site.config['post_pages']]

0 comments on commit d61927f

Please sign in to comment.