VirtualBox

Changeset 19900 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
May 22, 2009 7:45:29 AM (16 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r19883 r19900  
    726726$(VBOX_PYTHON_CONSTANTS):  $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
    727727        $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
    728         $(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
     728        $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
    729729
    730730# Aliases for testing purposes.
  • trunk/src/VBox/Main/glue/constants-python.xsl

    r19885 r19900  
    5757                  </xsl:for-each>}<xsl:if test="not(position()=last())">,</xsl:if>
    5858
    59               </xsl:for-each>
     59              </xsl:for-each>}
    6060
    6161   _ValuesFlat = {<xsl:for-each select="//enum">
     
    6666                        '<xsl:value-of select="$ename"/>_<xsl:value-of select="@name"/>':<xsl:value-of select="@value"/><xsl:if test="not(position()=last())">,</xsl:if>
    6767                   </xsl:for-each>
     68                   <xsl:if test="not(position()=last())">,</xsl:if>
    6869                  </xsl:for-each>}
    6970
    7071   def __getattr__(self,attr):
    7172      v = self._ValuesFlat.get(attr)
    72       if v == None:
    73           return self.__dict__[name]
    74       return v
    75 
     73      if v is not None:
     74         return v
     75      else:
     76         raise AttributeError
    7677
    7778</xsl:template>
  • trunk/src/VBox/Main/glue/vboxapi.py

    r19883 r19900  
    3131sys.path.append(VboxBinDir)
    3232sys.path.append(VboxSdkDir+"/bindings/glue/python")
     33
     34from VirtualBox_constants import VirtualBoxReflectionInfo
    3335
    3436class PlatformMSCOM:
     
    207209            self.vbox = self.platform.getVirtualBox()
    208210            self.mgr = SessionManager(self)
    209             self.constants = self.platform.getConstants()
     211            self.constants = VirtualBoxReflectionInfo()
    210212            self.type = self.platform.getType()
    211213            self.remote = self.platform.getRemote()
Note: See TracChangeset for help on using the changeset viewer.

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