From 6ab838e22a6275a239aae1d30e76e4731dfc4698 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Thu, 27 Aug 2015 11:41:44 +0200 Subject: [PATCH] Fix travis flake8. Fix flake8 bugs --- .travis.yml | 2 +- pygal/graph/graph.py | 11 ++++++----- pygal/graph/radar.py | 3 +-- pygal/style.py | 3 ++- pygal/svg.py | 5 +++-- pygal/test/test_date.py | 3 +-- setup.cfg | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 51c4f57..6d8f6b7 100644 --- a/.travis.yml +++ b/.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 diff --git a/pygal/graph/graph.py b/pygal/graph/graph.py index 6548908..12eddf8 100644 --- a/pygal/graph/graph.py +++ b/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 ]) diff --git a/pygal/graph/radar.py b/pygal/graph/radar.py index a5db4f8..a43fc0f 100644 --- a/pygal/graph/radar.py +++ b/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 diff --git a/pygal/style.py b/pygal/style.py index 1fbfcc8..6eb4a86 100644 --- a/pygal/style.py +++ b/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""" diff --git a/pygal/svg.py b/pygal/svg.py index 69fe5a8..0f72b0a 100644 --- a/pygal/svg.py +++ b/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])) diff --git a/pygal/test/test_date.py b/pygal/test/test_date.py index 495e3d0..d1a4858 100644 --- a/pygal/test/test_date.py +++ b/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'] diff --git a/setup.cfg b/setup.cfg index 7ce5bf0..550ed34 100644 --- a/setup.cfg +++ b/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