[pywin32-checkins] /hgroot/pywin32/pywin32: 3 new changesets
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2012-07-09 07:04:36
|
changeset 490c80b1b8ce in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=490c80b1b8ce summary: add a struct without a GUID to the pycom test object changeset 1a053eff8b4a in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=1a053eff8b4a summary: fix check for null guid when generating support code for structs changeset 16707e6f1624 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=16707e6f1624 summary: various hacks to get Python 3.3 support building with vs2010 diffstat: Pythonwin/Scintilla/win32/scintilla_vc6.mak | 2 +- com/TestSources/PyCOMTest/PyCOMTest.idl | 5 + com/win32com/__init__.py | 5 +- com/win32com/client/genpy.py | 4 +- pywin32_postinstall.py | 6 +- setup.py | 46 ++++++++---- win32/PythonService EXE.dsp | 103 ---------------------------- 7 files changed, 47 insertions(+), 124 deletions(-) diffs (281 lines): diff -r c71db94c80b4 -r 16707e6f1624 Pythonwin/Scintilla/win32/scintilla_vc6.mak --- a/Pythonwin/Scintilla/win32/scintilla_vc6.mak Thu Jun 21 20:49:58 2012 -0400 +++ b/Pythonwin/Scintilla/win32/scintilla_vc6.mak Mon Jul 09 17:04:08 2012 +1000 @@ -42,7 +42,7 @@ CXXNDEBUG=-O1 -MT -DNDEBUG NAME=-Fo # If you have problems with lexers being linked, try removing -OPT:REF and replacing with -OPT:NOREF -LDFLAGS=-OPT:NOWIN98 -OPT:REF +#LDFLAGS=-OPT:NOWIN98 -OPT:REF LDDEBUG= LIBS=KERNEL32.lib USER32.lib GDI32.lib IMM32.lib OLE32.LIB NOLOGO=-nologo diff -r c71db94c80b4 -r 16707e6f1624 com/TestSources/PyCOMTest/PyCOMTest.idl --- a/com/TestSources/PyCOMTest/PyCOMTest.idl Thu Jun 21 20:49:58 2012 -0400 +++ b/com/TestSources/PyCOMTest/PyCOMTest.idl Mon Jul 09 17:04:08 2012 +1000 @@ -84,6 +84,11 @@ int int_value; BSTR str_value; } TestStruct1; + typedef [version(1.0)] + struct tagStructWithoutUUID { + int int_value; + BSTR str_value; + } StructWithoutUUID; // Test enumerators. [ diff -r c71db94c80b4 -r 16707e6f1624 com/win32com/__init__.py --- a/com/win32com/__init__.py Thu Jun 21 20:49:58 2012 -0400 +++ b/com/win32com/__init__.py Mon Jul 09 17:04:08 2012 +1000 @@ -87,7 +87,10 @@ if not __gen_path__: try: import win32com.gen_py - __gen_path__ = sys.modules["win32com.gen_py"].__path__[0] + # hrmph - 3.3 throws: TypeError: '_NamespacePath' object does not support indexing + # attempting to get __path__[0] - but I can't quickly repro this stand-alone. + # Work around it by using an iterator. + __gen_path__ = next(iter(sys.modules["win32com.gen_py"].__path__)) except ImportError: # If a win32com\gen_py directory already exists, then we use it # (gencache doesn't insist it have an __init__, but our __import__ diff -r c71db94c80b4 -r 16707e6f1624 com/win32com/client/genpy.py --- a/com/win32com/client/genpy.py Thu Jun 21 20:49:58 2012 -0400 +++ b/com/win32com/client/genpy.py Mon Jul 09 17:04:08 2012 +1000 @@ -896,8 +896,8 @@ print >> stream, 'RecordMap = {' for record in recordItems.itervalues(): - if str(record.clsid) == pythoncom.IID_NULL: - print >> stream, "\t###%s: %s, # Typedef disabled because it doesn't have a non-null GUID" % (repr(record.doc[0]), repr(str(record.clsid))) + if record.clsid == pythoncom.IID_NULL: + print >> stream, "\t###%s: %s, # Record disabled because it doesn't have a non-null GUID" % (repr(record.doc[0]), repr(str(record.clsid))) else: print >> stream, "\t%s: %s," % (repr(record.doc[0]), repr(str(record.clsid))) print >> stream, "}" diff -r c71db94c80b4 -r 16707e6f1624 pywin32_postinstall.py --- a/pywin32_postinstall.py Thu Jun 21 20:49:58 2012 -0400 +++ b/pywin32_postinstall.py Mon Jul 09 17:04:08 2012 +1000 @@ -455,8 +455,12 @@ mfc_dll = "mfc42.dll" elif sys.hexversion < 0x2060000: mfc_dll = "mfc71.dll" + elif sys.hexversion < 0x2070000: + mfc_dll = "mfc90.dll" + elif sys.hexversion < 0x3000000: + mfc_dll = "mfc90u.dll" else: - mfc_dll = "mfc90.dll" + mfc_dll = "mfc100u.dll" try: # It might be next to pythonwin itself (which is where setup.py # currently arranges for it to be installed...) diff -r c71db94c80b4 -r 16707e6f1624 setup.py --- a/setup.py Thu Jun 21 20:49:58 2012 -0400 +++ b/setup.py Mon Jul 09 17:04:08 2012 +1000 @@ -1,4 +1,4 @@ -build_id="217" # may optionally include a ".{patchno}" suffix. +build_id="217.1" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) __doc__="""This is a distutils setup-script for the pywin32 extensions @@ -295,10 +295,12 @@ break def monkeypatched_link(self, target_desc, objects, output_filename, *args, **kw): - self._want_assembly_kept = os.path.basename(output_filename).startswith("PyISAPI_loader.dll") or \ - os.path.basename(output_filename).startswith("perfmondata.dll") or \ - os.path.basename(output_filename).startswith("win32ui.pyd") or \ - target_desc==self.EXECUTABLE + # no manifests for 3.3+ + self._want_assembly_kept = sys.version_info < (3,3) and \ + (os.path.basename(output_filename).startswith("PyISAPI_loader.dll") or \ + os.path.basename(output_filename).startswith("perfmondata.dll") or \ + os.path.basename(output_filename).startswith("win32ui.pyd") or \ + target_desc==self.EXECUTABLE) try: return self._orig_link(target_desc, objects, output_filename, *args, **kw) finally: @@ -985,9 +987,10 @@ largs.append("/IMPLIB:" + os.path.join(build_temp, "PythonCOMLoader"+suffix+".lib")) largs.append(obj) self.spawn(largs) - # and the manifest - out_arg = '-outputresource:%s;2' % (dll,) - self.spawn(['mt.exe', '-nologo', '-manifest', temp_manifest, out_arg]) + # and the manifest if one exists. + if os.path.isfile(temp_manifest): + out_arg = '-outputresource:%s;2' % (dll,) + self.spawn(['mt.exe', '-nologo', '-manifest', temp_manifest, out_arg]) def build_extensions(self): # First, sanity-check the 'extensions' list @@ -1033,7 +1036,7 @@ # Not sure how to make this completely generic, and there is no # need at this stage. - if sys.version_info > (2,6): + if sys.version_info > (2,6) and sys.version_info < (3, 3): # only stuff built with msvc9 needs this loader. self._build_pycom_loader() self._build_scintilla() @@ -1066,25 +1069,35 @@ raise RuntimeError("Can't find %r" % (src,)) self.copy_file(src, target_dir) else: + # vs2008 or vs2010 + if sys.hexversion < 0x3030000: + product_key = r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC" + plat_dir_64 = "amd64" + mfc_dir = "Microsoft.VC90.MFC" + mfc_files = "mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.MFC.manifest".split() + else: + product_key = r"SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VC" + plat_dir_64 = "x64" + mfc_dir = "Microsoft.VC100.MFC" + mfc_files = ["mfc100u.dll", "mfcm100u.dll"] + # On a 64bit host, the value we are looking for is actually in # SysWow64Node - but that is only available on xp and later. access = _winreg.KEY_READ if sys.getwindowsversion()[0] >= 5: access = access | 512 # KEY_WOW64_32KEY if self.plat_name == 'win-amd64': - plat_dir = "amd64" + plat_dir = plat_dir_64 else: plat_dir = "x86" # Find the redist directory. - vckey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, - r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", + vckey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, product_key, 0, access) val, val_typ = _winreg.QueryValueEx(vckey, "ProductDir") - mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") + mfc_dir = os.path.join(val, "redist", plat_dir, mfc_dir) if not os.path.isdir(mfc_dir): raise RuntimeError("Can't find the redist dir at %r" % (mfc_dir)) - files = "mfc90.dll mfc90u.dll mfcm90.dll mfcm90u.dll Microsoft.VC90.MFC.manifest".split() - for f in files: + for f in mfc_files: self.copy_file( os.path.join(mfc_dir, f), target_dir) except (EnvironmentError, RuntimeError), exc: @@ -2144,7 +2157,8 @@ W32_exe_files = [ WinExt_win32("pythonservice", - dsp_file = "win32/PythonService EXE.dsp", + sources=[os.path.join("win32", "src", s) for s in + "PythonService.cpp PythonService.rc".split()], unicode_mode = True, extra_link_args=["/SUBSYSTEM:CONSOLE"], libraries = "user32 advapi32 ole32 shell32"), diff -r c71db94c80b4 -r 16707e6f1624 win32/PythonService EXE.dsp --- a/win32/PythonService EXE.dsp Thu Jun 21 20:49:58 2012 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -# Microsoft Developer Studio Project File - Name="PythonService EXE" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=PythonService EXE - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "PythonService EXE.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "PythonService EXE.mak" CFG="PythonService EXE - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "PythonService EXE - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "PythonService EXE - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName ""$/win32", YFAAAAAA" -# PROP Scc_LocalPath "." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "PythonService EXE - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\PythonService EXE\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\PythonServiceExe\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "NDEBUG" /D "STRICT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0xc09 /d "NDEBUG" -# ADD RSC /l 0xc09 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 Advapi32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Build\PythonService.exe" /implib:"Build\PythonService_exe.lib" /libpath:"./Build" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "PythonService EXE - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\PythonService EXE\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\PythonServiceExe\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "_DEBUG" /D "STRICT" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0xc09 /d "_DEBUG" -# ADD RSC /l 0xc09 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Advapi32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Build\PythonService_d.exe" /pdbtype:sept /libpath:".\Build" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "PythonService EXE - Win32 Release" -# Name "PythonService EXE - Win32 Debug" -# Begin Source File - -SOURCE=.\src\PythonService.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\PythonService.rc -# End Source File -# End Target -# End Project |