Skip to content

Commit

Permalink
Sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Jun 2, 2017
1 parent 5976d1a commit 2891cfe
Show file tree
Hide file tree
Showing 33 changed files with 93 additions and 84 deletions.
4 changes: 3 additions & 1 deletion demo/cabaret.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion demo/moulinrouge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 11 additions & 11 deletions demo/moulinrouge/tests.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,13 +28,6 @@
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):
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions docs/ext/pygal_sphinx_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 5 additions & 6 deletions perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions pygal/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pygal/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions pygal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions pygal/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
"""
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


Expand Down
7 changes: 3 additions & 4 deletions pygal/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@

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


Expand Down
2 changes: 1 addition & 1 deletion pygal/graph/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

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


Expand Down
2 changes: 1 addition & 1 deletion pygal/graph/horizontalline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion pygal/graph/horizontalstackedline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion pygal/graph/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions pygal/graph/radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,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)
from pygal.util import cached_property, compute_scale, cut, deg, truncate
from pygal.view import PolarLogView, PolarView


Expand Down
1 change: 0 additions & 1 deletion pygal/graph/solidgauge.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"""
from __future__ import division


from math import pi, sqrt

from pygal.graph.graph import Graph
Expand Down
2 changes: 1 addition & 1 deletion pygal/stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from math import log, sqrt, pi
from math import log, pi, sqrt


def erfinv(x, a=.147):
Expand Down
16 changes: 9 additions & 7 deletions pygal/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions pygal/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""

import uuid

from lxml.html import builder, tostring

from pygal.util import template
Expand Down
5 changes: 4 additions & 1 deletion pygal/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@

"""pytest fixtures"""

import sys

import pytest

import pygal
from pygal.etree import etree
import sys

from . import get_data


Expand Down
4 changes: 2 additions & 2 deletions pygal/test/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
21 changes: 9 additions & 12 deletions pygal/test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
5 changes: 3 additions & 2 deletions pygal/test/test_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
12 changes: 7 additions & 5 deletions pygal/test/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion pygal/test/test_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
1 change: 0 additions & 1 deletion pygal/test/test_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion pygal/test/test_serie_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from pygal import Line


s1 = [1, 3, 12, 3, 4]
s2 = [7, -4, 10, None, 8, 3, 1]

Expand Down
Loading

0 comments on commit 2891cfe

Please sign in to comment.