Skip to content
Permalink
Browse files

do a path cache

  • Loading branch information
ralsina committed Jun 2, 2015
1 parent 19a9085 commit 5ef55507db9ed835a6721d62bd9b7e1d1bd38d5b
Showing with 5 additions and 1 deletion.
  1. +5 −1 nikola/nikola.py
@@ -1176,6 +1176,8 @@ def generic_rss_renderer(self, lang, title, link, description, timeline, output_
data = data.decode('utf-8')
rss_file.write(data)

path_cache = {}

def path(self, kind, name, lang=None, is_link=False):
"""Build the path to a certain kind of page.
@@ -1226,7 +1228,9 @@ def path(self, kind, name, lang=None, is_link=False):
else:
return link
else:
return os.path.join(*path)
path = os.path.join(*path)
self.path_cache[path] = (kind, name, lang)
return path
except KeyError:
utils.LOGGER.warn("Unknown path request of kind: {0}".format(kind))
return ""

0 comments on commit 5ef5550

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