Browse Source

Sort imports

pull/298/merge
Florian Mounier 8 years ago
parent
commit
2891cfe2a3
  1. 4
      demo/cabaret.py
  2. 4
      demo/moulinrouge.py
  3. 22
      demo/moulinrouge/tests.py
  4. 3
      docs/conf.py
  5. 5
      docs/ext/pygal_sphinx_directives.py
  6. 11
      perf.py
  7. 3
      pygal/_compat.py
  8. 1
      pygal/adapters.py
  9. 3
      pygal/config.py
  10. 5
      pygal/formatters.py
  11. 7
      pygal/graph/graph.py
  12. 2
      pygal/graph/histogram.py
  13. 2
      pygal/graph/horizontalline.py
  14. 2
      pygal/graph/horizontalstackedline.py
  15. 2
      pygal/graph/public.py
  16. 3
      pygal/graph/radar.py
  17. 1
      pygal/graph/solidgauge.py
  18. 2
      pygal/stats.py
  19. 16
      pygal/svg.py
  20. 1
      pygal/table.py
  21. 5
      pygal/test/conftest.py
  22. 4
      pygal/test/test_colors.py
  23. 21
      pygal/test/test_config.py
  24. 5
      pygal/test/test_date.py
  25. 12
      pygal/test/test_graph.py
  26. 4
      pygal/test/test_line.py
  27. 1
      pygal/test/test_maps.py
  28. 1
      pygal/test/test_serie_config.py
  29. 2
      pygal/test/test_sparktext.py
  30. 5
      pygal/test/test_style.py
  31. 12
      pygal/test/test_util.py
  32. 5
      pygal/util.py
  33. 1
      pygal_gen.py

4
demo/cabaret.py

@ -17,8 +17,10 @@
# #
# 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 cabaret import create_app
import logging import logging
from cabaret import create_app
app = create_app() app = create_app()
try: try:

4
demo/moulinrouge.py

@ -17,8 +17,10 @@
# #
# 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 moulinrouge import create_app
import logging import logging
from moulinrouge import create_app
app = create_app() app = create_app()
try: try:

22
demo/moulinrouge/tests.py

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# This file is part of pygal # This file is part of pygal
from datetime import date, datetime
from random import choice, randint
from flask import abort
from pygal import ( from pygal import (
Bar, Gauge, Pyramid, Funnel, Dot, StackedBar, StackedLine, XY, CHARTS_BY_NAME, XY, Bar, Box, Config, DateLine, DateTimeLine, Dot, Funnel,
CHARTS_BY_NAME, Config, Line, Histogram, Box, Gauge, Histogram, HorizontalBar, Line, Pie, Pyramid, Radar, SolidGauge,
Pie, Treemap, TimeLine, DateLine, Radar, HorizontalBar, StackedBar, StackedLine, TimeLine, Treemap, formatters, stats)
DateTimeLine, SolidGauge) from pygal.colors import rotate
from pygal.graph.horizontal import HorizontalGraph
from pygal.style import RotateStyle, Style, styles
try: try:
from pygal.maps import world from pygal.maps import world
@ -21,13 +28,6 @@ try:
except ImportError: except ImportError:
ch = None ch = None
from flask import abort
from pygal.style import styles, Style, RotateStyle
from pygal.colors import rotate
from pygal import stats, formatters
from pygal.graph.horizontal import HorizontalGraph
from random import randint, choice
from datetime import datetime, date
def get_test_routes(app): def get_test_routes(app):

3
docs/conf.py

@ -13,8 +13,9 @@
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # serve to show the default.
import sys
import os import os
import sys
# import shlex # import shlex
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,

5
docs/ext/pygal_sphinx_directives.py

@ -18,12 +18,13 @@
# along with pygal. If not, see <http://www.gnu.org/licenses/>. # along with pygal. If not, see <http://www.gnu.org/licenses/>.
from docutils.parsers.rst import Directive
from traceback import format_exc, print_exc from traceback import format_exc, print_exc
from sphinx.directives.code import CodeBlock
import docutils.core import docutils.core
from docutils.parsers.rst import Directive
import pygal import pygal
from sphinx.directives.code import CodeBlock
# Patch default style # Patch default style

11
perf.py

@ -18,14 +18,13 @@
# along with pygal. If not, see <http://www.gnu.org/licenses/>. # along with pygal. If not, see <http://www.gnu.org/licenses/>.
from pygal import CHARTS, CHARTS_BY_NAME
from pygal.test import adapt
from pygal.etree import etree
from random import sample
import timeit
import sys import sys
import timeit
from random import sample
from pygal import CHARTS, CHARTS_BY_NAME
from pygal.etree import etree
from pygal.test import adapt
sizes = (1, 5, 10, 50, 100, 500, 1000) sizes = (1, 5, 10, 50, 100, 500, 1000)

3
pygal/_compat.py

@ -16,14 +16,13 @@
# #
# 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 __future__ import division
"""Various hacks for transparent python 2 / python 3 support""" """Various hacks for transparent python 2 / python 3 support"""
from __future__ import division
import sys import sys
from collections import Iterable from collections import Iterable
from datetime import datetime, timedelta, tzinfo from datetime import datetime, timedelta, tzinfo
if sys.version_info[0] == 3: if sys.version_info[0] == 3:
base = (str, bytes) base = (str, bytes)
coerce = str coerce = str

1
pygal/adapters.py

@ -18,6 +18,7 @@
# along with pygal. If not, see <http://www.gnu.org/licenses/>. # along with pygal. If not, see <http://www.gnu.org/licenses/>.
"""Value adapters to use when a chart doesn't accept all value types""" """Value adapters to use when a chart doesn't accept all value types"""
from decimal import Decimal from decimal import Decimal
from pygal._compat import is_str from pygal._compat import is_str

3
pygal/config.py

@ -20,10 +20,9 @@
from copy import deepcopy from copy import deepcopy
from pygal import formatters
from pygal.interpolate import INTERPOLATIONS from pygal.interpolate import INTERPOLATIONS
from pygal.style import DefaultStyle, Style from pygal.style import DefaultStyle, Style
from pygal import formatters
CONFIG_ITEMS = [] CONFIG_ITEMS = []
callable = type(lambda: 1) callable = type(lambda: 1)

5
pygal/formatters.py

@ -22,9 +22,10 @@ Formatters to use with `value_formatter` and `x_value_formatter` configs
""" """
from __future__ import division from __future__ import division
from datetime import datetime, date, time from datetime import date, datetime, time
from math import floor, log from math import floor, log
from pygal._compat import u, to_str
from pygal._compat import to_str, u
from pygal.util import float_format from pygal.util import float_format

7
pygal/graph/graph.py

@ -22,14 +22,13 @@ from __future__ import division
from math import ceil, cos, sin, sqrt from math import ceil, cos, sin, sqrt
from pygal import stats
from pygal._compat import is_list_like, is_str, to_str from pygal._compat import is_list_like, is_str, to_str
from pygal.graph.public import PublicApi from pygal.graph.public import PublicApi
from pygal.interpolate import INTERPOLATIONS from pygal.interpolate import INTERPOLATIONS
from pygal import stats
from pygal.util import ( from pygal.util import (
cached_property, compute_scale, cut, decorate, cached_property, compute_scale, cut, decorate, filter_kwargs, get_text_box,
get_text_box, get_texts_box, majorize, rad, reverse_text_len, get_texts_box, majorize, rad, reverse_text_len, split_title, truncate)
split_title, truncate, filter_kwargs)
from pygal.view import LogView, ReverseView, View, XYLogView from pygal.view import LogView, ReverseView, View, XYLogView

2
pygal/graph/histogram.py

@ -23,8 +23,8 @@ as bars of varying width.
from __future__ import division from __future__ import division
from pygal.graph.dual import Dual
from pygal.graph.bar import Bar from pygal.graph.bar import Bar
from pygal.graph.dual import Dual
from pygal.util import alter, cached_property, decorate from pygal.util import alter, cached_property, decorate

2
pygal/graph/horizontalline.py

@ -19,8 +19,8 @@
"""Horizontal line graph""" """Horizontal line graph"""
from pygal.graph.line import Line
from pygal.graph.horizontal import HorizontalGraph from pygal.graph.horizontal import HorizontalGraph
from pygal.graph.line import Line
class HorizontalLine(HorizontalGraph, Line): class HorizontalLine(HorizontalGraph, Line):

2
pygal/graph/horizontalstackedline.py

@ -19,8 +19,8 @@
"""Horizontal Stacked Line graph""" """Horizontal Stacked Line graph"""
from pygal.graph.stackedline import StackedLine
from pygal.graph.horizontal import HorizontalGraph from pygal.graph.horizontal import HorizontalGraph
from pygal.graph.stackedline import StackedLine
class HorizontalStackedLine(HorizontalGraph, StackedLine): class HorizontalStackedLine(HorizontalGraph, StackedLine):

2
pygal/graph/public.py

@ -21,7 +21,7 @@
import base64 import base64
import io import io
from pygal._compat import is_list_like, u, _ellipsis from pygal._compat import _ellipsis, is_list_like, u
from pygal.graph.base import BaseGraph from pygal.graph.base import BaseGraph

3
pygal/graph/radar.py

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

1
pygal/graph/solidgauge.py

@ -24,7 +24,6 @@ For each series a solid guage is shown on the plot area.
""" """
from __future__ import division from __future__ import division
from math import pi, sqrt from math import pi, sqrt
from pygal.graph.graph import Graph from pygal.graph.graph import Graph

2
pygal/stats.py

@ -1,4 +1,4 @@
from math import log, sqrt, pi from math import log, pi, sqrt
def erfinv(x, a=.147): def erfinv(x, a=.147):

16
pygal/svg.py

@ -19,18 +19,20 @@
"""Svg helper""" """Svg helper"""
from __future__ import division from __future__ import division
from pygal._compat import to_str, u, quote_plus
from pygal.etree import etree
import io import io
import os
import json import json
import os
from datetime import date, datetime from datetime import date, datetime
from numbers import Number
from math import pi from math import pi
from pygal.util import ( from numbers import Number
template, minify_css,
coord_project, coord_diff, coord_format, coord_dual, coord_abs_project)
from pygal import __version__ from pygal import __version__
from pygal._compat import quote_plus, to_str, u
from pygal.etree import etree
from pygal.util import (
coord_abs_project, coord_diff, coord_dual, coord_format, coord_project,
minify_css, template)
nearly_2pi = 2 * pi - .00001 nearly_2pi = 2 * pi - .00001

1
pygal/table.py

@ -23,6 +23,7 @@ This class is used to render an html table from a chart data.
""" """
import uuid import uuid
from lxml.html import builder, tostring from lxml.html import builder, tostring
from pygal.util import template from pygal.util import template

5
pygal/test/conftest.py

@ -19,10 +19,13 @@
"""pytest fixtures""" """pytest fixtures"""
import sys
import pytest import pytest
import pygal import pygal
from pygal.etree import etree from pygal.etree import etree
import sys
from . import get_data from . import get_data

4
pygal/test/test_colors.py

@ -22,8 +22,8 @@
from __future__ import division from __future__ import division
from pygal.colors import ( from pygal.colors import (
parse_color, unparse_color, darken, desaturate, hsl_to_rgb, lighten, parse_color, rgb_to_hsl, rotate,
rgb_to_hsl, hsl_to_rgb, darken, lighten, saturate, desaturate, rotate) saturate, unparse_color)
def test_parse_color(): def test_parse_color():

21
pygal/test/test_config.py

@ -19,21 +19,18 @@
"""Various config options tested on one chart type or more""" """Various config options tested on one chart type or more"""
from tempfile import NamedTemporaryFile
from pygal import ( from pygal import (
Line, Dot, Pie, Treemap, Radar, Config, Bar, Funnel, XY, Bar, Box, Config, DateLine, DateTimeLine, Dot, Funnel, Gauge,
Histogram, Gauge, Box, XY, Histogram, HorizontalBar, HorizontalLine, HorizontalStackedBar,
Pyramid, HorizontalBar, HorizontalStackedBar, HorizontalStackedLine, Line, Pie, Pyramid, Radar, SolidGauge,
HorizontalStackedLine, HorizontalLine, TimeDeltaLine, TimeLine, Treemap, formatters)
DateTimeLine, TimeLine, DateLine, TimeDeltaLine, from pygal._compat import _ellipsis, u
SolidGauge
)
from pygal.graph.map import BaseMap
from pygal.graph.horizontal import HorizontalGraph
from pygal.graph.dual import Dual from pygal.graph.dual import Dual
from pygal import formatters from pygal.graph.horizontal import HorizontalGraph
from pygal._compat import u, _ellipsis from pygal.graph.map import BaseMap
from pygal.test.utils import texts from pygal.test.utils import texts
from tempfile import NamedTemporaryFile
def test_config_behaviours(): def test_config_behaviours():

5
pygal/test/test_date.py

@ -19,10 +19,11 @@
"""Date related charts tests""" """Date related charts tests"""
from pygal import DateLine, TimeLine, DateTimeLine, TimeDeltaLine from datetime import date, datetime, time, timedelta
from pygal import DateLine, DateTimeLine, TimeDeltaLine, TimeLine
from pygal._compat import timestamp, utc from pygal._compat import timestamp, utc
from pygal.test.utils import texts from pygal.test.utils import texts
from datetime import datetime, date, time, timedelta
def test_date(): def test_date():

12
pygal/test/test_graph.py

@ -19,16 +19,18 @@
"""Generate tests for different chart types with different data""" """Generate tests for different chart types with different data"""
import io
import os import os
import pygal
import uuid
import sys import sys
import uuid
import pytest import pytest
import io
from pygal.graph.map import BaseMap import pygal
from pygal.util import cut
from pygal._compat import u from pygal._compat import u
from pygal.graph.map import BaseMap
from pygal.test import make_data from pygal.test import make_data
from pygal.util import cut
try: try:
import cairosvg import cairosvg

4
pygal/test/test_line.py

@ -20,9 +20,11 @@
"""Line chart related tests""" """Line chart related tests"""
from __future__ import division from __future__ import division
from math import cos, sin
from pygal import Line from pygal import Line
from pygal.test.utils import texts from pygal.test.utils import texts
from math import cos, sin
def test_simple_line(): def test_simple_line():

1
pygal/test/test_maps.py

@ -21,7 +21,6 @@
import pkg_resources import pkg_resources
# Load plugins tests # Load plugins tests
for entry in pkg_resources.iter_entry_points('pygal.test.test_maps'): for entry in pkg_resources.iter_entry_points('pygal.test.test_maps'):
module = entry.load() module = entry.load()

1
pygal/test/test_serie_config.py

@ -21,7 +21,6 @@
from pygal import Line from pygal import Line
s1 = [1, 3, 12, 3, 4] s1 = [1, 3, 12, 3, 4]
s2 = [7, -4, 10, None, 8, 3, 1] s2 = [7, -4, 10, None, 8, 3, 1]

2
pygal/test/test_sparktext.py

@ -19,7 +19,7 @@
"""Test sparktext rendering""" """Test sparktext rendering"""
from pygal import Line, Bar from pygal import Bar, Line
from pygal._compat import u from pygal._compat import u

5
pygal/test/test_style.py

@ -21,9 +21,8 @@
from pygal import Line from pygal import Line
from pygal.style import ( from pygal.style import (
LightStyle, DarkenStyle, DesaturateStyle, LightenStyle, LightStyle, RotateStyle,
LightenStyle, DarkenStyle, SaturateStyle, DesaturateStyle, RotateStyle SaturateStyle)
)
STYLES = LightenStyle, DarkenStyle, SaturateStyle, DesaturateStyle, RotateStyle STYLES = LightenStyle, DarkenStyle, SaturateStyle, DesaturateStyle, RotateStyle

12
pygal/test/test_util.py

@ -19,13 +19,15 @@
"""Utility functions tests""" """Utility functions tests"""
from pygal._compat import u, _ellipsis
from pygal.util import (
round_to_int, round_to_float, _swap_curly, template,
truncate, minify_css, majorize, mergextend)
from pytest import raises
import sys import sys
from pytest import raises
from pygal._compat import _ellipsis, u
from pygal.util import (
_swap_curly, majorize, mergextend, minify_css, round_to_float,
round_to_int, template, truncate)
def test_round_to_int(): def test_round_to_int():
"""Test round to int function""" """Test round to int function"""

5
pygal/util.py

@ -23,10 +23,9 @@ from __future__ import division
import re import re
from decimal import Decimal from decimal import Decimal
from math import ceil, cos, floor, log10, pi, sin
from math import ceil, floor, log10, pi, cos, sin from pygal._compat import _ellipsis, to_unicode, u
from pygal._compat import to_unicode, u, _ellipsis
def float_format(number): def float_format(number):

1
pygal_gen.py

@ -18,6 +18,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/>.
import argparse import argparse
import pygal import pygal
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(

Loading…
Cancel
Save