--- a/svghmi/gen_index_xhtml.xslt Mon Aug 12 13:06:11 2019 +0200
+++ b/svghmi/gen_index_xhtml.xslt Mon Aug 12 13:09:55 2019 +0200
@@ -16,7 +16,7 @@
<xsl:template mode="testgeo" match="bbox">
<xsl:text>ID: </xsl:text>
- <xsl:value-of select="@id"/>
+ <xsl:value-of select="@Id"/> <xsl:text> x: </xsl:text>
<xsl:value-of select="@x"/>
<xsl:text> y: </xsl:text>
--- a/svghmi/gen_index_xhtml.ysl2 Mon Aug 12 13:06:11 2019 +0200
+++ b/svghmi/gen_index_xhtml.ysl2 Mon Aug 12 13:09:55 2019 +0200
@@ -38,7 +38,7 @@
template "bbox", mode="testgeo"{
- > ID: «@id» x: «@x» y: «@y» w: «@w» h: «@h»
+ > ID: «@Id» x: «@x» y: «@y» w: «@w» h: «@h» --- a/svghmi/svghmi.py Mon Aug 12 13:06:11 2019 +0200
+++ b/svghmi/svghmi.py Mon Aug 12 13:09:55 2019 +0200
@@ -14,9 +14,11 @@
import util.paths as paths
from POULibrary import POULibrary
-from docutil import open_svg
+from docutil import open_svg, get_inkscape_path +from util.ProcessLogger import ProcessLogger @@ -98,9 +100,25 @@
def GetSVGGeometry(self):
- # TODO : invoke inskscape -S, csv-parse output, produce elements
- return [etree.Element("bbox", id="blah0", x="1", y="2", w="3", h="4"),
- etree.Element("bbox", id="blah1", x="5", y="6", w="7", h="8")]
+ # invoke inskscape -S, csv-parse output, produce elements + InkscapeGeomColumns = ["Id", "x", "y", "w", "h"] + # TODO : move following line to __init__ + inkpath = get_inkscape_path() + svgpath = self._getSVGpath() + _status, result, _err_result = ProcessLogger(None, + inkpath + " -S " + svgpath, + for line in result.split(): + strippedline = line.strip() + zip(InkscapeGeomColumns, line.strip().split(','))) + res.append(etree.Element("bbox", **attrs)) def CTNGenerate_C(self, buildpath, locations):