VirtualBox

Ignore:
Timestamp:
Aug 4, 2009 2:33:02 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50658
Message:

Python shell: handle subtel COM/XPCOM difference

File:
1 edited

Legend:

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

    r21956 r21959  
    9393
    9494class VBoxMonitor:
    95     def __init__(self, vbox):
    96         self.vbox = vbox
     95    def __init__(self, params):
     96        self.vbox = params[0]
     97        self.isMscom = params[1]
    9798        pass
    9899
     
    105106    def onExtraDataCanChange(self, id, key, value):
    106107        print "onExtraDataCanChange: %s %s=>%s" %(id, key, value)
    107         return True, ""
     108        # Witty COM bridge thinks if someone wishes to return tuple, hresult
     109        # is one of values we want to return
     110        if self.isMscom:
     111            return True, "", 0
     112        else:
     113            return True, ""
    108114
    109115    def onExtraDataChange(self, id, key, value):
     
    315321def monitorVBox(ctx, dur):
    316322    vbox = ctx['vb']
    317     cb = ctx['global'].createCallback('IVirtualBoxCallback', VBoxMonitor, vbox)
     323    isMscom = (ctx['global'].type == 'MSCOM')
     324    cb = ctx['global'].createCallback('IVirtualBoxCallback', VBoxMonitor, [vbox, isMscom])
     325   
    318326    vbox.registerCallback(cb)
    319327    if dur == -1:
     
    326334    # We need to catch all exceptions here, otherwise callback will never be unregistered
    327335    except:
    328         if g_verbose:
    329                 traceback.print_exc()
     336        pass
    330337    vbox.unregisterCallback(cb)
    331338
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