Remove unnecessary seek commands

pull/176/head
FlyingSamson 2022-05-24 18:15:52 +02:00
parent 02a223c220
commit a473ee3f4c
4 changed files with 2 additions and 14 deletions

View File

@ -265,8 +265,6 @@ class Document:
"""
# wrap string into StringIO object
svg_file_obj = StringIO(svg_string)
# reset cursor to the beginning of the buffer
svg_file_obj.seek(0)
# create document from file object
return Document(svg_file_obj)

View File

@ -271,8 +271,6 @@ def svg_string2paths(svg_string,
info."""
# wrap string into StringIO object
svg_file_obj = StringIO(svg_string)
# reset cursor to the beginning of the buffer
svg_file_obj.seek(0)
return svg2paths(svg_file_name_or_file=svg_file_obj,
return_svg_attributes=return_svg_attributes,
convert_circles_to_paths=convert_circles_to_paths,

View File

@ -26,11 +26,7 @@ class TestDocument(unittest.TestCase):
# read entire file into string
file_content = file.read()
# prepare stringio object
file_as_stringio = StringIO()
# paste file content into it
file_as_stringio.write(file_content)
# reset curser to its beginning
file_as_stringio.seek(0)
file_as_stringio = StringIO(file_content)
doc = Document(file_as_stringio)

View File

@ -81,11 +81,7 @@ class TestSVG2Paths(unittest.TestCase):
# read entire file into string
file_content = file.read()
# prepare stringio object
file_as_stringio = StringIO()
# paste file content into it
file_as_stringio.write(file_content)
# reset curser to its beginning
file_as_stringio.seek(0)
file_as_stringio = StringIO(file_content)
paths, _ = svg2paths(file_as_stringio)