VirtualBox

Changeset 21640 in vbox


Ignore:
Timestamp:
Jul 16, 2009 11:21:47 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50172
Message:

Python: WS Python bindings fully usable, extend shell to control remote VMs

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r21584 r21640  
    258258            print session.QueryErrorObject(rc)
    259259
    260 def getMachines(ctx):
    261     return ctx['global'].getArray(ctx['vb'], 'machines')
     260def getMachines(ctx, invalidate = False):
     261    if ctx['vb'] is not None:
     262        if ctx['_machlist'] is None or invalidate:
     263            ctx['_machlist'] = ctx['global'].getArray(ctx['vb'], 'machines')
     264        return ctx['_machlist']
     265    else:
     266        return []
    262267
    263268def asState(var):
     
    389394
    390395def listCmd(ctx, args):
    391     for m in getMachines(ctx):
     396    for m in getMachines(ctx, True):
    392397        print "Machine '%s' [%s], state=%s" %(m.name,m.id,m.sessionState)
    393398    return 0
     
    420425    os = ctx['vb'].getGuestOSType(mach.OSTypeId)
    421426    print " One can use setvar <mach> <var> <value> to change variable, using name in []."
    422     print "  Name [name]: " + mach.name
    423     print "  ID [n/a]: " + mach.id
    424     print "  OS Type [n/a]: " + os.description
     427    print "  Name [name]: %s" %(mach.name)
     428    print "  ID [n/a]: %s" %(mach.id)
     429    print "  OS Type [n/a]: %s" %(os.description)
    425430    print
    426431    print "  CPUs [CPUCount]: %d" %(mach.CPUCount)
     
    435440    print "  ACPI [BIOSSettings.ACPIEnabled]: %s" %(asState(bios.ACPIEnabled))
    436441    print "  APIC [BIOSSettings.IOAPICEnabled]: %s" %(asState(bios.IOAPICEnabled))
    437     print "  PAE [PAEEnabled]: %s" %(asState(mach.PAEEnabled))
     442    print "  PAE [PAEEnabled]: %s" %(asState(int(mach.PAEEnabled)))
    438443    print "  Hardware virtualization [HWVirtExEnabled]: " + asState(mach.HWVirtExEnabled)
    439444    print "  VPID support [HWVirtExVPIDEnabled]: " + asState(mach.HWVirtExVPIDEnabled)
     
    457462        print "    Controller: %s port: %d device: %d:" % (disk.controller, disk.port, disk.device)
    458463        hd = disk.hardDisk
    459         print "    id: " + hd.id
    460         print "    location: " +  hd.location
    461         print "    name: " +  hd.name
    462         print "    format: " +  hd.format
     464        print "    id: %s" %(hd.id)
     465        print "    location: %s" %(hd.location)
     466        print "    name: %s"  %(hd.name)
     467        print "    format: %s"  %(hd.format)
    463468        print
    464469
    465470    dvd = mach.DVDDrive
    466     if dvd.getHostDrive() is not None:
     471    if dvd.getHostDrive():
    467472        hdvd = dvd.getHostDrive()
    468473        print "  DVD:"
    469         print "    Host disk:",hdvd.name
     474        print "    Host disk: %s" %(hdvd.name)
    470475        print
    471476
    472     if dvd.getImage() is not None:
     477    if dvd.getImage():
    473478        vdvd = dvd.getImage()
    474479        print "  DVD:"
    475         print "    Image at:",vdvd.location
    476         print "    Size:",vdvd.size
     480        print "    Image at: %s" %(vdvd.location)
     481        print "    Size: %s" %(vdvd.size)
    477482        print
    478483
    479484    floppy = mach.floppyDrive
    480     if floppy.getHostDrive() is not None:
     485    if floppy.getHostDrive():
    481486        hfloppy = floppy.getHostDrive()
    482487        print "  Floppy:"
    483         print "    Host disk:",hfloppy.name
     488        print "    Host disk: %s" %(hfloppy.name)
    484489        print
    485490
    486     if floppy.getImage() is not None:
     491    if floppy.getImage():
    487492        vfloppy = floppy.getImage()
    488493        print "  Floppy:"
    489         print "    Image at:",vfloppy.location
    490         print "    Size:",vfloppy.size
     494        print "    Image at: %s" %(vfloppy.location)
     495        print "    Size: %s" %(vfloppy.size)
    491496        print
    492497
     
    769774
    770775    time.sleep(float(args[1]))
     776    return 0
     777
     778
     779def connectCmd(ctx, args):
     780    if (len(args) > 4):
     781        print "usage: connect [url] [username] [passwd]"
     782        return 0
     783
     784    if ctx['vb'] is not None:
     785        print "Already connected, disconnect first..."
     786        return 0
     787
     788    if (len(args) > 1):
     789        url = args[1]
     790    else:
     791        url = None
     792
     793    if (len(args) > 2):
     794        user = args[1]
     795    else:
     796        user = ""
     797
     798    if (len(args) > 3):
     799        passwd = args[2]
     800    else:
     801        passwd = ""
     802
     803    vbox = ctx['global'].platform.connect(url, user, passwd)
     804    ctx['vb'] = vbox
     805    print "Running VirtualBox version %s" %(vbox.version)
     806    ctx['perf'] = ctx['global'].getPerfCollector(ctx['vb'])
     807    return 0
     808
     809def disconnectCmd(ctx, args):
     810    if (len(args) != 1):
     811        print "usage: disconnect"
     812        return 0
     813
     814    if ctx['vb'] is None:
     815        print "Not connected yet."
     816        return 0
     817
     818    try:
     819        ctx['global'].platform.disconnect()
     820    except:
     821        ctx['vb'] = None
     822        raise
     823
     824    ctx['vb'] = None
     825    return 0
    771826
    772827aliases = {'s':'start',
     
    852907        traceback.print_exc()
    853908
    854 def interpret(ctx):
     909def interpret(ctx):   
     910    if ctx['remote']:
     911        commands['connect'] = ["Connect to remote VBox instance", connectCmd, 0]
     912        commands['disconnect'] = ["Disconnect from remote VBox instance", disconnectCmd, 0]
     913   
    855914    vbox = ctx['vb']
    856     print "Running VirtualBox version %s" %(vbox.version)
    857     ctx['perf'] = ctx['global'].getPerfCollector(ctx['vb'])
    858 
    859     checkUserExtensions(ctx, commands, vbox.homeFolder)
     915
     916    if vbox is not None:
     917        print "Running VirtualBox version %s" %(vbox.version)
     918        ctx['perf'] = ctx['global'].getPerfCollector(ctx['vb'])
     919        home = vbox.homeFolder
     920    else:
     921        ctx['perf'] = None
     922        home = os.path.join(os.path.expanduser("~"), ".VirtualBox")
     923
     924    print "h", home
     925    checkUserExtensions(ctx, commands, home)
    860926
    861927    autoCompletion(commands, ctx)
     
    923989           'remote':g_virtualBoxManager.remote,
    924990           'type':g_virtualBoxManager.type,
    925            'run':runCommandCb
     991           'run':runCommandCb,
     992           '_machlist':None
    926993           }
    927994    interpret(ctx)
  • trunk/src/VBox/Main/glue/vboxapi.py

    r21384 r21640  
    379379    def __init__(self, params):
    380380        sys.path.append(VboxSdkDir+'/bindings/webservice/python/lib')
     381        # not really needed, but just fail early if misconfigured
    381382        import VirtualBox_services
    382383        import VirtualBox_wrappers
     
    390391            self.password = ""
    391392            self.url = None
     393        self.vbox = None       
     394
     395    def getSessionObject(self, vbox):       
     396        return self.wsmgr.getSessionObject(vbox)
     397
     398    def getVirtualBox(self):
     399        return connect(self.url, self.user, self.password)
     400
     401    def connect(self, url, user, passwd):
     402        if self.vbox is not None:
     403             disconnect()
     404        from VirtualBox_wrappers import IWebsessionManager2
     405        self.url = url
     406        if user is None:
     407            user = ""
     408        self.user = user
     409        if passwd is None:
     410            passwd = ""
     411        self.password = passwd
    392412        self.wsmgr = IWebsessionManager2(self.url)
    393 
    394     def getSessionObject(self, vbox):
    395         return self.wsmgr.getSessionObject(vbox)
    396 
    397     def getVirtualBox(self):
    398413        self.vbox = self.wsmgr.logon(self.user, self.password)
    399414        return self.vbox
     415
     416    def disconnect(self):
     417        if self.vbox is not None and self.wsmgr is not None:
     418                self.wsmgr.logoff(self.vbox)
     419                self.vbox = None
     420                self.wsmgr = None
    400421
    401422    def getConstants(self):
     
    426447    def deinit(self):
    427448        try:
    428             if self.vbox is not None:
    429                 self.wsmg.logoff(self.vbox)
    430                 self.vbox = None
     449           disconnect()
    431450        except:
    432             pass
     451           pass
    433452
    434453    def getPerfCollector(self, vbox):
     
    451470        try:
    452471            exec "self.platform = Platform"+style+"(platparams)"
    453             self.vbox = self.platform.getVirtualBox()
    454             self.mgr = SessionManager(self)
     472           
    455473            self.constants = VirtualBoxReflectionInfo()
    456474            self.type = self.platform.getType()
    457475            self.remote = self.platform.getRemote()
    458476            self.style = style           
     477
     478            self.mgr = SessionManager(self)
     479            self.vbox = self.platform.getVirtualBox()
    459480        except Exception,e:
    460481            print "init exception: ",e
    461482            traceback.print_exc()
    462             raise e
     483            if self.remote:
     484                self.vbox = None
     485            else:
     486                raise e
    463487
    464488    def getArray(self, obj, field):
  • trunk/src/VBox/Main/webservice/websrv-python.xsl

    r20036 r21640  
    5555    <xsl:when test="$type='uuid'">UUID</xsl:when>
    5656    <xsl:when test="$type='$unknown'">IUnknown</xsl:when>
     57    <xsl:when test="$type='$dispatched'">IUnknown</xsl:when>
    5758    <xsl:otherwise><xsl:value-of select="$type" /></xsl:otherwise>
    5859  </xsl:choose>
     
    139140</xsl:template>
    140141
     142
     143<xsl:template name="computeExtends">
     144  <xsl:param name="base" />
     145 
     146  <xsl:choose>
     147    <xsl:when test="($base = '$unknown') or ($base = '$dispatched')">
     148      <xsl:value-of select="'IUnknown'"/>
     149    </xsl:when>
     150     <xsl:otherwise>
     151      <xsl:value-of select="$base"/>
     152    </xsl:otherwise>
     153  </xsl:choose>
     154</xsl:template>
     155
    141156<xsl:template name="interface">
     157   <xsl:variable name="base">
     158     <xsl:call-template name="computeExtends">
     159       <xsl:with-param name="base" select="@extends" />
     160     </xsl:call-template>
     161   </xsl:variable>
    142162   <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
    143 class <xsl:value-of select="$ifname"/>:
     163
     164class <xsl:value-of select="$ifname"/>(<xsl:value-of select="$base" />):
    144165   def __init__(self, mgr, handle, isarray = False):
    145166       self.mgr = mgr
    146        if handle is None or handle == "":
     167       if handle is None:
    147168           raise Exception("bad handle: "+str(handle))
    148169       self.handle = handle
     
    191212   def __getattr__(self,name):
    192213      hndl = <xsl:value-of select="$ifname" />._Attrs_.get(name, None)
    193       if (hndl != None and hndl[0] != None):
    194          return hndl[0](self)
     214      if hndl != None:
     215         if hndl[0] != None:
     216           return hndl[0](self)
     217         else:
     218          raise AttributeError
    195219      else:
    196          raise AttributeError
     220         return <xsl:value-of select="$base" />.__getattr__(self, name)
    197221
    198222   def __setattr__(self, name, val):
     
    272296   <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
    273297class <xsl:value-of select="$ifname"/>:
    274     def __init__(self, mgr, handle):<xsl:for-each select="attribute">
    275        self.mgr = mgr
    276        self.<xsl:value-of select="@name"/> = handle._<xsl:value-of select="@name"/>
     298    def __init__(self, mgr, handle, isarray = False):
     299       self.mgr = mgr
     300       self.isarray = isarray
     301       if isarray:
     302          self.handle = handle
     303       else:
     304<xsl:for-each select="attribute">
     305          self.<xsl:value-of select="@name"/> = <xsl:call-template name="emitConvertedType">
     306              <xsl:with-param name="ifname" select="$ifname" />
     307              <xsl:with-param name="methodname" select="''" />
     308              <xsl:with-param name="type" select="@type" />
     309             </xsl:call-template>(self.mgr, handle._<xsl:value-of select="@name"/>)
    277310       </xsl:for-each>
     311          pass
    278312
    279313   <!-- also do getters/setters -->
     
    285319       raise Error, 'setters not supported'
    286320    </xsl:for-each>
     321
     322    def __next(self):
     323      if self.isarray:
     324          return self.handle.__next()
     325      raise TypeError, "iteration over non-sequence"
     326
     327    def __size(self):
     328      if self.isarray:         
     329          return self.handle.__size()
     330      raise TypeError, "iteration over non-sequence"
     331
     332    def __len__(self):
     333      if self.isarray:
     334          return self.handle.__len__()
     335      raise TypeError, "iteration over non-sequence"
     336
     337    def __getitem__(self, index):
     338      if self.isarray:
     339          return <xsl:value-of select="$ifname" />(self.mgr, self.handle[index])
     340      raise TypeError, "iteration over non-sequence"       
     341
    287342</xsl:template>
    288343
     
    435490  def __init__(self, mgr, handle, isarray = False):
    436491      self.handle = handle
     492      self.mgr = mgr
    437493      self.isarray = isarray
    438494 
     
    454510  def __getitem__(self, index):
    455511      if self.isarray:
    456           return String(self.handle[index])
     512          return String(self.mgr, self.handle[index])
    457513      raise TypeError, "iteration over non-sequence"       
    458514
    459515  def __str__(self):
    460       return self.handle
     516      return str(self.handle)
    461517
    462518  def __eq__(self,other):
     
    478534      return True
    479535
     536  def __add__(self,other):
     537      return str(self.handle)+str(other)
     538
    480539
    481540class UUID:
    482541  def __init__(self, mgr, handle, isarray = False):
    483542      self.handle = handle
     543      self.mgr = mgr
    484544      self.isarray = isarray
    485545 
     
    501561  def __getitem__(self, index):
    502562      if self.isarray:
    503           return UUID(self.handle[index])
     563          return UUID(self.mgr, self.handle[index])
    504564      raise TypeError, "iteration over non-sequence"       
    505565
     
    526586
    527587class Boolean:
    528   def __init__(self, mgr, handle, isarray = False):
    529        self.handle = handle
     588  def __init__(self, mgr, handle, isarray = False):       
     589       self.handle = handle
     590       if self.handle == "false":
     591          self.handle = None
     592       self.mgr = mgr
    530593       self.isarray = isarray
    531594 
     
    547610      return True
    548611
     612  def __int__(self):
     613       return 1 if self.handle else 0
     614
     615  def __long__(self):
     616       return 1 if self.handle else 0
     617
     618  def __nonzero__(self):
     619       return True if self.handle else False
     620
     621  def __next(self):
     622      if self.isarray:
     623          return self.handle.__next()
     624      raise TypeError, "iteration over non-sequence"
     625
     626  def __size(self):
     627      if self.isarray:         
     628          return self.handle.__size()
     629      raise TypeError, "iteration over non-sequence"
     630
     631  def __len__(self):
     632      if self.isarray:
     633          return self.handle.__len__()
     634      raise TypeError, "iteration over non-sequence"
     635
     636  def __getitem__(self, index):
     637      if self.isarray:
     638          return Boolean(self.mgr, self.handle[index])
     639      raise TypeError, "iteration over non-sequence"       
     640
    549641class UnsignedInt:
    550642  def __init__(self, mgr, handle, isarray = False):
    551643       self.handle = handle
     644       self.mgr = mgr
    552645       self.isarray = isarray
    553646 
     
    558651       return int(self.handle)
    559652
    560   def __next(self):
    561       if self.isarray:
    562           return self.handle.__next()
    563       raise TypeError, "iteration over non-sequence"
    564 
    565   def __size(self):
    566       if self.isarray:         
    567           return self.handle.__size()
    568       raise TypeError, "iteration over non-sequence"
    569 
    570   def __len__(self):
    571       if self.isarray:
    572           return self.handle.__len__()
    573       raise TypeError, "iteration over non-sequence"
    574 
    575   def __getitem__(self, index):
    576       if self.isarray:
    577           return UnsignedInt(self.handle[index])
     653  def __long__(self):
     654       return long(self.handle)
     655
     656  def __next(self):
     657      if self.isarray:
     658          return self.handle.__next()
     659      raise TypeError, "iteration over non-sequence"
     660
     661  def __size(self):
     662      if self.isarray:         
     663          return self.handle.__size()
     664      raise TypeError, "iteration over non-sequence"
     665
     666  def __len__(self):
     667      if self.isarray:
     668          return self.handle.__len__()
     669      raise TypeError, "iteration over non-sequence"
     670
     671  def __getitem__(self, index):
     672      if self.isarray:
     673          return UnsignedInt(self.mgr, self.handle[index])
    578674      raise TypeError, "iteration over non-sequence"       
    579675
     
    582678  def __init__(self, mgr, handle, isarray = False):
    583679       self.handle = handle
    584        self.isarray = isarray
    585 
    586   def __next(self):
    587       if self.isarray:
    588           return self.handle.__next()
    589       raise TypeError, "iteration over non-sequence"
    590 
    591   def __size(self):
    592       if self.isarray:         
    593           return self.handle.__size()
    594       raise TypeError, "iteration over non-sequence"
    595 
    596   def __len__(self):
    597       if self.isarray:
    598           return self.handle.__len__()
    599       raise TypeError, "iteration over non-sequence"
    600 
    601   def __getitem__(self, index):
    602       if self.isarray:
    603           return Int(self.handle[index])
     680       self.mgr = mgr
     681       self.isarray = isarray
     682
     683  def __next(self):
     684      if self.isarray:
     685          return self.handle.__next()
     686      raise TypeError, "iteration over non-sequence"
     687
     688  def __size(self):
     689      if self.isarray:         
     690          return self.handle.__size()
     691      raise TypeError, "iteration over non-sequence"
     692
     693  def __len__(self):
     694      if self.isarray:
     695          return self.handle.__len__()
     696      raise TypeError, "iteration over non-sequence"
     697
     698  def __getitem__(self, index):
     699      if self.isarray:
     700          return Int(self.mgr, self.handle[index])
    604701      raise TypeError, "iteration over non-sequence"       
    605702 
     
    610707       return int(self.handle)
    611708
     709  def __long__(self):
     710       return long(self.handle)
     711
    612712class UnsignedShort:
    613713  def __init__(self, mgr, handle, isarray = False):
    614714       self.handle = handle
     715       self.mgr = mgr
    615716       self.isarray = isarray
    616717 
     
    621722       return int(self.handle)
    622723
     724  def __long__(self):
     725       return long(self.handle)
     726
     727  def __next(self):
     728      if self.isarray:
     729          return self.handle.__next()
     730      raise TypeError, "iteration over non-sequence"
     731
     732  def __size(self):
     733      if self.isarray:         
     734          return self.handle.__size()
     735      raise TypeError, "iteration over non-sequence"
     736
     737  def __len__(self):
     738      if self.isarray:
     739          return self.handle.__len__()
     740      raise TypeError, "iteration over non-sequence"
     741
     742  def __getitem__(self, index):
     743      if self.isarray:
     744          return UnsignedShort(self.mgr, self.handle[index])
     745      raise TypeError, "iteration over non-sequence"       
     746
    623747class Short:
    624748  def __init__(self, mgr, handle, isarray = False):
    625749       self.handle = handle
     750       self.mgr = mgr
     751       self.isarray = isarray
    626752 
    627753  def __str__(self):
     
    631757       return int(self.handle)
    632758
     759  def __long__(self):
     760       return long(self.handle)
     761
     762  def __next(self):
     763      if self.isarray:
     764          return self.handle.__next()
     765      raise TypeError, "iteration over non-sequence"
     766
     767  def __size(self):
     768      if self.isarray:         
     769          return self.handle.__size()
     770      raise TypeError, "iteration over non-sequence"
     771
     772  def __len__(self):
     773      if self.isarray:
     774          return self.handle.__len__()
     775      raise TypeError, "iteration over non-sequence"
     776
     777  def __getitem__(self, index):
     778      if self.isarray:
     779          return Short(self.mgr, self.handle[index])
     780      raise TypeError, "iteration over non-sequence"
     781
    633782class UnsignedLong:
    634783  def __init__(self, mgr, handle, isarray = False):
    635784       self.handle = handle
     785       self.mgr = mgr
     786       self.isarray = isarray
    636787 
    637788  def __str__(self):
     
    641792       return int(self.handle)
    642793
     794  def __long__(self):
     795       return long(self.handle)
     796
     797  def __next(self):
     798      if self.isarray:
     799          return self.handle.__next()
     800      raise TypeError, "iteration over non-sequence"
     801
     802  def __size(self):
     803      if self.isarray:         
     804          return self.handle.__size()
     805      raise TypeError, "iteration over non-sequence"
     806
     807  def __len__(self):
     808      if self.isarray:
     809          return self.handle.__len__()
     810      raise TypeError, "iteration over non-sequence"
     811
     812  def __getitem__(self, index):
     813      if self.isarray:
     814          return UnsignedLong(self.mgr, self.handle[index])
     815      raise TypeError, "iteration over non-sequence"
     816
    643817class Long:
    644818  def __init__(self, mgr, handle, isarray = False):
    645819       self.handle = handle
    646  
     820       self.mgr = mgr
     821       self.isarray = isarray
     822
    647823  def __str__(self):
    648824       return str(self.handle)
     
    651827       return int(self.handle)
    652828
     829  def __long__(self):
     830       return int(self.handle)
     831
     832  def __next(self):
     833      if self.isarray:
     834          return self.handle.__next()
     835      raise TypeError, "iteration over non-sequence"
     836
     837  def __size(self):
     838      if self.isarray:         
     839          return self.handle.__size()
     840      raise TypeError, "iteration over non-sequence"
     841
     842  def __len__(self):
     843      if self.isarray:
     844          return self.handle.__len__()
     845      raise TypeError, "iteration over non-sequence"
     846
     847  def __getitem__(self, index):
     848      if self.isarray:
     849          return Long(self.mgr, self.handle[index])
     850      raise TypeError, "iteration over non-sequence"
     851
    653852class Double:
    654853  def __init__(self, mgr, handle, isarray = False):
    655854       self.handle = handle
     855       self.mgr = mgr
     856       self.isarray = isarray
    656857 
    657858  def __str__(self):
     
    661862       return int(self.handle)
    662863
     864  def __float__(self):
     865       return float(self.handle)
     866
     867  def __next(self):
     868      if self.isarray:
     869          return self.handle.__next()
     870      raise TypeError, "iteration over non-sequence"
     871
     872  def __size(self):
     873      if self.isarray:         
     874          return self.handle.__size()
     875      raise TypeError, "iteration over non-sequence"
     876
     877  def __len__(self):
     878      if self.isarray:
     879          return self.handle.__len__()
     880      raise TypeError, "iteration over non-sequence"
     881
     882  def __getitem__(self, index):
     883      if self.isarray:
     884          return Double(self.mgr, self.handle[index])
     885      raise TypeError, "iteration over non-sequence"
     886
    663887class Float:
    664888  def __init__(self, mgr, handle, isarray = False):
    665889       self.handle = handle
    666        
     890       self.mgr = mgr       
     891       self.isarray = isarray
     892
    667893  def __str__(self):
    668894       return str(self.handle)
     
    671897       return int(self.handle)
    672898
     899  def __float__(self):
     900       return float(self.handle)
     901
     902  def __next(self):
     903      if self.isarray:
     904          return self.handle.__next()
     905      raise TypeError, "iteration over non-sequence"
     906
     907  def __size(self):
     908      if self.isarray:         
     909          return self.handle.__size()
     910      raise TypeError, "iteration over non-sequence"
     911
     912  def __len__(self):
     913      if self.isarray:
     914          return self.handle.__len__()
     915      raise TypeError, "iteration over non-sequence"
     916
     917  def __getitem__(self, index):
     918      if self.isarray:
     919          return Float(self.mgr, self.handle[index])
     920      raise TypeError, "iteration over non-sequence"
    673921
    674922class IUnknown:
     
    677925       self.mgr = mgr
    678926       self.isarray = isarray
     927
     928  def __nonzero__(self):
     929       return True if self.handle != "" else False
    679930
    680931  def __next(self):
     
    700951  def __str__(self):
    701952       return str(self.handle)
     953
     954  def __getattr__(self,attr):
     955       if self.__class__.__dict__.get(attr) != None:
     956           return self.__class__.__dict__.get(attr)
     957       if self.__dict__.get(attr) != None:
     958           return self.__dict__.get(attr)
     959       raise AttributeError
    702960
    703961</xsl:text>
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