Merge pull request #1700 from avaris/1686

Fixes #1686: posixize paths in context['filenames'] to fix windows issues
This commit is contained in:
Justin Mayer 2015-04-29 16:06:19 +02:00
commit 9a38f61e4d

View file

@ -22,7 +22,8 @@ from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader,
from pelican.contents import Article, Draft, Page, Static, is_valid_content from pelican.contents import Article, Draft, Page, Static, is_valid_content
from pelican.readers import Readers from pelican.readers import Readers
from pelican.utils import (copy, process_translations, mkdir_p, DateFormatter, from pelican.utils import (copy, process_translations, mkdir_p, DateFormatter,
FileStampDataCacher, python_2_unicode_compatible) FileStampDataCacher, python_2_unicode_compatible,
posixize_path)
from pelican import signals from pelican import signals
@ -160,7 +161,7 @@ class Generator(object):
(For example, one that was missing mandatory metadata.) (For example, one that was missing mandatory metadata.)
The path argument is expected to be relative to self.path. The path argument is expected to be relative to self.path.
""" """
self.context['filenames'][os.path.normpath(path)] = None self.context['filenames'][posixize_path(os.path.normpath(path))] = None
def _is_potential_source_path(self, path): def _is_potential_source_path(self, path):
"""Return True if path was supposed to be used as a source file. """Return True if path was supposed to be used as a source file.
@ -168,7 +169,7 @@ class Generator(object):
before this method is called, even if they failed to process.) before this method is called, even if they failed to process.)
The path argument is expected to be relative to self.path. The path argument is expected to be relative to self.path.
""" """
return os.path.normpath(path) in self.context['filenames'] return posixize_path(os.path.normpath(path)) in self.context['filenames']
def _update_context(self, items): def _update_context(self, items):
"""Update the context with the given items from the currrent """Update the context with the given items from the currrent