VirtualBox

Ignore:
Timestamp:
Jul 27, 2009 3:59:56 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50433
Message:

API/webservice: eliminate the last traces of special UUID data type handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/websrv-python.xsl

    r21640 r21819  
    5353    <xsl:when test="$type='unsigned long long'">UnsignedLong</xsl:when>
    5454    <xsl:when test="$type='result'">UnsignedInt</xsl:when>
    55     <xsl:when test="$type='uuid'">UUID</xsl:when>
    5655    <xsl:when test="$type='$unknown'">IUnknown</xsl:when>
    5756    <xsl:when test="$type='$dispatched'">IUnknown</xsl:when>
     
    538537
    539538
    540 class UUID:
    541   def __init__(self, mgr, handle, isarray = False):
    542       self.handle = handle
    543       self.mgr = mgr
    544       self.isarray = isarray
    545  
    546   def __next(self):
    547       if self.isarray:
    548           return self.handle.__next()
    549       raise TypeError, "iteration over non-sequence"
    550 
    551   def __size(self):
    552       if self.isarray:         
    553           return self.handle.__size()
    554       raise TypeError, "iteration over non-sequence"
    555 
    556   def __len__(self):
    557       if self.isarray:
    558           return self.handle.__len__()
    559       raise TypeError, "iteration over non-sequence"
    560 
    561   def __getitem__(self, index):
    562       if self.isarray:
    563           return UUID(self.mgr, self.handle[index])
    564       raise TypeError, "iteration over non-sequence"       
    565 
    566   def __str__(self):
    567       return self.handle
    568 
    569   def __eq__(self,other):
    570       if self.isarray:
    571          return isinstance(other,UUID) and self.handle == other.handle
    572       if isinstance(other,UUID):
    573          return self.handle == other.handle
    574       if isinstance(other,basestring):
    575          return self.handle == other
    576       return False
    577 
    578   def __ne__(self,other):
    579       if self.isarray:
    580          return not isinstance(other,UUID) or self.handle == other.handle     
    581       if isinstance(other,UUID):
    582          return self.handle != other.handle
    583       if isinstance(other,basestring):
    584          return self.handle != other
    585       return True
    586 
    587539class Boolean:
    588540  def __init__(self, mgr, handle, isarray = False):       
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