VirtualBox

Changeset 26583 in vbox for trunk/src/VBox/Main/glue


Ignore:
Timestamp:
Feb 16, 2010 3:11:22 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57769
Message:

Python: gueststats command, API to get enums values list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/constants-python.xsl

    r22043 r26583  
    5959              </xsl:for-each>}
    6060
     61   _ValuesSym = {<xsl:for-each select="//enum">
     62                '<xsl:value-of select="@name"/>':{
     63                  <xsl:for-each select="const">'<xsl:value-of select="@name"/>': '<xsl:value-of select="@name"/>'<xsl:if test="not(position()=last())">,</xsl:if>
     64                  </xsl:for-each>}<xsl:if test="not(position()=last())">,</xsl:if>
     65
     66              </xsl:for-each>}
     67
    6168   _ValuesFlat = {<xsl:for-each select="//enum">
    6269                   <xsl:variable name="ename">
     
    9299         raise AttributeError
    93100
     101   def all_values(self,enum_name):
     102      if self.isSym:
     103        vals = self._ValuesSym.get(enum_name)
     104      else:
     105        vals = self._Values.get(enum_name)
     106      if vals is not None:
     107         return vals
     108      else:
     109         return {}
     110
    94111</xsl:template>
    95112</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.

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