Do not explicitly extend object
This commit is contained in:
parent
1ceeaf11e6
commit
d1fd32fd5b
5 changed files with 11 additions and 11 deletions
|
|
@ -421,7 +421,7 @@ sciExponent = re.compile(r"[eE]([-+]?\d+)")
|
||||||
unit = re.compile("(em|ex|px|pt|pc|cm|mm|in|%){1,1}$")
|
unit = re.compile("(em|ex|px|pt|pc|cm|mm|in|%){1,1}$")
|
||||||
|
|
||||||
|
|
||||||
class Unit(object):
|
class Unit:
|
||||||
# Integer constants for units.
|
# Integer constants for units.
|
||||||
INVALID = -1
|
INVALID = -1
|
||||||
NONE = 0
|
NONE = 0
|
||||||
|
|
@ -483,7 +483,7 @@ class Unit(object):
|
||||||
str = staticmethod(str)
|
str = staticmethod(str)
|
||||||
|
|
||||||
|
|
||||||
class SVGLength(object):
|
class SVGLength:
|
||||||
|
|
||||||
def __init__(self, str):
|
def __init__(self, str):
|
||||||
try: # simple unitless and no scientific notation
|
try: # simple unitless and no scientific notation
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
class ScourStats(object):
|
class ScourStats:
|
||||||
|
|
||||||
__slots__ = (
|
__slots__ = (
|
||||||
'num_elements_removed',
|
'num_elements_removed',
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ from functools import partial
|
||||||
# Sentinel.
|
# Sentinel.
|
||||||
|
|
||||||
|
|
||||||
class _EOF(object):
|
class _EOF:
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return 'EOF'
|
return 'EOF'
|
||||||
|
|
@ -65,7 +65,7 @@ lexicon = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class Lexer(object):
|
class Lexer:
|
||||||
""" Break SVG path data into tokens.
|
""" Break SVG path data into tokens.
|
||||||
|
|
||||||
The SVG spec requires that tokens are greedy. This lexer relies on Python's
|
The SVG spec requires that tokens are greedy. This lexer relies on Python's
|
||||||
|
|
@ -102,7 +102,7 @@ class Lexer(object):
|
||||||
svg_lexer = Lexer(lexicon)
|
svg_lexer = Lexer(lexicon)
|
||||||
|
|
||||||
|
|
||||||
class SVGPathParser(object):
|
class SVGPathParser:
|
||||||
""" Parse SVG <path> data into a list of commands.
|
""" Parse SVG <path> data into a list of commands.
|
||||||
|
|
||||||
Each distinct command will take the form of a tuple (command, data). The
|
Each distinct command will take the form of a tuple (command, data). The
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ from six.moves import range
|
||||||
|
|
||||||
|
|
||||||
# Sentinel.
|
# Sentinel.
|
||||||
class _EOF(object):
|
class _EOF:
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return 'EOF'
|
return 'EOF'
|
||||||
|
|
@ -81,7 +81,7 @@ lexicon = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class Lexer(object):
|
class Lexer:
|
||||||
""" Break SVG path data into tokens.
|
""" Break SVG path data into tokens.
|
||||||
|
|
||||||
The SVG spec requires that tokens are greedy. This lexer relies on Python's
|
The SVG spec requires that tokens are greedy. This lexer relies on Python's
|
||||||
|
|
@ -118,7 +118,7 @@ class Lexer(object):
|
||||||
svg_lexer = Lexer(lexicon)
|
svg_lexer = Lexer(lexicon)
|
||||||
|
|
||||||
|
|
||||||
class SVGTransformationParser(object):
|
class SVGTransformationParser:
|
||||||
""" Parse SVG transform="" data into a list of commands.
|
""" Parse SVG transform="" data into a list of commands.
|
||||||
|
|
||||||
Each distinct command will take the form of a tuple (type, data). The
|
Each distinct command will take the form of a tuple (type, data). The
|
||||||
|
|
|
||||||
|
|
@ -2550,7 +2550,7 @@ class CommandLineUsage(unittest.TestCase):
|
||||||
# stdout: a string representing the combined output to 'stdout'
|
# stdout: a string representing the combined output to 'stdout'
|
||||||
# stderr: a string representing the combined output to 'stderr'
|
# stderr: a string representing the combined output to 'stderr'
|
||||||
def _run_scour(self):
|
def _run_scour(self):
|
||||||
class Result(object):
|
class Result:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
result = Result()
|
result = Result()
|
||||||
|
|
@ -2578,7 +2578,7 @@ class CommandLineUsage(unittest.TestCase):
|
||||||
# TODO: can we create file objects that behave *exactly* like the original?
|
# TODO: can we create file objects that behave *exactly* like the original?
|
||||||
# this is a mess since we have to ensure compatibility across Python 2 and 3 and it seems impossible
|
# this is a mess since we have to ensure compatibility across Python 2 and 3 and it seems impossible
|
||||||
# to replicate all the details of 'stdin', 'stdout' and 'stderr'
|
# to replicate all the details of 'stdin', 'stdout' and 'stderr'
|
||||||
class InOutBuffer(six.StringIO, object):
|
class InOutBuffer(six.StringIO):
|
||||||
def write(self, string):
|
def write(self, string):
|
||||||
try:
|
try:
|
||||||
return super(InOutBuffer, self).write(string)
|
return super(InOutBuffer, self).write(string)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue