mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fixes #1686: posixize paths in context['filenames'] to fix windows issues
This commit is contained in:
parent
f19ea17d0a
commit
90a283bc44
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue