VirtualBox

source: vbox/trunk/src/VBox/Main/glue/constants-python.xsl@ 20149

Last change on this file since 20149 was 19900, checked in by vboxsync, 16 years ago

Python: constant works everywhere with glue (note that SessionState_Open, not SessionState.Open is what shall be used now)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
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>
50class 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:if test="not(position()=last())">,</xsl:if>
69 </xsl:for-each>}
70
71 def __getattr__(self,attr):
72 v = self._ValuesFlat.get(attr)
73 if v is not None:
74 return v
75 else:
76 raise AttributeError
77
78</xsl:template>
79</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette