1 | <xsl:stylesheet version = '1.0'
|
---|
2 | xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
|
---|
3 | xmlns:vbox="http://www.virtualbox.org/">
|
---|
4 |
|
---|
5 | <!--
|
---|
6 |
|
---|
7 | constants-python.xsl:
|
---|
8 | XSLT stylesheet that generates VirtualBox_constants.py from
|
---|
9 | VirtualBox.xidl.
|
---|
10 |
|
---|
11 | Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
12 |
|
---|
13 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
14 | available from http://www.virtualbox.org. This file is free software;
|
---|
15 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
16 | General Public License (GPL) as published by the Free Software
|
---|
17 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
18 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
19 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
20 |
|
---|
21 | Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
22 | Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
23 | additional information or have any questions.
|
---|
24 | -->
|
---|
25 |
|
---|
26 | <xsl:output
|
---|
27 | method="text"
|
---|
28 | version="1.0"
|
---|
29 | encoding="utf-8"
|
---|
30 | indent="no"/>
|
---|
31 |
|
---|
32 | <xsl:template match="/">
|
---|
33 | <xsl:text># Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
34 | #
|
---|
35 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
36 | # available from http://www.virtualbox.org. This file is free software;
|
---|
37 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
38 | # General Public License (GPL) as published by the Free Software
|
---|
39 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
40 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
41 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
42 | #
|
---|
43 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
44 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
45 | # additional information or have any questions.
|
---|
46 | #
|
---|
47 | # This file is autogenerated from VirtualBox.xidl, DO NOT EDIT!
|
---|
48 | #
|
---|
49 | </xsl:text>
|
---|
50 | class VirtualBoxReflectionInfo:
|
---|
51 | def __init__(self):
|
---|
52 | self.map = {}
|
---|
53 |
|
---|
54 | _Values = {<xsl:for-each select="//enum">
|
---|
55 | '<xsl:value-of select="@name"/>':{
|
---|
56 | <xsl:for-each select="const">'<xsl:value-of select="@name"/>':<xsl:value-of select="@value"/><xsl:if test="not(position()=last())">,</xsl:if>
|
---|
57 | </xsl:for-each>}<xsl:if test="not(position()=last())">,</xsl:if>
|
---|
58 |
|
---|
59 | </xsl:for-each>
|
---|
60 |
|
---|
61 | _ValuesFlat = {<xsl:for-each select="//enum">
|
---|
62 | <xsl:variable name="ename">
|
---|
63 | <xsl:value-of select="@name"/>
|
---|
64 | </xsl:variable>
|
---|
65 | <xsl:for-each select="const">
|
---|
66 | '<xsl:value-of select="$ename"/>_<xsl:value-of select="@name"/>':<xsl:value-of select="@value"/><xsl:if test="not(position()=last())">,</xsl:if>
|
---|
67 | </xsl:for-each>
|
---|
68 | </xsl:for-each>}
|
---|
69 |
|
---|
70 | def __getattr__(self,attr):
|
---|
71 | v = self._ValuesFlat.get(attr)
|
---|
72 | if v == None:
|
---|
73 | return self.__dict__[name]
|
---|
74 | return v
|
---|
75 |
|
---|
76 |
|
---|
77 | </xsl:template>
|
---|
78 | </xsl:stylesheet>
|
---|