From 83a61da25574d23f7b4dea8e6d31587ff329b050 Mon Sep 17 00:00:00 2001 From: Rory McCann Date: Sun, 12 Jun 2011 18:41:29 +0100 Subject: [PATCH 1/2] fix typo to make work if path ends in / (cf. issue #131) --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 0c0227f0..20f3862e 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -24,7 +24,7 @@ class Pelican(object): ' (see pelican --help for more information)') if self.path.endswith('/'): - self.path = path[:-1] + self.path = self.path[:-1] # define the default settings self.settings = settings From fee2b50cb9e6622b8a02c3bb87d965e05cae1d03 Mon Sep 17 00:00:00 2001 From: Rory McCann Date: Sun, 12 Jun 2011 18:52:42 +0100 Subject: [PATCH 2/2] If the PATH settings is set to a non-absolute path, then use normalize it relative to the settings file. This should probably be done for other settings aswell --- pelican/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pelican/settings.py b/pelican/settings.py index d1826710..98a11216 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -74,5 +74,11 @@ def read_settings(filename): else: log.warn("LOCALE option doesn't contain a correct value") + # Make the paths relative to the settings file + for path in ['PATH']: + if path in context: + if not os.path.isabs(context[path]): + context[path] = os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(filename), context[path]))) + # set the locale return context