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(','))) |