Browse Source

Imports clean

pull/264/head
Florian Mounier 9 years ago
parent
commit
c7aefc3989
  1. 9
      pygal/__init__.py
  2. 3
      pygal/config.py
  3. 3
      pygal/graph/bar.py
  4. 20
      pygal/graph/base.py
  5. 8
      pygal/graph/box.py
  6. 2
      pygal/graph/dual.py
  7. 5
      pygal/graph/funnel.py
  8. 5
      pygal/graph/gauge.py
  9. 17
      pygal/graph/graph.py
  10. 3
      pygal/graph/horizontal.py
  11. 2
      pygal/graph/horizontalbar.py
  12. 8
      pygal/graph/pie.py
  13. 5
      pygal/graph/public.py
  14. 12
      pygal/graph/radar.py
  15. 3
      pygal/graph/stackedline.py
  16. 5
      pygal/graph/time.py
  17. 5
      pygal/graph/treemap.py
  18. 1
      pygal/interpolate.py
  19. 1
      pygal/serie.py
  20. 4
      pygal/style.py
  21. 5
      pygal/table.py
  22. 9
      pygal/util.py
  23. 3
      pygal/view.py

9
pygal/__init__.py

@ -26,6 +26,11 @@ and the maps extensions namespace module.
__version__ = '1.9.9' __version__ = '1.9.9'
import pkg_resources
import sys
import traceback
import warnings
from pygal.graph.bar import Bar from pygal.graph.bar import Bar
from pygal.graph.box import Box from pygal.graph.box import Box
from pygal.graph.dot import Dot from pygal.graph.dot import Dot
@ -46,10 +51,6 @@ from pygal.graph.xy import XY
from pygal.graph.graph import Graph from pygal.graph.graph import Graph
from pygal.config import Config from pygal.config import Config
from pygal import maps from pygal import maps
import pkg_resources
import sys
import traceback
import warnings
CHARTS_BY_NAME = dict( CHARTS_BY_NAME = dict(

3
pygal/config.py

@ -19,8 +19,9 @@
"""Config module holding all options and their default values.""" """Config module holding all options and their default values."""
from copy import deepcopy from copy import deepcopy
from pygal.style import Style, DefaultStyle
from pygal.interpolate import INTERPOLATIONS from pygal.interpolate import INTERPOLATIONS
from pygal.style import DefaultStyle, Style
CONFIG_ITEMS = [] CONFIG_ITEMS = []

3
pygal/graph/bar.py

@ -23,8 +23,9 @@ proportional to the values that they represent.
""" """
from __future__ import division from __future__ import division
from pygal.graph.graph import Graph from pygal.graph.graph import Graph
from pygal.util import swap, ident, decorate, alter from pygal.util import alter, decorate, ident, swap
class Bar(Graph): class Bar(Graph):

20
pygal/graph/base.py

@ -20,19 +20,19 @@
"""Base for pygal charts""" """Base for pygal charts"""
from __future__ import division from __future__ import division
import os
from functools import reduce
from uuid import uuid4
from pygal._compat import is_list_like from pygal._compat import is_list_like
from pygal.view import Margin, Box from pygal.adapters import decimal_to_float, not_zero, positive
from pygal.config import Config from pygal.config import Config, SerieConfig
from pygal.serie import Serie
from pygal.state import State from pygal.state import State
from pygal.util import compose, ident
from pygal.svg import Svg from pygal.svg import Svg
from pygal.serie import Serie from pygal.util import compose, ident
from pygal.config import SerieConfig from pygal.view import Box, Margin
from pygal.adapters import (
not_zero, positive, decimal_to_float)
from functools import reduce
from uuid import uuid4
import os
class BaseGraph(object): class BaseGraph(object):

8
pygal/graph/box.py

@ -23,11 +23,13 @@ Different types are available throught the box_mode option
""" """
from __future__ import division from __future__ import division
from pygal.graph.graph import Graph
from pygal.util import compute_scale, decorate, alter
from pygal._compat import is_list_like
from bisect import bisect_left, bisect_right from bisect import bisect_left, bisect_right
from pygal._compat import is_list_like
from pygal.graph.graph import Graph
from pygal.util import alter, decorate
class Box(Graph): class Box(Graph):

2
pygal/graph/dual.py

@ -19,9 +19,9 @@
"""Dual chart base. Dual means a chart with 2 scaled axis like xy""" """Dual chart base. Dual means a chart with 2 scaled axis like xy"""
from pygal.util import cut, compute_scale
from pygal._compat import is_str from pygal._compat import is_str
from pygal.graph.graph import Graph from pygal.graph.graph import Graph
from pygal.util import compute_scale, cut
class Dual(Graph): class Dual(Graph):

5
pygal/graph/funnel.py

@ -19,9 +19,10 @@
"""Funnel chart: Represent values as a funnel""" """Funnel chart: Represent values as a funnel"""
from __future__ import division from __future__ import division
from pygal.util import decorate, cut, compute_scale, alter
from pygal.adapters import positive, none_to_zero from pygal.adapters import none_to_zero, positive
from pygal.graph.graph import Graph from pygal.graph.graph import Graph
from pygal.util import alter, cut, decorate
class Funnel(Graph): class Funnel(Graph):

5
pygal/graph/gauge.py

@ -20,10 +20,11 @@
"""Gauge chart representing values as needles on a polar scale""" """Gauge chart representing values as needles on a polar scale"""
from __future__ import division from __future__ import division
from pygal._compat import is_str from pygal._compat import is_str
from pygal.util import decorate, compute_scale, alter, cut
from pygal.view import PolarThetaView, PolarThetaLogView
from pygal.graph.graph import Graph from pygal.graph.graph import Graph
from pygal.util import alter, compute_scale, cut, decorate
from pygal.view import PolarThetaLogView, PolarThetaView
class Gauge(Graph): class Gauge(Graph):

17
pygal/graph/graph.py

@ -19,16 +19,19 @@
"""Chart properties and drawing""" """Chart properties and drawing"""
from __future__ import division from __future__ import division
from itertools import chain, repeat
from math import ceil, cos, sin, sqrt
from pygal._compat import is_list_like, is_str from pygal._compat import is_list_like, is_str
from pygal.interpolate import INTERPOLATIONS
from pygal.graph.public import PublicApi from pygal.graph.public import PublicApi
from pygal.view import View, LogView, XYLogView, ReverseView from pygal.interpolate import INTERPOLATIONS
from pygal.util import ( from pygal.util import (
cached_property, majorize, humanize, split_title, compute_scale, cached_property, compute_scale, cut, decorate,
truncate, reverse_text_len, get_text_box, get_texts_box, cut, rad, get_text_box, get_texts_box, humanize, majorize, rad, reverse_text_len,
decorate) split_title, truncate)
from math import sqrt, ceil, cos, sin from pygal.view import LogView, ReverseView, View, XYLogView
from itertools import repeat, chain
class Graph(PublicApi): class Graph(PublicApi):

3
pygal/graph/horizontal.py

@ -17,8 +17,9 @@
# 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/>.
"""Horizontal graph mixin""" """Horizontal graph mixin"""
from pygal.graph.graph import Graph from pygal.graph.graph import Graph
from pygal.view import HorizontalView, HorizontalLogView from pygal.view import HorizontalLogView, HorizontalView
class HorizontalGraph(Graph): class HorizontalGraph(Graph):

2
pygal/graph/horizontalbar.py

@ -19,8 +19,8 @@
"""Horizontal bar graph""" """Horizontal bar graph"""
from pygal.graph.horizontal import HorizontalGraph
from pygal.graph.bar import Bar from pygal.graph.bar import Bar
from pygal.graph.horizontal import HorizontalGraph
class HorizontalBar(HorizontalGraph, Bar): class HorizontalBar(HorizontalGraph, Bar):

8
pygal/graph/pie.py

@ -22,11 +22,13 @@ It can be made as a donut or a half pie.
""" """
from __future__ import division from __future__ import division
from pygal.util import decorate, alter
from pygal.graph.graph import Graph
from pygal.adapters import positive, none_to_zero
from math import pi from math import pi
from pygal.adapters import none_to_zero, positive
from pygal.graph.graph import Graph
from pygal.util import alter, decorate
class Pie(Graph): class Pie(Graph):

5
pygal/graph/public.py

@ -18,10 +18,11 @@
# along with pygal. If not, see <http://www.gnu.org/licenses/>. # along with pygal. If not, see <http://www.gnu.org/licenses/>.
"""pygal public api functions""" """pygal public api functions"""
import base64
import io import io
from pygal._compat import u, is_list_like
from pygal._compat import is_list_like, u
from pygal.graph.base import BaseGraph from pygal.graph.base import BaseGraph
import base64
class PublicApi(BaseGraph): class PublicApi(BaseGraph):

12
pygal/graph/radar.py

@ -23,13 +23,15 @@ useful for multivariate observation.
""" """
from __future__ import division from __future__ import division
from pygal.graph.line import Line
from pygal.adapters import positive, none_to_zero
from pygal.view import PolarView, PolarLogView
from pygal.util import deg, cached_property, compute_scale, majorize, cut
from pygal._compat import is_str
from math import cos, pi 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, majorize
from pygal.view import PolarLogView, PolarView
class Radar(Line): class Radar(Line):

3
pygal/graph/stackedline.py

@ -23,8 +23,9 @@ on top of the others. Used along fill=True option.
""" """
from __future__ import division from __future__ import division
from pygal.graph.line import Line
from pygal.adapters import none_to_zero from pygal.adapters import none_to_zero
from pygal.graph.line import Line
class StackedLine(Line): class StackedLine(Line):

5
pygal/graph/time.py

@ -22,10 +22,11 @@ XY time extensions: handle convertion of date, time, datetime, timedelta
into float for xy plot and back to their type for display into float for xy plot and back to their type for display
""" """
from datetime import date, datetime, time, timedelta
from pygal._compat import is_str, timestamp, total_seconds
from pygal.adapters import positive from pygal.adapters import positive
from pygal.graph.xy import XY from pygal.graph.xy import XY
from datetime import datetime, date, time, timedelta
from pygal._compat import timestamp, total_seconds, is_str
def datetime_to_timestamp(x): def datetime_to_timestamp(x):

5
pygal/graph/treemap.py

@ -20,9 +20,10 @@
"""Treemap chart: Visualize data using nested recangles""" """Treemap chart: Visualize data using nested recangles"""
from __future__ import division from __future__ import division
from pygal.util import decorate, cut, alter
from pygal.adapters import none_to_zero, positive
from pygal.graph.graph import Graph from pygal.graph.graph import Graph
from pygal.adapters import positive, none_to_zero from pygal.util import alter, cut, decorate
class Treemap(Graph): class Treemap(Graph):

1
pygal/interpolate.py

@ -25,6 +25,7 @@ with `precision` interpolated points between each of them
""" """
from __future__ import division from __future__ import division
from math import sin from math import sin

1
pygal/serie.py

@ -17,6 +17,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/>.
"""Serie property holder""" """Serie property holder"""
from pygal.util import cached_property from pygal.util import cached_property

4
pygal/style.py

@ -19,9 +19,11 @@
"""Charts styling classes""" """Charts styling classes"""
from __future__ import division from __future__ import division
from itertools import chain from itertools import chain
from pygal import colors from pygal import colors
from pygal.colors import darken, lighten, is_foreground_light from pygal.colors import darken, is_foreground_light, lighten
class Style(object): class Style(object):

5
pygal/table.py

@ -22,9 +22,10 @@ HTML Table maker.
This class is used to render an html table from a chart data. This class is used to render an html table from a chart data.
""" """
from pygal.util import template
from lxml.html import builder, tostring
import uuid import uuid
from lxml.html import builder, tostring
from pygal.util import template
class HTML(object): class HTML(object):

9
pygal/util.py

@ -20,10 +20,15 @@
"""Various utility functions""" """Various utility functions"""
from __future__ import division from __future__ import division
from pygal._compat import u, is_list_like, to_unicode
import re import re
from decimal import Decimal from decimal import Decimal
from math import floor, pi, log, log10, ceil
from math import ceil, floor, log, log10, pi
from pygal._compat import is_list_like, to_unicode, u
ORDERS = u("yzafpnµm kMGTPEZY") ORDERS = u("yzafpnµm kMGTPEZY")

3
pygal/view.py

@ -20,7 +20,8 @@
"""Projection and bounding helpers""" """Projection and bounding helpers"""
from __future__ import division from __future__ import division
from math import sin, cos, log10, pi
from math import cos, log10, pi, sin
class Margin(object): class Margin(object):

Loading…
Cancel
Save