From 385dbb719635b9e9022a1e989b0d92b72938a300 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 30 Mar 2017 01:57:23 -0700 Subject: [PATCH] cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit removed commented-out “pathless_svg” functionality --- svgpathtools/svg2paths.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/svgpathtools/svg2paths.py b/svgpathtools/svg2paths.py index 2085e75..df519a5 100644 --- a/svgpathtools/svg2paths.py +++ b/svgpathtools/svg2paths.py @@ -5,7 +5,6 @@ The main tool being the svg2paths() function.""" from __future__ import division, absolute_import, print_function from xml.dom.minidom import parse from os import path as os_path, getcwd -from shutil import copyfile # Internal dependencies from .parser import parse_path @@ -72,15 +71,10 @@ def svg2paths(svg_file_location, svg-attributes will be extracted and returned :return: list of Path objects, list of path attribute dictionaries, and (optionally) a dictionary of svg-attributes - """ if os_path.dirname(svg_file_location) == '': svg_file_location = os_path.join(getcwd(), svg_file_location) - # if pathless_svg: - # copyfile(svg_file_location, pathless_svg) - # doc = parse(pathless_svg) - # else: doc = parse(svg_file_location) def dom2dict(element): @@ -93,9 +87,6 @@ def svg2paths(svg_file_location, paths = [dom2dict(el) for el in doc.getElementsByTagName('path')] d_strings = [el['d'] for el in paths] attribute_dictionary_list = paths - # if pathless_svg: - # for el in doc.getElementsByTagName('path'): - # el.parentNode.removeChild(el) # Use minidom to extract polyline strings from input SVG, convert to # path strings, add to list @@ -117,10 +108,6 @@ def svg2paths(svg_file_location, 'L' + l['x2'] + ' ' + l['y2']) for l in lines] attribute_dictionary_list += lines - # if pathless_svg: - # with open(pathless_svg, "wb") as f: - # doc.writexml(f) - if return_svg_attributes: svg_attributes = dom2dict(doc.getElementsByTagName('svg')[0]) doc.unlink()