Merge branch 'master' of github.com:ametaireau/pelican

This commit is contained in:
Alexis Metaireau 2012-03-16 19:59:19 +01:00
commit e38e3e14e6
13 changed files with 802 additions and 805 deletions

View file

@ -2,4 +2,3 @@ include *.rst
global-include *.py global-include *.py
recursive-include pelican *.html *.css *png recursive-include pelican *.html *.css *png
include LICENSE include LICENSE
global-include *.bat

View file

@ -3,6 +3,8 @@ import sys, os
sys.path.append(os.path.abspath('..')) sys.path.append(os.path.abspath('..'))
from pelican import __version__, __major__
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
templates_path = ['_templates'] templates_path = ['_templates']
extensions = ['sphinx.ext.autodoc',] extensions = ['sphinx.ext.autodoc',]
@ -11,8 +13,8 @@ master_doc = 'index'
project = u'Pelican' project = u'Pelican'
copyright = u'2010, Alexis Metaireau and contributors' copyright = u'2010, Alexis Metaireau and contributors'
exclude_patterns = ['_build'] exclude_patterns = ['_build']
version = "2" version = __version__
release = version release = __major__
# -- Options for HTML output --------------------------------------------------- # -- Options for HTML output ---------------------------------------------------

View file

@ -11,7 +11,9 @@ from pelican.utils import clean_output_dir, files_changed
from pelican.writers import Writer from pelican.writers import Writer
from pelican import log from pelican import log
__version__ = "3.0" __major__ = 3
__minor__ = 0
__version__ = "{0}.{1}".format(__major__, __minor__)
class Pelican(object): class Pelican(object):

View file

@ -8,31 +8,25 @@ from logging import Formatter, getLogger, StreamHandler
RESET_TERM = u'\033[0;m' RESET_TERM = u'\033[0;m'
def term_color(code): def start_color(index):
return lambda text: code + unicode(text) + RESET_TERM return u'\033[1;{0}m'.format(index)
def term_color(color):
code = COLOR_CODES[color]
return lambda text: start_color(code) + unicode(text) + RESET_TERM
COLOR_CODES = { COLOR_CODES = {
'gray': u'\033[1;30m', 'red': 31,
'red': u'\033[1;31m', 'yellow': 33,
'green': u'\033[1;32m', 'cyan': 36,
'yellow': u'\033[1;33m', 'white': 37,
'blue': u'\033[1;34m', 'bgred': 41,
'magenta': u'\033[1;35m', 'bggrey': 100,
'cyan': u'\033[1;36m',
'white': u'\033[1;37m',
'bgred': u'\033[1;41m',
'bggreen': u'\033[1;42m',
'bgbrown': u'\033[1;43m',
'bgblue': u'\033[1;44m',
'bgmagenta': u'\033[1;45m',
'bgcyan': u'\033[1;46m',
'bggray': u'\033[1;47m',
'bgyellow': u'\033[1;43m',
'bggrey': u'\033[1;100m',
} }
ANSI = dict((col, term_color(code)) for col, code in COLOR_CODES.items()) ANSI = dict((col, term_color(col)) for col in COLOR_CODES)
class ANSIFormatter(Formatter): class ANSIFormatter(Formatter):

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
from setuptools import setup from setuptools import setup
VERSION = "3.0" # find a better way to do so. from pelican import __version__
requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'pytz'] requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'pytz']
@ -13,21 +13,21 @@ except ImportError:
entry_points = { entry_points = {
'console_scripts': [ 'console_scripts': [
'pelican = pelican:main', 'pelican = pelican:main',
'pelican-import = tools.pelican_import:main', 'pelican-import = pelican.tools.pelican_import:main',
'pelican-quickstart = tools.pelican_quickstart:main', 'pelican-quickstart = pelican.tools.pelican_quickstart:main',
'pelican-themes = tools.pelican_themes:main' 'pelican-themes = pelican.tools.pelican_themes:main'
] ]
} }
setup( setup(
name = "pelican", name = "pelican",
version = VERSION, version = __version__,
url = 'http://pelican.notmyidea.org/', url = 'http://pelican.notmyidea.org/',
author = 'Alexis Metaireau', author = 'Alexis Metaireau',
author_email = 'alexis@notmyidea.org', author_email = 'alexis@notmyidea.org',
description = "A tool to generate a static blog from reStructuredText or Markdown input files.", description = "A tool to generate a static blog from reStructuredText or Markdown input files.",
long_description=open('README.rst').read(), long_description=open('README.rst').read(),
packages = ['pelican'], packages = ['pelican', 'pelican.tools'],
include_package_data = True, include_package_data = True,
install_requires = requires, install_requires = requires,
entry_points = entry_points, entry_points = entry_points,