Order imports as suggested by PEP 8

This commit is contained in:
Eduard Braun 2016-09-15 21:56:36 +02:00
parent 99363c9089
commit d9198d7872
5 changed files with 24 additions and 23 deletions

View file

@ -44,31 +44,30 @@
# - parse transform attribute
# - if a <g> has only one element in it, collapse the <g> (ensure transform, etc are carried down)
# necessary to get true division
from __future__ import division
# Needed for Python 2/3 compatible print function.
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division # use "true" division instead of integer division in Python 2 (see PEP 238)
from __future__ import print_function # use print() as a function in Python 2 (see PEP 3105)
from __future__ import absolute_import # use absolute imports by default in Python 2 (see PEP 328)
import os
import sys
import xml.dom.minidom
import re
import math
import time
from collections import namedtuple
from scour.svg_regex import svg_parser
from scour.svg_transform import svg_transform_parser
import optparse
from scour.yocto_css import parseCssString
import six
from six.moves import range
import os
import re
import sys
import time
import xml.dom.minidom
from collections import namedtuple
from decimal import Context, Decimal, InvalidOperation, getcontext
import six
from six.moves import range
from scour.svg_regex import svg_parser
from scour.svg_transform import svg_transform_parser
from scour.yocto_css import parseCssString
from scour import __version__
APP = u'scour'
VER = __version__
COPYRIGHT = u'Copyright Jeff Schiller, Louis Simard, 2010'

View file

@ -47,6 +47,7 @@ import re
from decimal import Decimal, getcontext
from functools import partial
# Sentinel.

View file

@ -60,9 +60,10 @@ from __future__ import absolute_import
import re
from decimal import Decimal
from six.moves import range
from functools import partial
from six.moves import range
# Sentinel.
class _EOF(object):

View file

@ -18,7 +18,8 @@
import os
import re
from setuptools import setup, find_packages
from setuptools import find_packages, setup
LONGDESC = """
Scour is a SVG optimizer/sanitizer that can be used to produce SVGs for Web deployment.

View file

@ -22,24 +22,23 @@
from __future__ import absolute_import
import unittest
import six
from six.moves import map, range
import unittest
from scour.scour import makeWellFormed, parse_args, scourString, scourXmlFile
from scour.svg_regex import svg_parser
from scour.scour import scourXmlFile, scourString, parse_args, makeWellFormed
SVGNS = 'http://www.w3.org/2000/svg'
# I couldn't figure out how to get ElementTree to work with the following XPath
# "//*[namespace-uri()='http://example.com']"
# so I decided to use minidom and this helper function that performs a test on a given node
# and all its children
# func must return either True (if pass) or False (if fail)
def walkTree(elem, func):
if func(elem) is False:
return False