[telepathy-python/master] Upgrade code generator to work with latest spec.
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Thu Jun 11 09:39:30 PDT 2009
<tp:section> have been added in recent versions of the spec. Update code
generator to properly deal with them. Many thanks to Frederic Peters for
his help.
---
tools/python-constants-generator.xsl | 6 +++++-
tools/python-errors-generator.xsl | 4 ++++
tools/python-interfaces-generator.xsl | 6 +++++-
tools/spec-to-python.xsl | 4 ++++
4 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/tools/python-constants-generator.xsl b/tools/python-constants-generator.xsl
index 86e1cbb..d3058a0 100644
--- a/tools/python-constants-generator.xsl
+++ b/tools/python-constants-generator.xsl
@@ -58,6 +58,10 @@
<xsl:template match="text()"/>
+<xsl:template match="tp:section">
+ <xsl:apply-templates match="node"/>
+</xsl:template>
+
<xsl:template match="/tp:spec">"""List of constants, generated from the Telepathy spec version <xsl:value-of select="tp:version"/><xsl:text>
</xsl:text><xsl:for-each select="tp:copyright">
@@ -67,7 +71,7 @@
<xsl:value-of select="tp:docstring"/>
"""
-<xsl:apply-templates select="node"/>
+<xsl:apply-templates match="node"/>
</xsl:template>
</xsl:stylesheet>
diff --git a/tools/python-errors-generator.xsl b/tools/python-errors-generator.xsl
index e8df9ea..8406bae 100644
--- a/tools/python-errors-generator.xsl
+++ b/tools/python-errors-generator.xsl
@@ -13,6 +13,10 @@ class <xsl:value-of select="translate(@name, '. ', '')"/>(DBusException):
<xsl:template match="text()"/>
+ <xsl:template match="tp:section">
+ <xsl:apply-templates match="node"/>
+ </xsl:template>
+
<xsl:template match="/">
<xsl:apply-templates select="//tp:errors"/>
</xsl:template>
diff --git a/tools/python-interfaces-generator.xsl b/tools/python-interfaces-generator.xsl
index 3cc7d46..9695247 100644
--- a/tools/python-interfaces-generator.xsl
+++ b/tools/python-interfaces-generator.xsl
@@ -14,6 +14,10 @@
<xsl:template match="text()"/>
+ <xsl:template match="tp:section">
+ <xsl:apply-templates match="node"/>
+ </xsl:template>
+
<xsl:template match="/tp:spec">"""List of interfaces, generated from the Telepathy spec version <xsl:value-of select="tp:version"/><xsl:text>
</xsl:text><xsl:for-each select="tp:copyright">
@@ -23,7 +27,7 @@
<xsl:value-of select="tp:docstring"/>
"""
-<xsl:apply-templates select="node"/>
+<xsl:apply-templates match="node"/>
</xsl:template>
</xsl:stylesheet>
diff --git a/tools/spec-to-python.xsl b/tools/spec-to-python.xsl
index 4e0983c..9d5cd08 100644
--- a/tools/spec-to-python.xsl
+++ b/tools/spec-to-python.xsl
@@ -7,6 +7,10 @@
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
+ <xsl:template match="tp:section">
+ <xsl:apply-templates match="node"/>
+ </xsl:template>
+
<xsl:template match="interface">
<xsl:variable name="u" select="translate(../@name, concat($lower, '/'), $upper)"/>
<xsl:variable name="superclass">
--
1.5.6.5
More information about the telepathy-commits
mailing list