From 43bb65f9575bc9aae809822d63e689ba08fa5391 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Wed, 15 Feb 2012 17:06:07 +0100 Subject: [PATCH] Add a style and minor fix --- demo/moulinrouge/__init__.py | 11 ++++++++--- pygal/__init__.py | 2 +- pygal/style.py | 12 +++++++++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/demo/moulinrouge/__init__.py b/demo/moulinrouge/__init__.py index ae03926..b61787e 100644 --- a/demo/moulinrouge/__init__.py +++ b/demo/moulinrouge/__init__.py @@ -16,8 +16,7 @@ # # You should have received a copy of the GNU Lesser General Public License # along with pygal. If not, see . -from flask import Flask, Response, render_template, url_for -from log_colorizer import make_colored_stream_handler +from flask import Flask, render_template, url_for from moulinrouge.data import labels, series from logging import getLogger, INFO, DEBUG import pygal @@ -43,7 +42,13 @@ def create_app(): """Creates the pygal test web app""" app = Flask(__name__) - handler = make_colored_stream_handler() + try: + from log_colorizer import make_colored_stream_handler + handler = make_colored_stream_handler() + except ImportError: + from logging import StreamHandler + handler = StreamHandler() + getLogger('werkzeug').addHandler(handler) getLogger('werkzeug').setLevel(INFO) getLogger('pygal').addHandler(handler) diff --git a/pygal/__init__.py b/pygal/__init__.py index 6f52c21..1bb8cba 100644 --- a/pygal/__init__.py +++ b/pygal/__init__.py @@ -16,7 +16,7 @@ # # You should have received a copy of the GNU Lesser General Public License # along with pygal. If not, see . -__version__ = '0.9.2' +__version__ = '0.9.3' from collections import namedtuple from pygal.graph.bar import Bar diff --git a/pygal/style.py b/pygal/style.py index bc4d728..08cf514 100644 --- a/pygal/style.py +++ b/pygal/style.py @@ -67,7 +67,17 @@ NeonStyle = Style( opacity='.1', opacity_hover='.75', transition='1s ease-out') +CleanStyle = Style( + background='transparent', + plot_background='rgba(0, 0, 0, 0.05)', + foreground='rgba(0, 0, 0, 0.9)', + foreground_light='rgba(0, 0, 0, 0.9)', + foreground_dark='rgba(0, 0, 0, 0.5)', + colors=( + 'rgb(12,55,149)', 'rgb(117,38,65)', 'rgb(228,127,0)', 'rgb(159,170,0)', + 'rgb(149,12,12)')) styles = {'default': DefaultStyle, 'light': LightStyle, - 'neon': NeonStyle} + 'neon': NeonStyle, + 'clean': CleanStyle}