From 6571ce7f2f4b4801e5e17e3c456a1b569a8520eb Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Thu, 1 Aug 2019 02:00:23 -0500 Subject: [PATCH] Draft: importSVG.py, improved Pythonic style, 4 spaces instead of 8 --- src/Mod/Draft/importSVG.py | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Mod/Draft/importSVG.py b/src/Mod/Draft/importSVG.py index 0973119836..dc15fdd626 100644 --- a/src/Mod/Draft/importSVG.py +++ b/src/Mod/Draft/importSVG.py @@ -1606,34 +1606,34 @@ def getContents(filename, tag, stringmode=False): def open(filename): - """Open filename and parse using the svgHandler(). + """Open filename and parse using the svgHandler(). - Parameters - ---------- - filename : str - The path to the filename to be opened. + Parameters + ---------- + filename : str + The path to the filename to be opened. - Returns - ------- - App::Document - The new FreeCAD document object created, with the parsed information. - """ - docname = os.path.split(filename)[1] - doc = FreeCAD.newDocument(docname) - doc.Label = docname[:-4] + Returns + ------- + App::Document + The new FreeCAD document object created, with the parsed information. + """ + docname = os.path.split(filename)[1] + doc = FreeCAD.newDocument(docname) + doc.Label = docname[:-4] - # Set up the parser - parser = xml.sax.make_parser() - parser.setFeature(xml.sax.handler.feature_external_ges, False) - parser.setContentHandler(svgHandler()) - parser._cont_handler.doc = doc + # Set up the parser + parser = xml.sax.make_parser() + parser.setFeature(xml.sax.handler.feature_external_ges, False) + parser.setContentHandler(svgHandler()) + parser._cont_handler.doc = doc - # Use the native Python open which was saved as `pythonopen`. - f = pythonopen(filename) - parser.parse(f) - f.close() - doc.recompute() - return doc + # Use the native Python open which was saved as `pythonopen` + f = pythonopen(filename) + parser.parse(f) + f.close() + doc.recompute() + return doc def insert(filename, docname):