From 945eee8f86e77a22a669d499fb6b176a9baa0d8e Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Thu, 1 Aug 2019 01:58:30 -0500 Subject: [PATCH] Draft: importSVG.py, improved Pythonic style, 4 spaces instead of 8 --- src/Mod/Draft/importSVG.py | 56 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Mod/Draft/importSVG.py b/src/Mod/Draft/importSVG.py index bdc56e744f..0973119836 100644 --- a/src/Mod/Draft/importSVG.py +++ b/src/Mod/Draft/importSVG.py @@ -1637,39 +1637,39 @@ def open(filename): def insert(filename, docname): - """Get an active document and parse using the svgHandler(). + """Get an active document and parse using the svgHandler(). - If no document exist, it is created. + If no document exist, it is created. - Parameters - ---------- - filename : str - The path to the filename to be opened. - docname : str - The name of the active App::Document if one exists, or - of the new one created. + Parameters + ---------- + filename : str + The path to the filename to be opened. + docname : str + The name of the active App::Document if one exists, or + of the new one created. - Returns - ------- - App::Document - The active FreeCAD document, or the document created if none exists, - with the parsed information. - """ - try: - doc = FreeCAD.getDocument(docname) - except NameError: - doc = FreeCAD.newDocument(docname) - FreeCAD.ActiveDocument = doc + Returns + ------- + App::Document + The active FreeCAD document, or the document created if none exists, + with the parsed information. + """ + try: + doc = FreeCAD.getDocument(docname) + except NameError: + doc = FreeCAD.newDocument(docname) + FreeCAD.ActiveDocument = 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 + # 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` - parser.parse(pythonopen(filename)) - doc.recompute() + # Use the native Python open which was saved as `pythonopen` + parser.parse(pythonopen(filename)) + doc.recompute() def export(exportList, filename):