Changeset 282

Show
Ignore:
Timestamp:
09/11/02 13:12:39 (6 years ago)
Author:
sholloway
Message:

*** empty log message ***

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBJabber/RBJabber/SubjectObserver/Subject.py

    r260 r282  
    7878    def _ObserverList(self): 
    7979        """Returns the internal observer collection pruned of invalid weakref objects as a list""" 
    80         self._observers = [x for x in self._observers if x[-1]] 
    81         self._observers = filter(None, self._observers) 
     80        self._observers[:] = [x for x in self._observers if x[-1]] 
    8281        return [x[-1] for x in self._observers] 
    8382    Observers = property(_ObserverList) 
  • trunk/RBSkinning/RBSkinning/wxPythonSkin/activex.py

    r279 r282  
    2525 
    2626from wxSkinLayoutObject import wx, wxSkinLayoutObject 
    27 from wxPython.lib.activexwrapper import MakeActiveXClass 
     27from Foundation.wxTools.wxActiveXWrapper import wxActiveXControlFactory 
    2828from win32com.client import gencache, dynamic 
    2929import pywintypes 
     
    4545        #'clsid': None, 
    4646 
    47         'eventClass': 'None', 
     47        'eventClasses': 'tuple()', 
    4848        'eventObj': 'None', 
    4949        }) 
     
    5454 
    5555    def SkinInitialize(self): 
    56         ClassIndex = self.settings.get('progid', None) or self.settings['clsid'] 
    57         CoClass = gencache.GetClassForProgID(ClassIndex) 
    58         if not CoClass: 
    59             # Well, we might not have a cached one... so lets go find the TypeLib 
    60             dis = dynamic.Dispatch(pywintypes.IID(ClassIndex)) 
    61             tlbAttr = dis._lazydata_[0].GetContainingTypeLib()[0].GetLibAttr() 
    62             # Now gencache it 
    63             CoTLB = gencache.EnsureModule(tlbAttr[0], tlbAttr[1], tlbAttr[3], tlbAttr[4]) 
    64             # And try Aagain 
    65             CoClass = gencache.GetClassForProgID(ClassIndex) 
    66             if not CoClass: 
    67                 # Dang... still didn't work 
    68                 raise KeyError, "ActiveX class not found for %r (%r)" % (ClassIndex, ) 
     56        CoClass = self.GetAXControlCoClass() 
    6957 
    7058        # Prepare to make the ActiveX class that we can instantiate 
    71         kwAXSettings = self.wxSettingDict(['eventClass', 'eventObj'], []) 
    72         ActiveXClass = MakeActiveXClass(CoClass, **kwAXSettings) 
     59        kwAXSettings = self.wxSettingDict(['eventClasses', 'eventObj'], []) 
     60        ActiveXClass = wxActiveXControlFactory(CoClass, **kwAXSettings) 
    7361 
    7462        # Find the necessary things to instantiate the ActiveX control 
    7563        winParent = self.wxGetParentObject(wx.wxWindowPtr) 
    7664        kwSettings = self.wxSettingDict(['wxid', 'style', 'pos', 'size'], []) 
    77         kwSettings['ID'] = kwSettings['id']; del kwSettings['id'] 
    7865 
    7966        # Make the ActiveX Control Instance! 
     
    8774        self.wxFinalStandardOptions() 
    8875 
     76    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     77 
     78    def GetAXControlCoClass(self): 
     79        ClassIndex = self.settings.get('progid', None) or self.settings['clsid'] 
     80        CoClass = gencache.GetClassForProgID(ClassIndex) 
     81        if not CoClass: 
     82            # Well, we might not have a cached one... so lets go find the TypeLib 
     83            dis = dynamic.Dispatch(pywintypes.IID(ClassIndex)) 
     84            tlbAttr = dis._lazydata_[0].GetContainingTypeLib()[0].GetLibAttr() 
     85            # Now gencache it 
     86            TLB = gencache.EnsureModule(tlbAttr[0], tlbAttr[1], tlbAttr[3], tlbAttr[4]) 
     87            # And try Aagain 
     88            CoClass = gencache.GetClassForProgID(ClassIndex) 
     89            if not CoClass: 
     90                # Dang... still didn't work 
     91                raise KeyError, "ActiveX class not found for %r (%r)" % (ClassIndex, ) 
     92        return CoClass 
     93 
     94    def GetAXControlModule(self): 
     95        ClassIndex = self.settings.get('progid', None) or self.settings['clsid'] 
     96        module = gencache.GetModuleForProgID(ClassIndex) 
     97        if not module: 
     98            # Well, we might not have a cached one... so lets go find the TypeLib 
     99            dis = dynamic.Dispatch(pywintypes.IID(ClassIndex)) 
     100            tlbAttr = dis._lazydata_[0].GetContainingTypeLib()[0].GetLibAttr() 
     101            # Now gencache it 
     102            TLB = gencache.EnsureModule(tlbAttr[0], tlbAttr[1], tlbAttr[3], tlbAttr[4]) 
     103            # And try Aagain 
     104            module = gencache.GetModuleForProgID(ClassIndex) 
     105            if not module: 
     106                # Dang... still didn't work 
     107                raise KeyError, "ActiveX class not found for %r (%r)" % (ClassIndex, ) 
     108        return module 
     109