[pywin32-checkins] pywin32/com/win32com/client __init__.py, 1.36, 1.37
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-11-26 08:39:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18639/com/win32com/client Modified Files: __init__.py Log Message: various syntax modernizations Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** __init__.py 14 Nov 2008 00:22:25 -0000 1.36 --- __init__.py 26 Nov 2008 08:39:33 -0000 1.37 *************** *** 11,15 **** import pythoncom ! import dynamic, gencache import sys import pywintypes --- 11,16 ---- import pythoncom ! import dynamic ! import gencache import sys import pywintypes *************** *** 258,266 **** clsid = disp_class.CLSID # Create a new class that derives from 3 classes - the dispatch class, the event sink class and the user class. ! import new events_class = getevents(clsid) if events_class is None: raise ValueError("This COM object does not support events.") ! result_class = new.classobj("COMEventClass", (disp_class, events_class, user_event_class), {"__setattr__" : _event_setattr_}) instance = result_class(disp._oleobj_) # This only calls the first base class __init__. events_class.__init__(instance, instance) --- 259,272 ---- clsid = disp_class.CLSID # Create a new class that derives from 3 classes - the dispatch class, the event sink class and the user class. ! # XXX - we are still "classic style" classes in py2x, so we need can't yet ! # use 'type()' everywhere - revisit soon, as py2x will move to new-style too... ! try: ! from types import ClassType as new_type ! except ImportError: ! new_type = type # py3k events_class = getevents(clsid) if events_class is None: raise ValueError("This COM object does not support events.") ! result_class = new_type("COMEventClass", (disp_class, events_class, user_event_class), {"__setattr__" : _event_setattr_}) instance = result_class(disp._oleobj_) # This only calls the first base class __init__. events_class.__init__(instance, instance) |