Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17967/mfc
Modified Files:
Tag: py3k
activex.py afxres.py dialog.py docview.py object.py thread.py
window.py
Log Message:
Changes for Python 3
Index: window.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/window.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** window.py 5 Jan 2000 04:10:56 -0000 1.2
--- window.py 29 Aug 2008 06:16:42 -0000 1.2.4.1
***************
*** 1,4 ****
! # The MFCish window classes.
! import object
import win32ui
import win32con
--- 1,3 ----
! from . import object
import win32ui
import win32con
Index: activex.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/activex.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** activex.py 18 Apr 2005 13:36:47 -0000 1.3
--- activex.py 29 Aug 2008 06:16:42 -0000 1.3.4.1
***************
*** 29,33 ****
def HookOleEvents(self):
dict = self._GetEventMap()
! for dispid, methodName in dict.items():
if hasattr(self, methodName):
self._obj_.HookOleEvent( getattr(self, methodName), dispid )
--- 29,33 ----
def HookOleEvents(self):
dict = self._GetEventMap()
! for dispid, methodName in list(dict.items()):
if hasattr(self, methodName):
self._obj_.HookOleEvent( getattr(self, methodName), dispid )
Index: dialog.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/dialog.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** dialog.py 27 Nov 1999 07:57:38 -0000 1.3
--- dialog.py 29 Aug 2008 06:16:42 -0000 1.3.4.1
***************
*** 7,11 ****
import win32ui
import win32con
! import window
def dllFromDll(dllid):
--- 7,11 ----
import win32ui
import win32con
! from . import window
def dllFromDll(dllid):
***************
*** 19,23 ****
dllid.GetFileName()
except AttributeError:
! raise TypeError, "DLL parameter must be None, a filename or a dll object"
return dllid
--- 19,23 ----
dllid.GetFileName()
except AttributeError:
! raise TypeError("DLL parameter must be None, a filename or a dll object")
return dllid
***************
*** 60,72 ****
self._obj_.datalist.append(args)
# Make a dialog object look like a dictionary for the DDX support
! def __nonzero__(self):
return 1
def __len__(self): return len(self.data)
def __getitem__(self, key): return self.data[key]
def __setitem__(self, key, item): self._obj_.data[key] = item# self.UpdateData(0)
! def keys(self): return self.data.keys()
! def items(self): return self.data.items()
! def values(self): return self.data.values()
! def has_key(self, key): return self.data.has_key(key)
class PrintDialog(Dialog):
--- 60,72 ----
self._obj_.datalist.append(args)
# Make a dialog object look like a dictionary for the DDX support
! def __bool__(self):
return 1
def __len__(self): return len(self.data)
def __getitem__(self, key): return self.data[key]
def __setitem__(self, key, item): self._obj_.data[key] = item# self.UpdateData(0)
! def keys(self): return list(self.data.keys())
! def items(self): return list(self.data.items())
! def values(self): return list(self.data.values())
! def has_key(self, key): return key in self.data
class PrintDialog(Dialog):
***************
*** 83,87 ****
self.dll=dllFromDll(dllid)
if type(dlgID)==type([]): # a template
! raise TypeError, "dlgID parameter must be an integer resource ID"
dlg=win32ui.CreatePrintDialog(dlgID, printSetupOnly,
flags, parent,
--- 83,87 ----
self.dll=dllFromDll(dllid)
if type(dlgID)==type([]): # a template
! raise TypeError("dlgID parameter must be an integer resource ID")
dlg=win32ui.CreatePrintDialog(dlgID, printSetupOnly,
flags, parent,
***************
*** 233,237 ****
dlg=DlgSimpleInput( prompt, defValue, title)
! if dlg.DoModal() <> win32con.IDOK:
return None
return dlg['result']
--- 233,237 ----
dlg=DlgSimpleInput( prompt, defValue, title)
! if dlg.DoModal() != win32con.IDOK:
return None
return dlg['result']
Index: afxres.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/afxres.py,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** afxres.py 10 Jan 2006 04:28:40 -0000 1.2
--- afxres.py 29 Aug 2008 06:16:42 -0000 1.2.4.1
***************
*** 54,58 ****
AFX_IDW_DOCKBAR_BOTTOM = 0xE81E
AFX_IDW_DOCKBAR_FLOAT = 0xE81F
! def AFX_CONTROLBAR_MASK(nIDC): return (1L << (nIDC - AFX_IDW_CONTROLBAR_FIRST))
AFX_IDW_PANE_FIRST = 0xE900
--- 54,58 ----
AFX_IDW_DOCKBAR_BOTTOM = 0xE81E
AFX_IDW_DOCKBAR_FLOAT = 0xE81F
! def AFX_CONTROLBAR_MASK(nIDC): return (1 << (nIDC - AFX_IDW_CONTROLBAR_FIRST))
AFX_IDW_PANE_FIRST = 0xE900
Index: object.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/object.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** object.py 10 Jan 2006 04:37:14 -0000 1.3
--- object.py 29 Aug 2008 06:16:42 -0000 1.3.4.1
***************
*** 21,29 ****
# we dont want this exception
if attr[0]!= '_' and attr[-1] != '_':
! raise win32ui.error, "The MFC object has died."
except KeyError:
# No _obj_ at all - dont report MFC object died when there isnt one!
pass
! raise AttributeError, attr
def OnAttachedObjectDeath(self):
--- 21,29 ----
# we dont want this exception
if attr[0]!= '_' and attr[-1] != '_':
! raise win32ui.error("The MFC object has died.")
except KeyError:
# No _obj_ at all - dont report MFC object died when there isnt one!
pass
! raise AttributeError(attr)
def OnAttachedObjectDeath(self):
***************
*** 31,35 ****
self._obj_ = None
def close(self):
! if self.__dict__.has_key('_obj_'):
if self._obj_ is not None:
self._obj_.AttachObject(None)
--- 31,35 ----
self._obj_ = None
def close(self):
! if '_obj_' in self.__dict__:
if self._obj_ is not None:
self._obj_.AttachObject(None)
Index: docview.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/docview.py,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** docview.py 1 Sep 1999 23:33:52 -0000 1.1
--- docview.py 29 Aug 2008 06:16:42 -0000 1.1.4.1
***************
*** 2,7 ****
import win32ui
import win32con
! import object
! import window
class View(window.Wnd):
--- 2,7 ----
import win32ui
import win32con
! from . import object
! from . import window
class View(window.Wnd):
Index: thread.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/thread.py,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -C2 -d -r1.3 -r1.3.4.1
*** thread.py 6 May 2000 12:04:10 -0000 1.3
--- thread.py 29 Aug 2008 06:16:42 -0000 1.3.4.1
***************
*** 1,5 ****
! # Thread and application objects
!
! import object
import win32ui
--- 1,3 ----
! from . import object
import win32ui
|