svghmi/svghmi.py
branchsvghmi
changeset 3032 2f6dfb99d094
parent 2993 b76f303ffce6
child 3051 44dd48070e41
equal deleted inserted replaced
3031:440d74319a74 3032:2f6dfb99d094
   483         # invoke inskscape -S, csv-parse output, produce elements
   483         # invoke inskscape -S, csv-parse output, produce elements
   484         InkscapeGeomColumns = ["Id", "x", "y", "w", "h"]
   484         InkscapeGeomColumns = ["Id", "x", "y", "w", "h"]
   485 
   485 
   486         inkpath = get_inkscape_path()
   486         inkpath = get_inkscape_path()
   487         svgpath = self._getSVGpath()
   487         svgpath = self._getSVGpath()
   488         _status, result, _err_result = ProcessLogger(self.GetCTRoot().logger,
   488         status, result, _err_result = ProcessLogger(self.GetCTRoot().logger,
   489                                                      inkpath + " -S " + svgpath,
   489                                                      '"' + inkpath + '" -S "' + svgpath + '"',
   490                                                      no_stdout=True,
   490                                                      no_stdout=True,
   491                                                      no_stderr=True).spin()
   491                                                      no_stderr=True).spin()
       
   492         if status != 0:
       
   493             self.FatalError("SVGHMI : inkscape couldn't extract geometry from given SVG")
       
   494 
   492         res = []
   495         res = []
   493         for line in result.split():
   496         for line in result.split():
   494             strippedline = line.strip()
   497             strippedline = line.strip()
   495             attrs = dict(
   498             attrs = dict(
   496                 zip(InkscapeGeomColumns, line.strip().split(',')))
   499                 zip(InkscapeGeomColumns, line.strip().split(',')))