Skip to content
Permalink
Browse files

Fix #2080

  • Loading branch information
ralsina committed Sep 14, 2015
1 parent 86d786c commit 256e410d2ac3ae939d6c680b92c089c163f99510
Showing with 5 additions and 6 deletions.
  1. +1 −0 CHANGES.txt
  2. +0 −1 nikola/nikola.py
  3. +4 −5 nikola/plugins/task/listings.py
@@ -19,6 +19,7 @@ Features
Bugfixes
--------

* Remove bogus ambiguity on listing links (Issue #2080)
* Unix-slash caused conflict in windows (Issue #2079)
* Locale is now threadsafe, avoid races in threaded builds (Issue #2071)
* Make typogrify filter work when applied from metadata (Issue #2064)
@@ -1362,7 +1362,6 @@ def path(self, kind, name, lang=None, is_link=False):
platform's separator.
(ex: "archive\index.html")
"""
import pdb; pdb.set_trace()
if lang is None:
lang = utils.LocaleBorg().current_lang

@@ -28,6 +28,7 @@

from __future__ import unicode_literals, print_function

from collections import defaultdict
import sys
import os
import lxml.html
@@ -48,9 +49,7 @@ class Listings(Task):

def register_output_name(self, input_folder, rel_name, rel_output_name):
"""Register proper and improper file mappings."""
if rel_name not in self.improper_input_file_mapping:
self.improper_input_file_mapping[rel_name] = []
self.improper_input_file_mapping[rel_name].append(rel_output_name)
self.improper_input_file_mapping[rel_name].add(rel_output_name)
self.proper_input_file_mapping[os.path.join(input_folder, rel_name)] = rel_output_name
self.proper_input_file_mapping[rel_output_name] = rel_output_name

@@ -85,7 +84,7 @@ def set_site(self, site):
# a list is needed. This is needed for compatibility to previous Nikola
# versions, where there was no need to specify the input directory name
# when asking for a link via site.link('listing', ...).
self.improper_input_file_mapping = {}
self.improper_input_file_mapping = defaultdict(set)

# proper_input_file_mapping maps relative input file (relative to CWD)
# to a generated output file. Since we don't allow an input directory
@@ -280,7 +279,7 @@ def listing_path(self, namep, lang):
sys.exit(1)
if len(self.site.config['LISTINGS_FOLDERS']) > 1:
utils.LOGGER.notice("Using listings names in site.link() without input directory prefix while configuration's LISTINGS_FOLDERS has more than one entry.")
name = self.improper_input_file_mapping[name][0]
name = list(self.improper_input_file_mapping[name])[0]
break
else:
utils.LOGGER.error("Unknown listing name {0}!".format(namep))

0 comments on commit 256e410

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