Changeset 21968 in vbox
- Timestamp:
- Aug 5, 2009 8:01:34 AM (16 years ago)
- Location:
- trunk/src/VBox/Main/glue
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/constants-python.xsl
r21965 r21968 49 49 </xsl:text> 50 50 class VirtualBoxReflectionInfo: 51 def __init__(self ):52 self. map = {}51 def __init__(self, isSym): 52 self.isSym = isSym 53 53 54 54 _Values = {<xsl:for-each select="//enum"> … … 68 68 <xsl:if test="not(position()=last())">,</xsl:if> 69 69 </xsl:for-each>} 70 71 _ValuesFlatSym = {<xsl:for-each select="//enum"> 72 <xsl:variable name="ename"> 73 <xsl:value-of select="@name"/> 74 </xsl:variable> 75 <xsl:for-each select="const"> 76 <xsl:variable name="eval"> 77 <xsl:value-of select="concat($ename, '_', @name)"/> 78 </xsl:variable> 79 '<xsl:value-of select="$eval"/>': '<xsl:value-of select="$eval"/>'<xsl:if test="not(position()=last())">,</xsl:if> 80 </xsl:for-each> 81 <xsl:if test="not(position()=last())">,</xsl:if> 82 </xsl:for-each>} 70 83 71 84 def __getattr__(self,attr): 72 v = self._ValuesFlat.get(attr) 85 if self.isSym: 86 v = self._ValuesFlatSym.get(attr) 87 else: 88 v = self._ValuesFlat.get(attr) 73 89 if v is not None: 74 90 return v -
trunk/src/VBox/Main/glue/vboxapi.py
r21959 r21968 205 205 import pythoncom 206 206 import win32api 207 self.constants = PlatformMSCOM.InterfacesWrapper()208 207 from win32con import DUPLICATE_SAME_ACCESS 209 208 from win32api import GetCurrentThread,GetCurrentThreadId,DuplicateHandle,GetCurrentProcess … … 230 229 return win32com.client.Dispatch("VirtualBox.VirtualBox") 231 230 232 def getConstants(self):233 return self.constants234 235 231 def getType(self): 236 232 return 'MSCOM' … … 321 317 import xpcom.components 322 318 return xpcom.components.classes["@virtualbox.org/VirtualBox;1"].createInstance() 323 324 def getConstants(self):325 import xpcom.components326 return xpcom.components.interfaces327 319 328 320 def getType(self): … … 411 403 self.wsmgr = None 412 404 413 def getConstants(self):414 return None415 416 405 def getType(self): 417 406 return 'WEBSERVICE' … … 457 446 style = "XPCOM" 458 447 448 459 449 exec "self.platform = Platform"+style+"(platparams)" 460 461 self.constants = VirtualBoxReflectionInfo( )450 # for webservices, enums are symbolic 451 self.constants = VirtualBoxReflectionInfo(style == "WEBSERVICE") 462 452 self.type = self.platform.getType() 463 453 self.remote = self.platform.getRemote()
Note:
See TracChangeset
for help on using the changeset viewer.