VirtualBox

Changeset 103329 in vbox


Ignore:
Timestamp:
Feb 13, 2024 1:33:35 AM (10 months ago)
Author:
vboxsync
Message:

Main/vboxapi.py: Fixed regression in PerfCollector.query(). g_curXcptClass shall not start with a 'cur', but either 'Cur' or 'oCur'. Simplified the _g_dCOMForward setup again. bugref:10579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/python/vboxapi.py

    r103072 r103329  
    147147             indices, lengths) = self.collector.queryMetricsData(names, objects)
    148148        out = []
    149         for i in enumerate(names_out):
     149        for i, _ in enumerate(names_out):
    150150            scale = int(scales[i])
    151151            if scale != 1:
     
    473473        # Hack the COM dispatcher base class so we can modify method and
    474474        # attribute names to match those in xpcom.
    475         if 'getattr' not in _g_dCOMForward:
    476             _g_dCOMForward['getattr'] = DispatchBaseClass.__dict__['__getattr__']
     475        if 'setattr' not in _g_dCOMForward:
     476            _g_dCOMForward['getattr'] = DispatchBaseClass.__dict__['__getattr__'] # before setattr which we test for.
     477            _g_dCOMForward['setattr'] = DispatchBaseClass.__dict__['__setattr__']
    477478            setattr(DispatchBaseClass, '__getattr__', _CustomGetAttr)
    478 
    479         if 'setattr' not in _g_dCOMForward:
    480             _g_dCOMForward['setattr'] = DispatchBaseClass.__dict__['__setattr__']
    481479            setattr(DispatchBaseClass, '__setattr__', _CustomSetAttr)
    482480
     
    586584
    587585    def createListener(self, oImplClass, dArgs):
     586        _ = oImplClass; _ = dArgs;
    588587        raise Exception('no active listeners on Windows as PyGatewayBase::QueryInterface() '
    589588                        'returns new gateway objects all the time, thus breaking EventQueue '
     
    769768        notDocumentedDict['BaseClass'] = oImplClass
    770769        notDocumentedDict['dArgs'] = dArgs
    771         sEval = ""
     770        sEval  = ""
    772771        sEval += "import xpcom.components\n"
    773772        sEval += "class ListenerImpl(BaseClass):\n"
     
    902901        notDocumentedDict = {}
    903902        notDocumentedDict['oIUnknown'] = oIUnknown
    904         sEval = ""
     903        sEval  = ""
    905904        sEval += "from VirtualBox_wrappers import " + sClassName + "\n"
    906905        sEval += "result = " + sClassName + "(oIUnknown.mgr, oIUnknown.handle)\n"
     
    943942# This is reinitalized whenever VirtualBoxManager is called, so it will hold
    944943# the reference to the error exception class for the last platform/style that
    945 # was used.  Most clients does talk to multiple VBox instance on different
     944# was used.  Most clients does not talk to multiple VBox instance on different
    946945# platforms at the same time, so this should be sufficent for most uses and
    947946# be way simpler to use than VirtualBoxManager::oXcptClass.
    948 g_curXcptClass = None
     947g_oCurXcptClass = None
    949948
    950949
     
    10051004        ## The exception class for the selected platform.
    10061005        self.oXcptClass = self.platform.xcptGetBaseXcpt()
    1007         global g_curXcptClass
    1008         g_curXcptClass = self.oXcptClass
     1006        global g_oCurXcptClass
     1007        g_oCurXcptClass = self.oXcptClass
    10091008
    10101009        # Get the virtualbox singleton.
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