From a9a0bd6cd3c576d67973b0f7b73907ccb18500bc Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Mon, 14 Feb 2011 18:42:25 +0800 Subject: [PATCH 1/3] add the settings for pelican command line usage example --- THANKS | 1 + docs/getting_started.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/THANKS b/THANKS index aaee40bc..e0275b7a 100644 --- a/THANKS +++ b/THANKS @@ -11,3 +11,4 @@ bugs or giving ideas. Thanks to them ! - Arnaud Bos - nblock (Florian) - Bruno Bord +- Laureline Guérin diff --git a/docs/getting_started.rst b/docs/getting_started.rst index bc7c73d0..442732be 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -70,7 +70,7 @@ Generate your blog To launch pelican, just use the `pelican` command:: - $ pelican /path/to/your/content/ + $ pelican /path/to/your/content/ [-s path/to/your/settings.py] And… that's all! You can see your weblog generated on the `content/` folder. From 1f821ce2f65bff857a24c0cb29d34080fef1e09c Mon Sep 17 00:00:00 2001 From: Massimo Santini Date: Mon, 14 Feb 2011 15:35:17 +0100 Subject: [PATCH 2/3] Fixed path definition from settings/command line opt --- pelican/__init__.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index f599cc46..05b8c216 100755 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -18,13 +18,14 @@ class Pelican(object): before doing anything else. """ self.path = path or settings['PATH'] - if path or self.path.endswith('/'): + if not self.path: + raise Exception('you need to specify a path to search the docs on !') + if self.path.endswith('/'): self.path = path[:-1] # define the default settings self.settings = settings self.theme = theme or settings['THEME'] - self.path = path output_path = output_path or settings['OUTPUT_PATH'] self.output_path = os.path.realpath(output_path) self.markup = markup or settings['MARKUP'] @@ -39,11 +40,6 @@ class Pelican(object): else: raise Exception("Impossible to find the theme %s" % theme) - # get the list of files to parse - if not self.path: - raise Exception('you need to specify a path to search the docs on !') - - def run(self): """Run the generators and return""" From aba1b39211b6b90d49571a6572598129e38901ee Mon Sep 17 00:00:00 2001 From: Massimo Santini Date: Mon, 14 Feb 2011 15:40:23 +0100 Subject: [PATCH 3/3] Fixed getlocale/setlocale bug accoriding to http://bugs.python.org/issue1699853 and http://hub.esss.com.br/wordpress/blog/archives/8561 --- pelican/writers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/writers.py b/pelican/writers.py index ea53aead..c40c0ea3 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -47,7 +47,7 @@ class Writer(object): :param filename: the filename to output. :param feed_type: the feed type to use (atom or rss) """ - old_locale = locale.getlocale(locale.LC_ALL) + old_locale = locale.setlocale(locale.LC_ALL) locale.setlocale(locale.LC_ALL, 'C') try: self.site_url = context.get('SITEURL', get_relative_path(filename))