From bf7ba84d93c80cb8eebfd466da47a8664cfc48ce Mon Sep 17 00:00:00 2001 From: Skami18 Date: Wed, 16 Feb 2011 00:02:09 -0800 Subject: [PATCH 1/6] Removed an useless "print" statment... --- pelican/readers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index a8e8d63e..35681ac1 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -70,7 +70,6 @@ class HtmlReader(object): for i in self._re.findall(content): key = i.split(':')[0][5:].strip() value = i.split(':')[-1][:-3].strip() - print [key,value] metadatas[key.lower()] = value return content, metadatas From fd45299b6bfbae332fdf13f232b9c95ea60ab649 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Mon, 14 Feb 2011 18:42:25 +0800 Subject: [PATCH 2/6] 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 d3fd066209f65f62010e518747b771bb37f7e929 Mon Sep 17 00:00:00 2001 From: Massimo Santini Date: Mon, 14 Feb 2011 22:35:17 +0800 Subject: [PATCH 3/6] 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 cbb8a78c191d6fcbef1792862c9b0112a018b642 Mon Sep 17 00:00:00 2001 From: Massimo Santini Date: Mon, 14 Feb 2011 22:40:23 +0800 Subject: [PATCH 4/6] 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)) From 90c084f81841c1953e28df4edef5a781ba49e8b6 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Wed, 16 Feb 2011 06:07:57 +0800 Subject: [PATCH 5/6] fixed a but --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 05b8c216..1ef7fd2f 100755 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -61,7 +61,7 @@ class Pelican(object): p.generate_context() # erase the directory if it is not the source - if os.path.realpath(self.path).startswith(self.output_path) and not keep: + if os.path.realpath(self.path).startswith(self.output_path) and not self.keep: clean_output_dir(self.output_path) writer = self.get_writer() From 284233a92040060d157c1e5c006c3e9398e97aac Mon Sep 17 00:00:00 2001 From: skami Date: Wed, 16 Feb 2011 15:39:22 +0100 Subject: [PATCH 6/6] Non-ASCII in dates are now rendered as xml entities --- pelican/contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index 938315f7..e4dfd037 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -55,7 +55,7 @@ class Page(object): self.date_format = settings['DEFAULT_DATE_FORMAT'] if hasattr(self, 'date'): - self.locale_date = self.date.strftime(self.date_format).decode('utf') + self.locale_date = self.date.strftime(self.date_format.encode('ascii','xmlcharrefreplace')).decode('utf') # store the settings ref. self._settings = settings