Browse Source

Add a style and minor fix

pull/8/head
Florian Mounier 13 years ago
parent
commit
43bb65f957
  1. 11
      demo/moulinrouge/__init__.py
  2. 2
      pygal/__init__.py
  3. 12
      pygal/style.py

11
demo/moulinrouge/__init__.py

@ -16,8 +16,7 @@
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with pygal. If not, see <http://www.gnu.org/licenses/>. # along with pygal. If not, see <http://www.gnu.org/licenses/>.
from flask import Flask, Response, render_template, url_for from flask import Flask, render_template, url_for
from log_colorizer import make_colored_stream_handler
from moulinrouge.data import labels, series from moulinrouge.data import labels, series
from logging import getLogger, INFO, DEBUG from logging import getLogger, INFO, DEBUG
import pygal import pygal
@ -43,7 +42,13 @@ def create_app():
"""Creates the pygal test web app""" """Creates the pygal test web app"""
app = Flask(__name__) 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').addHandler(handler)
getLogger('werkzeug').setLevel(INFO) getLogger('werkzeug').setLevel(INFO)
getLogger('pygal').addHandler(handler) getLogger('pygal').addHandler(handler)

2
pygal/__init__.py

@ -16,7 +16,7 @@
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with pygal. If not, see <http://www.gnu.org/licenses/>. # along with pygal. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.9.2' __version__ = '0.9.3'
from collections import namedtuple from collections import namedtuple
from pygal.graph.bar import Bar from pygal.graph.bar import Bar

12
pygal/style.py

@ -67,7 +67,17 @@ NeonStyle = Style(
opacity='.1', opacity='.1',
opacity_hover='.75', opacity_hover='.75',
transition='1s ease-out') 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, styles = {'default': DefaultStyle,
'light': LightStyle, 'light': LightStyle,
'neon': NeonStyle} 'neon': NeonStyle,
'clean': CleanStyle}

Loading…
Cancel
Save