Remove second version of function returning the svg_attributes by default

pull/176/head
FlyingSamson 2022-05-25 17:45:31 +02:00
parent db5200f460
commit aacd5fa96d
2 changed files with 2 additions and 34 deletions

View File

@ -279,24 +279,3 @@ def svg_string2paths(svg_string,
convert_polylines_to_paths=convert_polylines_to_paths,
convert_polygons_to_paths=convert_polygons_to_paths,
convert_rectangles_to_paths=convert_rectangles_to_paths)
def svg_string2paths2(svg_string,
return_svg_attributes=True,
convert_circles_to_paths=True,
convert_ellipses_to_paths=True,
convert_lines_to_paths=True,
convert_polylines_to_paths=True,
convert_polygons_to_paths=True,
convert_rectangles_to_paths=True):
"""Convenience function; identical to svg2paths2() except that it takes the
svg object as string. See svg2paths() docstring for more
info."""
return svg_string2paths(svg_string=svg_string,
return_svg_attributes=return_svg_attributes,
convert_circles_to_paths=convert_circles_to_paths,
convert_ellipses_to_paths=convert_ellipses_to_paths,
convert_lines_to_paths=convert_lines_to_paths,
convert_polylines_to_paths=convert_polylines_to_paths,
convert_polygons_to_paths=convert_polygons_to_paths,
convert_rectangles_to_paths=convert_rectangles_to_paths)

View File

@ -87,8 +87,8 @@ class TestSVG2Paths(unittest.TestCase):
self.assertEqual(len(paths), 2)
def test_from_string_without_svg_attrs(self):
""" Test reading svg object contained in a string without svg attributes"""
def test_from_string(self):
""" Test reading svg object contained in a string """
with open(join(dirname(__file__), 'polygons.svg'),
'r', encoding='utf-8') as file:
# read entire file into string
@ -97,14 +97,3 @@ class TestSVG2Paths(unittest.TestCase):
paths, _ = svg_string2paths(file_content)
self.assertEqual(len(paths), 2)
def test_from_string_with_svg_attrs(self):
""" Test reading svg object contained in a string with svg attributes"""
with open(join(dirname(__file__), 'polygons.svg'),
'r', encoding='utf-8') as file:
# read entire file into string
file_content = file.read()
paths, _, _ = svg_string2paths2(file_content)
self.assertEqual(len(paths), 2)