Browse Source

Sort imports

pull/298/merge
Florian Mounier 7 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
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
from cabaret import create_app
import logging
from cabaret import create_app
app = create_app()
try:

4
demo/moulinrouge.py

@ -17,8 +17,10 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
from moulinrouge import create_app
import logging
from moulinrouge import create_app
app = create_app()
try:

22
demo/moulinrouge/tests.py

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

3
docs/conf.py

@ -13,8 +13,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import sys
# import shlex
# 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/>.
from docutils.parsers.rst import Directive
from traceback import format_exc, print_exc
from sphinx.directives.code import CodeBlock
import docutils.core
from docutils.parsers.rst import Directive
import pygal
from sphinx.directives.code import CodeBlock
# Patch default style

11
perf.py

@ -18,14 +18,13 @@
# 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 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)

3
pygal/_compat.py

@ -16,14 +16,13 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
from __future__ import division
"""Various hacks for transparent python 2 / python 3 support"""
from __future__ import division
import sys
from collections import Iterable
from datetime import datetime, timedelta, tzinfo
if sys.version_info[0] == 3:
base = (str, bytes)
coerce = str

1
pygal/adapters.py

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

3
pygal/config.py

@ -20,10 +20,9 @@
from copy import deepcopy
from pygal import formatters
from pygal.interpolate import INTERPOLATIONS
from pygal.style import DefaultStyle, Style
from pygal import formatters
CONFIG_ITEMS = []
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 datetime import datetime, date, time
from datetime import date, datetime, time
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

7
pygal/graph/graph.py

@ -22,14 +22,13 @@ from __future__ import division
from math import ceil, cos, sin, sqrt
from pygal import stats
from pygal._compat import is_list_like, is_str, to_str
from pygal.graph.public import PublicApi
from pygal.interpolate import INTERPOLATIONS
from pygal import stats
from pygal.util import (
cached_property, compute_scale, cut, decorate,
get_text_box, get_texts_box, majorize, rad, reverse_text_len,
split_title, truncate, filter_kwargs)
cached_property, compute_scale, cut, decorate, filter_kwargs, get_text_box,
get_texts_box, majorize, rad, reverse_text_len, split_title, truncate)
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 pygal.graph.dual import Dual
from pygal.graph.bar import Bar
from pygal.graph.dual import Dual
from pygal.util import alter, cached_property, decorate

2
pygal/graph/horizontalline.py

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

2
pygal/graph/horizontalstackedline.py

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

2
pygal/graph/public.py

@ -21,7 +21,7 @@
import base64
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

3
pygal/graph/radar.py

@ -29,8 +29,7 @@ from math import cos, pi
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)
from pygal.util import cached_property, compute_scale, cut, deg, truncate
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 math import pi, sqrt
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):

16
pygal/svg.py

@ -19,18 +19,20 @@
"""Svg helper"""
from __future__ import division
from pygal._compat import to_str, u, quote_plus
from pygal.etree import etree
import io
import os
import json
import os
from datetime import date, datetime
from numbers import Number
from math import pi
from pygal.util import (
template, minify_css,
coord_project, coord_diff, coord_format, coord_dual, coord_abs_project)
from numbers import Number
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

1
pygal/table.py

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

5
pygal/test/conftest.py

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

4
pygal/test/test_colors.py

@ -22,8 +22,8 @@
from __future__ import division
from pygal.colors import (
parse_color, unparse_color,
rgb_to_hsl, hsl_to_rgb, darken, lighten, saturate, desaturate, rotate)
darken, desaturate, hsl_to_rgb, lighten, parse_color, rgb_to_hsl, rotate,
saturate, unparse_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"""
from tempfile import NamedTemporaryFile
from pygal import (
Line, Dot, Pie, Treemap, Radar, Config, Bar, Funnel,
Histogram, Gauge, Box, XY,
Pyramid, HorizontalBar, HorizontalStackedBar,
HorizontalStackedLine, HorizontalLine,
DateTimeLine, TimeLine, DateLine, TimeDeltaLine,
SolidGauge
)
from pygal.graph.map import BaseMap
from pygal.graph.horizontal import HorizontalGraph
XY, Bar, Box, Config, DateLine, DateTimeLine, Dot, Funnel, Gauge,
Histogram, HorizontalBar, HorizontalLine, HorizontalStackedBar,
HorizontalStackedLine, Line, Pie, Pyramid, Radar, SolidGauge,
TimeDeltaLine, TimeLine, Treemap, formatters)
from pygal._compat import _ellipsis, u
from pygal.graph.dual import Dual
from pygal import formatters
from pygal._compat import u, _ellipsis
from pygal.graph.horizontal import HorizontalGraph
from pygal.graph.map import BaseMap
from pygal.test.utils import texts
from tempfile import NamedTemporaryFile
def test_config_behaviours():

5
pygal/test/test_date.py

@ -19,10 +19,11 @@
"""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.test.utils import texts
from datetime import datetime, date, time, timedelta
def test_date():

12
pygal/test/test_graph.py

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

4
pygal/test/test_line.py

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

1
pygal/test/test_maps.py

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

1
pygal/test/test_serie_config.py

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

2
pygal/test/test_sparktext.py

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

5
pygal/test/test_style.py

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

12
pygal/test/test_util.py

@ -19,13 +19,15 @@
"""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
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():
"""Test round to int function"""

5
pygal/util.py

@ -23,10 +23,9 @@ from __future__ import division
import re
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 to_unicode, u, _ellipsis
from pygal._compat import _ellipsis, to_unicode, u
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
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
import argparse
import pygal
parser = argparse.ArgumentParser(

Loading…
Cancel
Save