SVGHMI: Behave when project path include spaces, and make more understandable error in case of problem extracting geometry with inkscape. svghmi
authorEdouard Tisserant
Thu, 20 Aug 2020 14:12:49 +0200
branchsvghmi
changeset 3032 2f6dfb99d094
parent 3031 440d74319a74
child 3033 52f6548982d4
SVGHMI: Behave when project path include spaces, and make more understandable error in case of problem extracting geometry with inkscape.
svghmi/svghmi.py
--- a/svghmi/svghmi.py	Thu Aug 20 13:56:21 2020 +0200
+++ b/svghmi/svghmi.py	Thu Aug 20 14:12:49 2020 +0200
@@ -485,10 +485,13 @@
 
         inkpath = get_inkscape_path()
         svgpath = self._getSVGpath()
-        _status, result, _err_result = ProcessLogger(self.GetCTRoot().logger,
-                                                     inkpath + " -S " + svgpath,
+        status, result, _err_result = ProcessLogger(self.GetCTRoot().logger,
+                                                     '"' + inkpath + '" -S "' + svgpath + '"',
                                                      no_stdout=True,
                                                      no_stderr=True).spin()
+        if status != 0:
+            self.FatalError("SVGHMI : inkscape couldn't extract geometry from given SVG")
+
         res = []
         for line in result.split():
             strippedline = line.strip()