483 def GetSVGGeometry(self): |
483 def GetSVGGeometry(self): |
484 # invoke inskscape -S, csv-parse output, produce elements |
484 # invoke inskscape -S, csv-parse output, produce elements |
485 InkscapeGeomColumns = ["Id", "x", "y", "w", "h"] |
485 InkscapeGeomColumns = ["Id", "x", "y", "w", "h"] |
486 |
486 |
487 inkpath = get_inkscape_path() |
487 inkpath = get_inkscape_path() |
|
488 |
|
489 if inkpath is None: |
|
490 self.FatalError("SVGHMI: inkscape is not installed.") |
|
491 |
488 svgpath = self._getSVGpath() |
492 svgpath = self._getSVGpath() |
489 status, result, _err_result = ProcessLogger(self.GetCTRoot().logger, |
493 status, result, _err_result = ProcessLogger(self.GetCTRoot().logger, |
490 '"' + inkpath + '" -S "' + svgpath + '"', |
494 '"' + inkpath + '" -S "' + svgpath + '"', |
491 no_stdout=True, |
495 no_stdout=True, |
492 no_stderr=True).spin() |
496 no_stderr=True).spin() |
493 if status != 0: |
497 if status != 0: |
494 self.FatalError("SVGHMI : inkscape couldn't extract geometry from given SVG") |
498 self.FatalError("SVGHMI: inkscape couldn't extract geometry from given SVG.") |
495 |
499 |
496 res = [] |
500 res = [] |
497 for line in result.split(): |
501 for line in result.split(): |
498 strippedline = line.strip() |
502 strippedline = line.strip() |
499 attrs = dict( |
503 attrs = dict( |