mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #110 from kmike/master
Python 2.5 compatibility, executable setup.py and up-to-date docstrings. (thanks kmike)
This commit is contained in:
commit
1baca77f3a
4 changed files with 24 additions and 18 deletions
|
|
@ -6,8 +6,7 @@ class Page(object):
|
|||
"""Represents a page
|
||||
Given a content, and metadatas, create an adequate object.
|
||||
|
||||
:param string: the string to parse, containing the original content.
|
||||
:param markup: the markup language to use while parsing.
|
||||
:param content: the string to parse, containing the original content.
|
||||
"""
|
||||
mandatory_properties = ('title',)
|
||||
|
||||
|
|
@ -90,6 +89,6 @@ def is_valid_content(content, f):
|
|||
try:
|
||||
content.check_properties()
|
||||
return True
|
||||
except NameError as e:
|
||||
except NameError, e:
|
||||
error(u"Skipping %s: impossible to find informations about '%s'" % (f, e))
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -63,7 +63,13 @@ class Generator(object):
|
|||
extensions = self.markup
|
||||
|
||||
files = []
|
||||
for root, dirs, temp_files in os.walk(path, followlinks=True):
|
||||
|
||||
try:
|
||||
iter = os.walk(path, followlinks=True)
|
||||
except TypeError: # python 2.5 does not support followlinks
|
||||
iter = os.walk(path)
|
||||
|
||||
for root, dirs, temp_files in iter:
|
||||
for e in exclude:
|
||||
if e in dirs:
|
||||
dirs.remove(e)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import with_statement
|
||||
import os
|
||||
import re
|
||||
from codecs import open
|
||||
|
|
@ -44,9 +45,8 @@ class Writer(object):
|
|||
Return the feed. If no output_path or filename is specified, just return
|
||||
the feed object.
|
||||
|
||||
:param articles: the articles to put on the feed.
|
||||
:param elements: the articles to put on the feed.
|
||||
:param context: the context to get the feed metadata.
|
||||
:param output_path: where to output the file.
|
||||
:param filename: the filename to output.
|
||||
:param feed_type: the feed type to use (atom or rss)
|
||||
"""
|
||||
|
|
|
|||
1
setup.py
Normal file → Executable file
1
setup.py
Normal file → Executable file
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
from setuptools import setup
|
||||
import sys
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue