Browse Source

Fix travis flake8. Fix flake8 bugs

pull/264/head
Florian Mounier 9 years ago
parent
commit
6ab838e22a
  1. 2
      .travis.yml
  2. 11
      pygal/graph/graph.py
  3. 3
      pygal/graph/radar.py
  4. 3
      pygal/style.py
  5. 5
      pygal/svg.py
  6. 3
      pygal/test/test_date.py
  7. 2
      setup.cfg

2
.travis.yml

@ -20,7 +20,7 @@ install:
- pip install cairosvg
- pip install coveralls
script: py.test pygal/test --flake8 --cov-report= --cov=pygal
script: py.test pygal/ --flake8 --cov-report= --cov=pygal
after_success: coveralls

11
pygal/graph/graph.py

@ -355,7 +355,8 @@ class Graph(PublicApi):
x=col * x_step,
y=1.5 * row * h + (
self.style.legend_font_size - self.legend_box_size
if self.style.legend_font_size > self.legend_box_size else 0
if self.style.legend_font_size > self.legend_box_size
else 0
) / 2,
width=self.legend_box_size,
height=self.legend_box_size,
@ -789,9 +790,9 @@ class Graph(PublicApi):
def _has_data(self):
"""Check if there is any data"""
return any([
len([v for a in (
s[1] if is_list_like(s) else [s])
for v in (a if is_list_like(a) else [a])
if v is not None])
len([
v for a in (s[1] if is_list_like(s) else [s])
for v in (a if is_list_like(a) else [a])
if v is not None])
for s in self.raw_series
])

3
pygal/graph/radar.py

@ -30,8 +30,7 @@ from pygal._compat import is_str
from pygal.adapters import none_to_zero, positive
from pygal.graph.line import Line
from pygal.util import (
cached_property, compute_scale, cut, deg, truncate,
reverse_text_len)
cached_property, compute_scale, cut, deg, truncate)
from pygal.view import PolarLogView, PolarView

3
pygal/style.py

@ -104,7 +104,8 @@ class Style(object):
setattr(self, name, self.font_family)
elif fn.startswith('googlefont:'):
setattr(self, name, fn.replace('googlefont:', ''))
self._google_fonts.add(getattr(self, name).split(',')[0].strip())
self._google_fonts.add(
getattr(self, name).split(',')[0].strip())
def get_colors(self, prefix, len_):
"""Get the css color list"""

5
pygal/svg.py

@ -333,8 +333,9 @@ class Svg(object):
"""Return a css style for the given option"""
css = ['%s.series%s {\n' % (
self.id, '.serie-%d' % i if i is not None else '')]
for key in ('width', 'linejoin', 'linecap',
'dasharray', 'dashoffset'):
for key in (
'width', 'linejoin', 'linecap',
'dasharray', 'dashoffset'):
if stroke.get(key):
css.append(' stroke-%s: %s;\n' % (
key, stroke[key]))

3
pygal/test/test_date.py

@ -157,5 +157,4 @@ def test_date_labels():
q(".axis.x text").map(texts))) == [
'2013-01-01',
'2013-02-01',
'2013-03-01'
]
'2013-03-01']

2
setup.cfg

@ -1,5 +1,5 @@
[pytest]
flake8-ignore =
pygal/__init__.py F401
pygal/_compat.py F821
pygal/_compat.py F821 F401
docs/conf.py ALL

Loading…
Cancel
Save