1
0
Fork 0
forked from github/pelican

Replace os.sep.join with the more robust os.path.join

From the Python docs for os.sep [1]:

  Note that knowing this is not sufficient to be able to parse or
  concatenate pathnames - use os.path.split() and os.path.join()...

Where I touched a line, I also changed double quoted string literals
to single quotes, since they are used more often in the source:

  wking@mjolnir ~/src/pelican $ git grep "'" pelican/*.py | wc -l
  683
  wking@mjolnir ~/src/pelican $ git grep '"' pelican/*.py | wc -l
  181

[1]: http://docs.python.org/3/library/os.html#os.sep
This commit is contained in:
W. Trevor King 2013-01-04 14:46:17 -05:00
commit e5e455e0e5
3 changed files with 26 additions and 22 deletions

View file

@ -347,7 +347,7 @@ class ArticlesGenerator(Generator):
def generate_drafts(self, write):
"""Generate drafts pages."""
for article in self.drafts:
write('drafts/%s.html' % article.slug,
write(os.path.join('drafts', '%s.html' % article.slug),
self.get_template(article.template), self.context,
article=article, category=article.category,
all_articles=self.articles)