File: python-errors-generator.xsl

package info (click to toggle)
telepathy-python 0.15.19-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 2,332 kB
  • ctags: 406
  • sloc: xml: 27,760; python: 2,511; sh: 715; makefile: 114
file content (48 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
  exclude-result-prefixes="tp">

  <xsl:output method="text" indent="no" encoding="utf-8"/>

  <xsl:template match="tp:errors/tp:error">
class <xsl:value-of select="translate(@name, '. ', '')"/>(DBusException):
    """\<xsl:value-of select="tp:docstring"/>
    """
    _dbus_error_name = '<xsl:value-of select="concat(../@namespace, '.', translate(@name, ' ', ''))"/>'
  </xsl:template>

  <xsl:template match="text()"/>

  <xsl:template match="tp:section">
    <xsl:apply-templates match="node"/>
  </xsl:template>

  <xsl:template match="/"># -*- coding: utf-8 -*-
    <xsl:apply-templates select="//tp:errors"/>
  </xsl:template>

  <xsl:template match="tp:errors">
"""Exception classes, generated from the Telepathy spec

<xsl:for-each select="tp:copyright">
<xsl:value-of select="."/><xsl:text>
</xsl:text></xsl:for-each><xsl:text>
</xsl:text><xsl:value-of select="tp:license"/>

<xsl:value-of select="tp:docstring"/>
"""

from dbus import DBusException

__all__ = (
<xsl:for-each select="tp:error">
  <xsl:value-of select="concat('&quot;', translate(@name, '. ', ''),
    '&quot;,')"/><xsl:text>&#10;</xsl:text>
</xsl:for-each>)

<xsl:apply-templates select="tp:error"/>
</xsl:template>

</xsl:stylesheet>

<!-- vim:set sw=2 sts=2 et noai noci: -->