pywin32-checkins Mailing List for Python for Windows Extensions (Page 30)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@us...> - 2009-01-05 12:51:33
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/Pythonwin/pywin/framework/editor Modified Files: Tag: py3k ModuleBrowser.py document.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/document.py,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -C2 -d -r1.11.2.2 -r1.11.2.3 *** document.py 2 Oct 2008 13:06:36 -0000 1.11.2.2 --- document.py 5 Jan 2009 12:51:26 -0000 1.11.2.3 *************** *** 36,41 **** self.scModuleName=GetEditorOption("Source Control Module", "") self.scModule = None # Loaded when first used. ! # Skip the direct parent ! object.CmdTarget.__init__(self, template.CreateWin32uiDocument()) def OnCloseDocument(self ): --- 36,40 ---- self.scModuleName=GetEditorOption("Source Control Module", "") self.scModule = None # Loaded when first used. ! ParentEditorDocument.__init__(self, template, template.CreateWin32uiDocument()) def OnCloseDocument(self ): Index: ModuleBrowser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/ModuleBrowser.py,v retrieving revision 1.8.4.4 retrieving revision 1.8.4.5 diff -C2 -d -r1.8.4.4 -r1.8.4.5 *** ModuleBrowser.py 4 Dec 2008 07:32:05 -0000 1.8.4.4 --- ModuleBrowser.py 5 Jan 2009 12:51:26 -0000 1.8.4.5 *************** *** 24,28 **** else: ret.append(HierListCLBRClass( item) ) ! ret.sort(key=lambda i:i.GetText()) return ret def IsExpandable(self): --- 24,28 ---- else: ret.append(HierListCLBRClass( item) ) ! ret.sort() return ret def IsExpandable(self): *************** *** 79,83 **** for meth, lineno in self.methods.items(): r2.append(HierListCLBRMethod(meth, self.file, lineno)) ! r2.sort(key=lambda m:m.GetText()) return r1+r2 def IsExpandable(self): --- 79,83 ---- for meth, lineno in self.methods.items(): r2.append(HierListCLBRMethod(meth, self.file, lineno)) ! r2.sort() return r1+r2 def IsExpandable(self): |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:33
|
Update of /cvsroot/pywin32/pywin32/com/win32com In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32com Modified Files: Tag: py3k readme.htm Log Message: merge lots of changes (most via 2to3) from the trunk Index: readme.htm =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/readme.htm,v retrieving revision 1.15.4.1 retrieving revision 1.15.4.2 diff -C2 -d -r1.15.4.1 -r1.15.4.2 *** readme.htm 26 Nov 2008 07:17:39 -0000 1.15.4.1 --- readme.htm 5 Jan 2009 12:51:26 -0000 1.15.4.2 *************** *** 50,54 **** <h3>Recent Changes</h3> ! <h4>Lost of internal changes on the road to py3k</h4> <h4>win32com.axcontrol and win2con.internet</h4> --- 50,54 ---- <h3>Recent Changes</h3> ! <h4>Lots of internal changes on the road to py3k</h4> <h4>win32com.axcontrol and win2con.internet</h4> |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:33
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/win32wnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/win32/Demos/win32wnet Modified Files: Tag: py3k netresource.htm testwnet.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: testwnet.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32wnet/testwnet.py,v retrieving revision 1.2.4.4 retrieving revision 1.2.4.5 diff -C2 -d -r1.2.4.4 -r1.2.4.5 *** testwnet.py 11 Dec 2008 04:13:35 -0000 1.2.4.4 --- testwnet.py 5 Jan 2009 12:51:27 -0000 1.2.4.5 *************** *** 88,91 **** --- 88,95 ---- win32wnet.WNetCancelConnection2(localName, 0, 0) + # and one more time using WNetAddConnection3 + win32wnet.WNetAddConnection3(0, nr) + win32wnet.WNetCancelConnection2(localName, 0, 0) + # Only do the first share that succeeds. break Index: netresource.htm =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32wnet/netresource.htm,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** netresource.htm 2 Sep 1999 00:19:27 -0000 1.1 --- netresource.htm 5 Jan 2009 12:51:27 -0000 1.1.4.1 *************** *** 106,113 **** makes a connection to a network resource. The function can redirect a local device to the ! network resource. This function was written ! before the PyNETRESOURCE object was created and ! thus does not use PyNETRESOURCE in this release ! (this will be updated at a later date). The first four parameters correspond to the NETRESOURCE object that is being constructed for the Win32API --- 106,110 ---- makes a connection to a network resource. The function can redirect a local device to the ! network resource. The first four parameters correspond to the NETRESOURCE object that is being constructed for the Win32API *************** *** 121,124 **** --- 118,127 ---- WNetAddConnection3 is the only interface supported by Windows CE.</dd> + <dd>Note that this function has since been updated to optionally + accept a NETRESOURCE object making its signature almost + identical to the win32 version - see the pywin32 help for + more information. Also note that WNetAddConnection3 + is also implemented, which is similar to this function but + accepts a HWND as the first (or named) param. </dl> </dd> |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/bits/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32comext/bits/src Modified Files: Tag: py3k PyIBackgroundCopyFile2.cpp Log Message: merge lots of changes (most via 2to3) from the trunk Index: PyIBackgroundCopyFile2.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/bits/src/PyIBackgroundCopyFile2.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** PyIBackgroundCopyFile2.cpp 12 Feb 2008 00:10:57 -0000 1.2 --- PyIBackgroundCopyFile2.cpp 5 Jan 2009 12:51:27 -0000 1.2.2.1 *************** *** 32,46 **** if ( pIBCF2 == NULL ) return NULL; ! DWORD * RangeCount; ! PyObject *obRangeCount; ! BG_FILE_RANGE ** Ranges; ! PyObject *obRanges; if ( !PyArg_ParseTuple(args, ":GetFileRanges") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIBCF2->GetFileRanges( RangeCount, Ranges ); ! // PyObject_FreeDWORD(RangeCount); ! // PyObject_FreeBG_FILE_RANGE_LIST(Ranges); PY_INTERFACE_POSTCALL; --- 32,42 ---- if ( pIBCF2 == NULL ) return NULL; ! DWORD RangeCount; ! BG_FILE_RANGE *Ranges; if ( !PyArg_ParseTuple(args, ":GetFileRanges") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIBCF2->GetFileRanges( &RangeCount, &Ranges ); PY_INTERFACE_POSTCALL; *************** *** 48,55 **** if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIBCF2, IID_IBackgroundCopyFile2 ); - // *** The output argument RangeCount of type "DWORD *" was not processed *** - // The type 'DWORD *' (RangeCount) is unknown. - // *** The output argument Ranges of type "BG_FILE_RANGE **" was not processed *** - // The type 'BG_FILE_RANGE **' (Ranges) is unknown. Py_INCREF(Py_None); return Py_None; --- 44,47 ---- |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32comext/shell/src Modified Files: Tag: py3k PyIContextMenu2.cpp Log Message: merge lots of changes (most via 2to3) from the trunk Index: PyIContextMenu2.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu2.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** PyIContextMenu2.cpp 9 Aug 2008 01:53:01 -0000 1.1 --- PyIContextMenu2.cpp 5 Jan 2009 12:51:27 -0000 1.1.2.1 *************** *** 38,42 **** { PY_GATEWAY_METHOD; - PyObject *ret; HRESULT hr=InvokeViaPolicy("HandleMenuMsg", NULL, "INN", uMsg, PyWinObject_FromPARAM(wParam), --- 38,41 ---- |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32/com/win32com/servers In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32com/servers Modified Files: Tag: py3k PythonTools.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: PythonTools.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/servers/PythonTools.py,v retrieving revision 1.3.4.4 retrieving revision 1.3.4.5 diff -C2 -d -r1.3.4.4 -r1.3.4.5 *** PythonTools.py 6 Dec 2008 01:46:36 -0000 1.3.4.4 --- PythonTools.py 5 Jan 2009 12:51:26 -0000 1.3.4.5 *************** *** 6,11 **** def reload(self, module): ! # XXX - need py3k work for 'reload' ! if module in sys.modules: reload(sys.modules[module]) return "reload succeeded." --- 6,16 ---- def reload(self, module): ! # XXX - need py3k work for 'reload' ! if module in sys.modules: ! try: ! from imp import reload ! except ImportError: ! # builtin in py3k ! pass reload(sys.modules[module]) return "reload succeeded." |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32com/src Modified Files: Tag: py3k Register.cpp Log Message: merge lots of changes (most via 2to3) from the trunk Index: Register.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -C2 -d -r1.18.2.1 -r1.18.2.2 *** Register.cpp 29 Aug 2008 08:27:37 -0000 1.18.2.1 --- Register.cpp 5 Jan 2009 12:51:26 -0000 1.18.2.2 *************** *** 113,117 **** // And finally in the map of names to gateway IIDs. if (g_obPyCom_MapInterfaceNameToIID) { ! valueObject = PyString_FromString((char *)interfaceName); if (!valueObject) { Py_DECREF(keyObject); --- 113,117 ---- // And finally in the map of names to gateway IIDs. if (g_obPyCom_MapInterfaceNameToIID) { ! valueObject = PyWinCoreString_FromString(interfaceName); if (!valueObject) { Py_DECREF(keyObject); |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261 Modified Files: Tag: py3k CHANGES.txt pywin32_postinstall.py setup.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.25.2.4 retrieving revision 1.25.2.5 diff -C2 -d -r1.25.2.4 -r1.25.2.5 *** pywin32_postinstall.py 6 Dec 2008 01:48:26 -0000 1.25.2.4 --- pywin32_postinstall.py 5 Jan 2009 12:51:26 -0000 1.25.2.5 *************** *** 4,8 **** # and creates a pth file import os, sys, glob, shutil, time ! import winreg # Send output somewhere so it can be found if necessary... --- 4,8 ---- # and creates a pth file import os, sys, glob, shutil, time ! import winreg as winreg # Send output somewhere so it can be found if necessary... Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.81.2.12 retrieving revision 1.81.2.13 diff -C2 -d -r1.81.2.12 -r1.81.2.13 *** setup.py 28 Dec 2008 10:51:53 -0000 1.81.2.12 --- setup.py 5 Jan 2009 12:51:26 -0000 1.81.2.13 *************** *** 1,3 **** ! build_id="212.5" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) --- 1,3 ---- ! build_id="212.6" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) *************** *** 76,82 **** # using the 'imports' fixer and therefore start much faster... if is_py3k: ! import winreg as _winreg else: ! import _winreg # The rest of our imports. --- 76,82 ---- # using the 'imports' fixer and therefore start much faster... if is_py3k: ! import winreg as winreg else: ! import winreg # The rest of our imports. *************** *** 148,152 **** # landmark. DEBUG = False # can't use log.debug - not setup yet - HKLM = _winreg.HKEY_LOCAL_MACHINE # ack - 2to3 error - see http://bugs.python.org/issue3994 landmark = "include\\windows.h" # 1. The use might have their current environment setup for the --- 148,151 ---- *************** *** 163,169 **** # the "Platform SDK for Windows Server 2003 SP1" this is dead end. try: ! key = _winreg.OpenKey(HKLM, r"Software\Microsoft\MicrosoftSDK\Directories") ! sdkdir, ignore = _winreg.QueryValueEx(key, "Install Dir") except EnvironmentError: pass --- 162,168 ---- # the "Platform SDK for Windows Server 2003 SP1" this is dead end. try: ! key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\MicrosoftSDK\Directories") ! sdkdir, ignore = winreg.QueryValueEx(key, "Install Dir") except EnvironmentError: pass *************** *** 179,190 **** # only one with an "Install Dir" sub-value. try: ! key = _winreg.OpenKey(HKLM, r"Software\Microsoft\MicrosoftSDK\InstalledSDKs") i = 0 while True: ! guid = _winreg.EnumKey(key, i) ! guidkey = _winreg.OpenKey(key, guid) try: ! sdkdir, ignore = _winreg.QueryValueEx(guidkey, "Install Dir") except EnvironmentError: pass --- 178,189 ---- # only one with an "Install Dir" sub-value. try: ! key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\MicrosoftSDK\InstalledSDKs") i = 0 while True: ! guid = winreg.EnumKey(key, i) ! guidkey = winreg.OpenKey(key, guid) try: ! sdkdir, ignore = winreg.QueryValueEx(guidkey, "Install Dir") except EnvironmentError: pass *************** *** 201,207 **** # 4. Vista's SDK try: ! key = _winreg.OpenKey(HKLM, r"Software\Microsoft\Microsoft SDKs\Windows") ! sdkdir, ignore = _winreg.QueryValueEx(key, "CurrentInstallFolder") except EnvironmentError: pass --- 200,206 ---- # 4. Vista's SDK try: ! key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\Microsoft SDKs\Windows") ! sdkdir, ignore = winreg.QueryValueEx(key, "CurrentInstallFolder") except EnvironmentError: pass *************** *** 476,484 **** libs = kw.get("libraries", "") keyname = "SOFTWARE\Microsoft\Exchange\SDK" ! for root in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER: try: ! keyob = _winreg.OpenKey(root, keyname) ! value, type_id = _winreg.QueryValueEx(keyob, "INSTALLDIR") ! if type_id == _winreg.REG_SZ: sdk_install_dir = value break --- 475,483 ---- libs = kw.get("libraries", "") keyname = "SOFTWARE\Microsoft\Exchange\SDK" ! for root in winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CURRENT_USER: try: ! keyob = winreg.OpenKey(root, keyname) ! value, type_id = winreg.QueryValueEx(keyob, "INSTALLDIR") ! if type_id == winreg.REG_SZ: sdk_install_dir = value break *************** *** 908,912 **** # 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 --- 907,911 ---- # 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 *************** *** 916,924 **** plat_dir = "x86" # Find the redist directory. ! HKLM = _winreg.HKEY_LOCAL_MACHINE ! vckey = _winreg.OpenKey(HKLM, r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", 0, access) ! val, val_typ = _winreg.QueryValueEx(vckey, "ProductDir") mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") if not os.path.isdir(mfc_dir): --- 915,922 ---- plat_dir = "x86" # Find the redist directory. ! vckey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", 0, access) ! val, val_typ = winreg.QueryValueEx(vckey, "ProductDir") mfc_dir = os.path.join(val, "redist", plat_dir, "Microsoft.VC90.MFC") if not os.path.isdir(mfc_dir): *************** *** 1191,1194 **** --- 1189,1196 ---- swig_cmd.append("-dnone",) # we never use the .doc files. swig_cmd.extend(self.current_extension.extra_swig_commands) + if is_py3k: + swig_cmd.append("-DSWIG_PY3K") + else: + swig_cmd.append("-DSWIG_PY2K") target = swig_targets[source] try: *************** *** 1241,1245 **** # process so the child will wait for us. # XXX - hmm - a closer look at distutils shows it only uses win32api ! # if winreg fails - and this never should. Need to revisit this! # If self.root has a value, it means we are being "installed" into # some other directory than Python itself (eg, into a temp directory --- 1243,1247 ---- # process so the child will wait for us. # XXX - hmm - a closer look at distutils shows it only uses win32api ! # if _winreg fails - and this never should. Need to revisit this! # If self.root has a value, it means we are being "installed" into # some other directory than Python itself (eg, into a temp directory *************** *** 1309,1313 **** new_compiler = msvccompiler.MSVCCompiler() msvccompiler.get_build_version = gbv ! for key in save_env.keys(): os.environ[key] = save_env[key] --- 1311,1315 ---- new_compiler = msvccompiler.MSVCCompiler() msvccompiler.get_build_version = gbv ! for key in list(save_env.keys()): os.environ[key] = save_env[key] *************** *** 1342,1346 **** args.append(stamp_script) args.append("--version=%s" % (pywin32_version,)) - args.append("--description=Python extension module") args.append("--comments=http://pywin32.sourceforge.net") args.append("--original-filename=%s" % (os.path.basename(output_filename),)) --- 1344,1347 ---- *************** *** 1367,1371 **** build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(ext.lower()), obj, (src, ext)) ! for obj, (src, ext) in build.items()] decorated.sort() items = [item[1:] for item in decorated] --- 1368,1372 ---- build_order = ".i .mc .rc .cpp".split() decorated = [(build_order.index(ext.lower()), obj, (src, ext)) ! for obj, (src, ext) in list(build.items())] decorated.sort() items = [item[1:] for item in decorated] *************** *** 1444,1448 **** """), ("win32pdh", "", None), ! ("win32pipe", "", True, None, 'win32/src/win32pipe.i'), ("win32print", "winspool user32 gdi32", None, 0x0500), ("win32process", "advapi32 user32", None, 0x0500), --- 1445,1449 ---- """), ("win32pdh", "", None), ! ("win32pipe", "", None, None, 'win32/src/win32pipe.i win32/src/win32popen.cpp'), ("win32print", "winspool user32 gdi32", None, 0x0500), ("win32process", "advapi32 user32", None, 0x0500), *************** *** 1596,1605 **** # ActiveDebugging is a mess. See the comments in the docstring of this # module for details on getting it built. ! ## WinExt_win32com('axdebug', ! ## dsp_file=r"com\Active Debugging.dsp", ! ## libraries="axscript", ! ## pch_header = "stdafx.h", ! ## optional_headers = ["activdbg.h"], ! ## ), WinExt_win32com('internet'), WinExt_win32com('mapi', libraries="mapi32", pch_header="PythonCOM.h", --- 1597,1606 ---- # ActiveDebugging is a mess. See the comments in the docstring of this # module for details on getting it built. ! WinExt_win32com('axdebug', ! dsp_file=r"com\Active Debugging.dsp", ! libraries="axscript", ! pch_header = "stdafx.h", ! optional_headers = ["activdbg.h"], ! ), WinExt_win32com('internet'), WinExt_win32com('mapi', libraries="mapi32", pch_header="PythonCOM.h", Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.26.2.7 retrieving revision 1.26.2.8 diff -C2 -d -r1.26.2.7 -r1.26.2.8 *** CHANGES.txt 11 Dec 2008 05:45:21 -0000 1.26.2.7 --- CHANGES.txt 5 Jan 2009 12:51:26 -0000 1.26.2.8 *************** *** 9,12 **** --- 9,23 ---- ---------------- + * Added win32wnet.WNetAddConnection3 allowing a HWND to be specified for + authentication. + + * isapi: + * Refactored isapi.install primarily to support installing extensions into + the root of a site (Jason R. Coombs) + * New IIS6-only functionality HSE_REQ_EXEC_URL which avoids the need to use + a filter in most cases, including new demos for this. + * Other misc support functions (HSE_REQ_REPORT_UNHEALTHY, + HSE_REQ_GET_ANONYMOUS_TOKEN, etc) + * "Modernization" changes, instigated by py3k: *************** *** 63,67 **** * win32com.shell gets support for IContextMenu2 and IContextMenu3 ! * add win32api.GetNativeSystemInfo() Since build 211: --- 74,78 ---- * win32com.shell gets support for IContextMenu2 and IContextMenu3 ! * add win32api.GetNativeSystemInfo(), win32api.GetKeyboardLayout() Since build 211: |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/Pythonwin/pywin/framework Modified Files: Tag: py3k intpyapp.py scriptutils.py stdin.py toolmenu.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: toolmenu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/toolmenu.py,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** toolmenu.py 29 Aug 2008 06:16:42 -0000 1.3.4.1 --- toolmenu.py 5 Jan 2009 12:51:26 -0000 1.3.4.2 *************** *** 14,22 **** defaultToolMenuItems = [ ('Browser', 'win32ui.GetApp().OnViewBrowse(0,0)'), ! ('Browse PythonPath', 'from pywin.tools import browseProjects;browseProjects.Browse()'), ! ('Edit Python Path', 'from pywin.tools import regedit;regedit.EditRegistry()'), ! ('COM Makepy utility', 'from win32com.client import makepy;makepy.main()'), ! ('COM Browser', 'from win32com.client import combrowse;combrowse.main()'), ! ('Trace Collector Debugging tool', 'from pywin.tools import TraceCollector;TraceCollector.MakeOutputWindow()'), ] --- 14,22 ---- defaultToolMenuItems = [ ('Browser', 'win32ui.GetApp().OnViewBrowse(0,0)'), ! ('Browse PythonPath', 'from pywin.tools import browseProjects;browseProjects.Browse()'), ! ('Edit Python Path', 'from pywin.tools import regedit;regedit.EditRegistry()'), ! ('COM Makepy utility', 'from win32com.client import makepy;makepy.main()'), ! ('COM Browser', 'from win32com.client import combrowse;combrowse.main()'), ! ('Trace Collector Debugging tool', 'from pywin.tools import TraceCollector;TraceCollector.MakeOutputWindow()'), ] Index: intpyapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpyapp.py,v retrieving revision 1.11.2.7 retrieving revision 1.11.2.8 diff -C2 -d -r1.11.2.7 -r1.11.2.8 *** intpyapp.py 3 Jan 2009 04:45:17 -0000 1.11.2.7 --- intpyapp.py 5 Jan 2009 12:51:26 -0000 1.11.2.8 *************** *** 60,64 **** pywin.debugger.currentDebugger.close(1) except: - import traceback traceback.print_exc() return --- 60,63 ---- Index: stdin.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/stdin.py,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -C2 -d -r1.3.2.3 -r1.3.2.4 *** stdin.py 26 Nov 2008 09:03:28 -0000 1.3.2.3 --- stdin.py 5 Jan 2009 12:51:26 -0000 1.3.2.4 *************** *** 22,27 **** get_input_line = raw_input # py2x except NameError: ! import code ! get_input_line = code.InteractiveConsole.raw_input class Stdin: --- 22,26 ---- get_input_line = raw_input # py2x except NameError: ! get_input_line = input # py3k class Stdin: *************** *** 95,99 **** try: self.__get_line() ! except EOFError: # deal with cancellation of get_input_line dialog desired_size = len(self.buffer) # Be satisfied! --- 94,98 ---- try: self.__get_line() ! except (EOFError, KeyboardInterrupt): # deal with cancellation of get_input_line dialog desired_size = len(self.buffer) # Be satisfied! Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.18.2.4 retrieving revision 1.18.2.5 diff -C2 -d -r1.18.2.4 -r1.18.2.5 *** scriptutils.py 3 Jan 2009 04:45:17 -0000 1.18.2.4 --- scriptutils.py 5 Jan 2009 12:51:26 -0000 1.18.2.5 *************** *** 329,342 **** bWorked = 1 except: - ## ??? sys.exc_info is reset to (None, None, None) after some function calls - - ## Is this a 'feature' of py3k, or are we clearing an error somewhere ??? - exc_type, exc_value, exc_traceback=sys.exc_info() if interact.edit and interact.edit.currentView: interact.edit.currentView.EnsureNoPrompt() ! traceback.print_exception(exc_type, exc_value, exc_traceback) if interact.edit and interact.edit.currentView: interact.edit.currentView.AppendToPrompt([]) if debuggingType == RS_DEBUGGER_PM: ! debugger.pm(exc_traceback) sys.argv = oldArgv if insertedPath0: --- 329,339 ---- bWorked = 1 except: if interact.edit and interact.edit.currentView: interact.edit.currentView.EnsureNoPrompt() ! traceback.print_exc() if interact.edit and interact.edit.currentView: interact.edit.currentView.AppendToPrompt([]) if debuggingType == RS_DEBUGGER_PM: ! debugger.pm() sys.argv = oldArgv if insertedPath0: |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32com/client Modified Files: Tag: py3k __init__.py build.py genpy.py selecttlb.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.55.2.7 retrieving revision 1.55.2.8 diff -C2 -d -r1.55.2.7 -r1.55.2.8 *** genpy.py 4 Dec 2008 05:08:41 -0000 1.55.2.7 --- genpy.py 5 Jan 2009 12:51:26 -0000 1.55.2.8 *************** *** 205,211 **** val = vdesc[1] if sys.version_info <= (2,4) and (isinstance(val, int) or isinstance(val, int)): ! if val==0x80000000: # special case use = "0x80000000L" # 'L' for future warning ! elif val > 0x80000000 or val < 0: # avoid a FutureWarning use = int(val) else: --- 205,211 ---- val = vdesc[1] if sys.version_info <= (2,4) and (isinstance(val, int) or isinstance(val, int)): ! if val==0x80000000-1+1: # special case for py2.3 (and avoid 'L' syntax for py3k) use = "0x80000000L" # 'L' for future warning ! elif val > 0x80000000-1+1 or val < 0: # avoid a FutureWarning use = int(val) else: Index: selecttlb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/selecttlb.py,v retrieving revision 1.10.2.2 retrieving revision 1.10.2.3 diff -C2 -d -r1.10.2.2 -r1.10.2.3 *** selecttlb.py 31 Aug 2008 18:22:15 -0000 1.10.2.2 --- selecttlb.py 5 Jan 2009 12:51:26 -0000 1.10.2.3 *************** *** 32,35 **** --- 32,37 ---- rc = cmp(self.major, other.minor) return rc + def __lt__(self, other): # rich-cmp/py3k-friendly version + return self.__cmp__(other) < 0 def Resolve(self): *************** *** 139,145 **** return ret - def tlb_sort_key(tlb_item): - return tlb_item.ver_desc - def SelectTlb(title="Select Library", excludeFlags = 0): """Display a list of all the type libraries, and select one. Returns None if cancelled --- 141,144 ---- *************** *** 151,155 **** i.major = int(i.major, 16) i.minor = int(i.minor, 16) ! items.sort(key=tlb_sort_key) rc = pywin.dialogs.list.SelectFromLists(title, items, ["Type Library"]) if rc is None: --- 150,154 ---- i.major = int(i.major, 16) i.minor = int(i.minor, 16) ! items.sort() rc = pywin.dialogs.list.SelectFromLists(title, items, ["Type Library"]) if rc is None: Index: __init__.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v retrieving revision 1.34.4.6 retrieving revision 1.34.4.7 diff -C2 -d -r1.34.4.6 -r1.34.4.7 *** __init__.py 4 Dec 2008 05:08:41 -0000 1.34.4.6 --- __init__.py 5 Jan 2009 12:51:26 -0000 1.34.4.7 *************** *** 448,451 **** --- 448,455 ---- return cmp(self._oleobj_, other) + def __eq__(self, other): + other = getattr(other, "_oleobj_", other) + return self._oleobj_ == other + def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args): return self._get_good_object_( Index: build.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/build.py,v retrieving revision 1.31.2.6 retrieving revision 1.31.2.7 diff -C2 -d -r1.31.2.6 -r1.31.2.7 *** build.py 4 Dec 2008 05:08:41 -0000 1.31.2.6 --- build.py 5 Jan 2009 12:51:26 -0000 1.31.2.7 *************** *** 19,23 **** import sys import string - import builtins from keyword import iskeyword --- 19,22 ---- *************** *** 523,532 **** return demunge_leading_underscores(className) elif className == 'None': ! # assign to None is evil (and SyntaxError in 2.4) - note ! # that if it was a global it would get picked up below className = 'NONE' ! elif iskeyword(className): # all keywords are lower case ! return className.capitalize() ! elif is_global and hasattr(builtins, className): # builtins may be mixed case. If capitalizing it doesn't change it, # force to all uppercase (eg, "None", "True" become "NONE", "TRUE" --- 522,537 ---- return demunge_leading_underscores(className) elif className == 'None': ! # assign to None is evil (and SyntaxError in 2.4, even though ! # iskeyword says False there) - note that if it was a global ! # it would get picked up below className = 'NONE' ! elif iskeyword(className): ! # most keywords are lower case (except True, False etc in py3k) ! ret = className.capitalize() ! # but those which aren't get forced upper. ! if ret == className: ! ret = ret.upper() ! return ret ! elif is_global and hasattr(__builtins__, className): # builtins may be mixed case. If capitalizing it doesn't change it, # force to all uppercase (eg, "None", "True" become "NONE", "TRUE" |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32comext/axscript/client Modified Files: Tag: py3k error.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: error.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/error.py,v retrieving revision 1.9.2.4 retrieving revision 1.9.2.5 diff -C2 -d -r1.9.2.4 -r1.9.2.5 *** error.py 27 Nov 2008 11:31:05 -0000 1.9.2.4 --- error.py 5 Jan 2009 12:51:27 -0000 1.9.2.5 *************** *** 164,184 **** bits.extend(traceback.format_exception_only(exc_type, value)) ! # XXX - this block appears completely bogus??? The UTF8 ! # comment below is from well before py3k, so utf8 doesn't have ! # any special status in py2k. Most likely is that this was ! # simply an artifact of an invalid test (which remains - it ! # raises a RuntimeError with a *string* with extended ! # characters.) ! # Sadly, the test still fails in the same way if you raise a ! # Unicode string with an extended char. This block keeps the ! # tests passing, so it remains. ! # XXX - todo - read the above, and fix below! ! ! # all items in the list are utf8 courtesy of Python magically ! # converting unicode to utf8 before compilation. ! for i in range(len(bits)): ! if type(bits[i]) is str: ! #assert type(bits[i]) is str, type(bits[i]) ! bits[i] = bits[i].decode('utf8') self.description = ExpandTabs(''.join(bits)) --- 164,181 ---- bits.extend(traceback.format_exception_only(exc_type, value)) ! # XXX - this utf8 encoding seems bogus. From well before py3k, ! # we had the comment: ! # > all items in the list are utf8 courtesy of Python magically ! # > converting unicode to utf8 before compilation. ! # but that is likely just confusion from early unicode days; ! # Python isn't doing it, pywin32 probably was, so 'mbcs' would ! # be the default encoding. We should never hit this these days ! # anyway, but on py3k, we *never* will, and str objects there ! # don't have a decode method... ! if sys.version_info < (3,): ! for i in range(len(bits)): ! if type(bits[i]) is str: ! #assert type(bits[i]) is str, type(bits[i]) ! bits[i] = bits[i].decode('utf8') self.description = ExpandTabs(''.join(bits)) |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/Pythonwin/pywin/idle Modified Files: Tag: py3k AutoIndent.py CallTips.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: CallTips.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/CallTips.py,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** CallTips.py 29 Aug 2008 06:16:42 -0000 1.3.2.1 --- CallTips.py 5 Jan 2009 12:51:26 -0000 1.3.2.2 *************** *** 4,8 **** import string import sys ! import types class CallTips: --- 4,9 ---- import string import sys ! import inspect ! import traceback class CallTips: *************** *** 101,105 **** # constructor (ie, __init__() ) or None if we can't find one. try: ! return class_ob.__init__.__func__ except AttributeError: for base in class_ob.__bases__: --- 102,109 ---- # constructor (ie, __init__() ) or None if we can't find one. try: ! if sys.version_info < (3,): ! return class_ob.__init__.im_func ! else: ! return class_ob.__init__.__func__ except AttributeError: for base in class_ob.__bases__: *************** *** 113,146 **** if ob is not None: argOffset = 0 ! if type(ob)==type: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None - else: - argOffset = 1 - elif type(ob)==types.MethodType: - # bit of a hack for methods - turn it into a function - # but we drop the "self" param. - fob = ob.__func__ - argOffset = 1 else: fob = ob ! # Try and build one for Python defined functions ! if type(fob) in [types.FunctionType, types.LambdaType]: try: ! realArgs = fob.__code__.co_varnames[argOffset:fob.__code__.co_argcount] ! defaults = fob.__defaults__ or [] ! defaults = list(["=%s" % name for name in defaults]) ! defaults = [""] * (len(realArgs)-len(defaults)) + defaults ! items = list(map(lambda arg, dflt: arg+dflt, realArgs, defaults)) ! if fob.__code__.co_flags & 0x4: ! items.append("...") ! if fob.__code__.co_flags & 0x8: ! items.append("***") ! argText = ", ".join(items) ! argText = "(%s)" % argText except: ! pass # See if we can use the docstring if hasattr(ob, "__doc__"): --- 117,135 ---- if ob is not None: argOffset = 0 ! if inspect.isclass(ob): # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: fob = ob ! if inspect.isfunction(fob) or inspect.ismethod(fob): try: ! # py3k has a 'getfullargspec' which can handle py3k specific things. ! arg_getter = getattr(inspect, "getfullargspec", inspect.getargspec) ! argText = inspect.formatargspec(*arg_getter(fob)) except: ! print("Failed to format the args") ! traceback.print_exc() # See if we can use the docstring if hasattr(ob, "__doc__"): *************** *** 167,184 **** def t1(): "()" def t2(a, b=None): "(a, b=None)" ! def t3(a, *args): "(a, ...)" ! def t4(*args): "(...)" ! def t5(a, *args): "(a, ...)" ! def t6(a, b=None, *args, **kw): "(a, b=None, ..., ***)" class TC: ! "(a=None, ...)" ! def __init__(self, a=None, *b): "(a=None, ...)" ! def t1(self): "()" ! def t2(self, a, b=None): "(a, b=None)" ! def t3(self, a, *args): "(a, ...)" ! def t4(self, *args): "(...)" ! def t5(self, a, *args): "(a, ...)" ! def t6(self, a, b=None, *args, **kw): "(a, b=None, ..., ***)" def test( tests ): --- 156,173 ---- def t1(): "()" def t2(a, b=None): "(a, b=None)" ! def t3(a, *args): "(a, *args)" ! def t4(*args): "(*args)" ! def t5(a, *args): "(a, *args)" ! def t6(a, b=None, *args, **kw): "(a, b=None, *args, **kw)" class TC: ! "(self, a=None, *b)" ! def __init__(self, a=None, *b): "(self, a=None, *b)" ! def t1(self): "(self)" ! def t2(self, a, b=None): "(self, a, b=None)" ! def t3(self, a, *args): "(self, a, *args)" ! def t4(self, *args): "(self, *args)" ! def t5(self, a, *args): "(self, a, *args)" ! def t6(self, a, b=None, *args, **kw): "(self, a, b=None, *args, **kw)" def test( tests ): *************** *** 196,197 **** --- 185,187 ---- test(tests) + Index: AutoIndent.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/AutoIndent.py,v retrieving revision 1.3.2.8 retrieving revision 1.3.2.9 diff -C2 -d -r1.3.2.8 -r1.3.2.9 *** AutoIndent.py 3 Jan 2009 04:45:17 -0000 1.3.2.8 --- AutoIndent.py 5 Jan 2009 12:51:26 -0000 1.3.2.9 *************** *** 94,98 **** def config(self, **options): ! for key, value in list(options.items()): if key == 'usetabs': self.usetabs = value --- 94,98 ---- def config(self, **options): ! for key, value in options.items(): if key == 'usetabs': self.usetabs = value *************** *** 210,214 **** # the cursor is in or at leading indentation; just inject # an empty line at the start ! text.insert("insert linestart", '\r\n') return "break" indent = line[:i] --- 210,214 ---- # the cursor is in or at leading indentation; just inject # an empty line at the start ! text.insert("insert linestart", '\n') return "break" indent = line[:i] *************** *** 224,229 **** text.delete("insert") # start new line ! ## Line ending needs to be configured somewhere instead of hardcoded ! text.insert("insert", '\r\n') # adjust indentation for continuations and block --- 224,228 ---- text.delete("insert") # start new line ! text.insert("insert", '\n') # adjust indentation for continuations and block |
From: Mark H. <mha...@us...> - 2009-01-05 12:51:32
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/Pythonwin/pywin/tools Modified Files: Tag: py3k browseProjects.py browser.py hierlist.py Log Message: merge lots of changes (most via 2to3) from the trunk Index: hierlist.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/hierlist.py,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -C2 -d -r1.7.2.3 -r1.7.2.4 *** hierlist.py 27 Nov 2008 11:31:03 -0000 1.7.2.3 --- hierlist.py 5 Jan 2009 12:51:26 -0000 1.7.2.4 *************** *** 313,314 **** --- 313,331 ---- def GetSelectedBitmapColumn(self): return None # same as other + # for py3k/rich-comp sorting compatibility. + def __cmp__(self): + # this is always overridden, but to be sure... + return cmp(id(self), id(other)) + def __lt__(self, other): + try: + return self.__cmp__(self, other) < 0 + except TypeError: + # we want unrelated items to be sortable... + return id(self) < id(other) + # for py3k/rich-comp equality compatibility. + def __eq__(self, other): + try: + return __cmp__(self, other) == 0 + except TypeError: + # unrelated items compare false + return 0 Index: browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browser.py,v retrieving revision 1.10.2.5 retrieving revision 1.10.2.6 diff -C2 -d -r1.10.2.5 -r1.10.2.6 *** browser.py 4 Dec 2008 07:28:46 -0000 1.10.2.5 --- browser.py 5 Jan 2009 12:51:26 -0000 1.10.2.6 *************** *** 13,17 **** from types import * - special_names = [ '__doc__', '__name__', '__self__' ] --- 13,16 ---- *************** *** 24,32 **** self.knownExpandable = None if name: - assert type(name)==str, repr(name) # encode to mbcs if necessary self.name=name else: try: ! self.name=str(myobject.__name__) except (AttributeError, TypeError): try: --- 23,30 ---- self.knownExpandable = None if name: self.name=name else: try: ! self.name=myobject.__name__ except (AttributeError, TypeError): try: *************** *** 59,63 **** except (AttributeError, TypeError): pass ! if ob: lst.insert(0, HLIDocString( ob, "Doc" )) --- 57,65 ---- except (AttributeError, TypeError): pass ! # I don't quite grok descriptors enough to know how to ! # best hook them up. Eg: ! # >>> object.__getattribute__.__class__.__doc__ ! # <attribute '__doc__' of 'wrapper_descriptor' objects> ! if ob and isinstance(ob, str): lst.insert(0, HLIDocString( ob, "Doc" )) *************** *** 261,265 **** list: HLIList, ModuleType: HLIModule, - ## InstanceType : HLIInstance, CodeType : HLICode, BuiltinFunctionType : HLIBuiltinFunction, --- 263,266 ---- *************** *** 268,272 **** str : HLIString, int: HLIPythonObject, ! ## LongType: HLIPythonObject, float: HLIPythonObject, } --- 269,273 ---- str : HLIString, int: HLIPythonObject, ! ## LongType: HLIPythonObject, - hrm - fixme for py2k float: HLIPythonObject, } Index: browseProjects.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browseProjects.py,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** browseProjects.py 27 Nov 2008 11:31:03 -0000 1.3.2.2 --- browseProjects.py 5 Jan 2009 12:51:26 -0000 1.3.2.3 *************** *** 1,3 **** ! import hierlist, string, regutil, os import win32con, win32ui, win32api import commctrl --- 1,4 ---- ! import regutil, os ! from . import hierlist import win32con, win32ui, win32api import commctrl |
From: Mark H. <mha...@us...> - 2009-01-05 12:50:00
|
Update of /cvsroot/pywin32/pywin32/isapi/samples In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4191/samples Modified Files: Tag: py3k advanced.py redirector.py Log Message: first cut at 2to3-lovin' Index: advanced.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/samples/advanced.py,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** advanced.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 --- advanced.py 5 Jan 2009 12:49:52 -0000 1.2.4.2 *************** *** 5,8 **** --- 5,16 ---- # .py implementation file changes.) # * Custom command-line handling - both additional options and commands. + # * Using a query string - any part of the URL after a '?' is assumed to + # be "variable names" separated by '&' - we will print the values of + # these server variables. + # * If the tail portion of the URL is "ReportUnhealthy", IIS will be + # notified we are unhealthy via a HSE_REQ_REPORT_UNHEALTHY request. + # Whether this is acted upon depends on if the IIS health-checking + # tools are installed, but you should always see the reason written + # to the Windows event log - see the IIS documentation for more. from isapi import isapicon *************** *** 107,112 **** --- 115,133 ---- raise InternalReloadException + url = ecb.GetServerVariable("URL") + if url.endswith("ReportUnhealthy"): + ecb.ReportUnhealthy("I'm a little sick") + ecb.SendResponseHeaders("200 OK", "Content-Type: text/html\r\n\r\n", 0) print("<HTML><BODY>", file=ecb) + + queries = ecb.GetServerVariable("QUERY_STRING").split("&") + if queries: + print("<PRE>", file=ecb) + for q in queries: + val = ecb.GetServerVariable(q) + print("%s=%r" % (q, val), file=ecb) + print("</PRE><P/>", file=ecb) + print("This module has been imported", file=ecb) print("%d times" % (reload_counter,), file=ecb) Index: redirector.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/samples/redirector.py,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** redirector.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 --- redirector.py 5 Jan 2009 12:49:52 -0000 1.2.4.2 *************** *** 1,4 **** ! # This is a sample configuration file for an ISAPI filter and extension ! # written in Python. # # Please see README.txt in this directory, and specifically the --- 1,3 ---- ! # This is a sample ISAPI extension written in Python. # # Please see README.txt in this directory, and specifically the *************** *** 10,36 **** # this module and create your Extension and Filter objects. ! # This sample provides a very simple redirector. ! # It is implemented by a filter and an extension. ! # * The filter is installed globally, as all filters are. ! # * A Virtual Directory named "python" is setup. This dir has our ISAPI ! # extension as the only application, mapped to file-extension '*'. Thus, our ! # extension handles *all* requests in this directory. ! # The basic process is that the filter does URL rewriting, redirecting every ! # URL to our Virtual Directory. Our extension then handles this request, ! # forwarding the data from the proxied site. ! # So, the process is: ! # * URL of "index.html" comes in. ! # * Filter rewrites this to "/python/index.html" ! # * Our extension sees the full "/python/index.html", removes the leading ! # portion, and opens and forwards the remote URL. ! ! # This sample is very small - it avoid most error handling, etc. It is for ! # demonstration purposes only. from isapi import isapicon, threaded_extension - from isapi.simple import SimpleFilter import sys import traceback ! import urllib # sys.isapidllhandle will exist when we are loaded by the IIS framework. --- 9,25 ---- # this module and create your Extension and Filter objects. ! # This is the simplest possible redirector (or proxy) we can write. The ! # extension installs with a mask of '*' in the root of the site. ! # As an added bonus though, we optionally show how, on IIS6 and later, we ! # can use HSE_ERQ_EXEC_URL to ignore certain requests - in IIS5 and earlier ! # we can only do this with an ISAPI filter - see redirector_with_filter for ! # an example. If this sample is run on IIS5 or earlier it simply ignores ! # any excludes. from isapi import isapicon, threaded_extension import sys import traceback ! import urllib.request, urllib.parse, urllib.error ! import win32api # sys.isapidllhandle will exist when we are loaded by the IIS framework. *************** *** 41,49 **** # The site we are proxying. proxy = "http://www.python.org" - # The name of the virtual directory we install in, and redirect from. - virtualdir = "/python" ! # The ISAPI extension - handles requests in our virtual dir, and sends the ! # response to the client. class Extension(threaded_extension.ThreadPoolExtension): "Python sample Extension" --- 30,48 ---- # The site we are proxying. proxy = "http://www.python.org" ! # Urls we exclude (ie, allow IIS to handle itself) - all are lowered, ! # and these entries exist by default on Vista... ! excludes = ["/iisstart.htm", "/welcome.png"] ! ! # An "io completion" function, called when ecb.ExecURL completes... ! def io_callback(ecb, url, cbIO, errcode): ! # Get the status of our ExecURL ! httpstatus, substatus, win32 = ecb.GetExecURLStatus() ! print("ExecURL of %r finished with http status %d.%d, win32 status %d (%s)" % ( ! url, httpstatus, substatus, win32, win32api.FormatMessage(win32).strip())) ! # nothing more to do! ! ecb.DoneWithSession() ! ! # The ISAPI extension - handles all requests in the site. class Extension(threaded_extension.ThreadPoolExtension): "Python sample Extension" *************** *** 54,122 **** #print 'IIS dispatching "%s"' % (ecb.GetServerVariable("URL"),) url = ecb.GetServerVariable("URL") ! if url.startswith(virtualdir): ! new_url = proxy + url[len(virtualdir):] ! print("Opening", new_url) ! fp = urllib.urlopen(new_url) ! headers = fp.info() ! ecb.SendResponseHeaders("200 OK", str(headers) + "\r\n", False) ! ecb.WriteClient(fp.read()) ! ecb.DoneWithSession() ! print("Returned data from '%s'!" % (new_url,)) else: ! # this should never happen - we should only see requests that ! # start with our virtual directory name. ! print("Not proxying '%s'" % (url,)) ! ! ! # The ISAPI filter. ! class Filter(SimpleFilter): ! "Sample Python Redirector" ! filter_flags = isapicon.SF_NOTIFY_PREPROC_HEADERS | \ ! isapicon.SF_NOTIFY_ORDER_DEFAULT ! ! def HttpFilterProc(self, fc): ! #print "Filter Dispatch" ! nt = fc.NotificationType ! if nt != isapicon.SF_NOTIFY_PREPROC_HEADERS: ! return isapicon.SF_STATUS_REQ_NEXT_NOTIFICATION ! pp = fc.GetData() ! url = pp.GetHeader("url") ! #print "URL is '%s'" % (url,) ! prefix = virtualdir ! if not url.startswith(prefix): ! new_url = prefix + url ! print("New proxied URL is '%s'" % (new_url,)) ! pp.SetHeader("url", new_url) ! # For the sake of demonstration, show how the FilterContext ! # attribute is used. It always starts out life as None, and ! # any assignments made are automatically decref'd by the ! # framework during a SF_NOTIFY_END_OF_NET_SESSION notification. ! if fc.FilterContext is None: ! fc.FilterContext = 0 ! fc.FilterContext += 1 ! print("This is request number", fc.FilterContext, "on this connection") ! return isapicon.SF_STATUS_REQ_HANDLED_NOTIFICATION ! else: ! print("Filter ignoring URL '%s'" % (url,)) ! ! # Some older code that handled SF_NOTIFY_URL_MAP. ! #~ print "Have URL_MAP notify" ! #~ urlmap = fc.GetData() ! #~ print "URI is", urlmap.URL ! #~ print "Path is", urlmap.PhysicalPath ! #~ if urlmap.URL.startswith("/UC/"): ! #~ # Find the /UC/ in the physical path, and nuke it (except ! #~ # as the path is physical, it is \) ! #~ p = urlmap.PhysicalPath ! #~ pos = p.index("\\UC\\") ! #~ p = p[:pos] + p[pos+3:] ! #~ p = r"E:\src\pyisapi\webroot\PyTest\formTest.htm" ! #~ print "New path is", p ! #~ urlmap.PhysicalPath = p # The entry points for the ISAPI extension. - def __FilterFactory__(): - return Filter() def __ExtensionFactory__(): return Extension() --- 53,77 ---- #print 'IIS dispatching "%s"' % (ecb.GetServerVariable("URL"),) url = ecb.GetServerVariable("URL") ! if ecb.Version < 0x60000: ! print("IIS5 or earlier - can't do 'excludes'") else: ! for exclude in excludes: ! if url.lower().startswith(exclude): ! print("excluding %s" % url) ! ecb.IOCompletion(io_callback, url) ! ecb.ExecURL(None, None, None, None, None, isapicon.HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR) ! return isapicon.HSE_STATUS_PENDING ! new_url = proxy + url ! print("Opening %s" % new_url) ! fp = urllib.urlopen(new_url) ! headers = fp.info() ! ecb.SendResponseHeaders("200 OK", str(headers) + "\r\n", False) ! ecb.WriteClient(fp.read()) ! ecb.DoneWithSession() ! print("Returned data from '%s'!" % (new_url,)) ! return isapicon.HSE_STATUS_SUCCESS # The entry points for the ISAPI extension. def __ExtensionFactory__(): return Extension() *************** *** 126,134 **** from isapi.install import * params = ISAPIParameters() - # Setup all filters - these are global to the site. - params.Filters = [ - FilterParameters(Name="PythonRedirector", - Description=Filter.__doc__), - ] # Setup the virtual directories - this is a list of directories our # extension uses - in this case only 1. --- 81,84 ---- *************** *** 138,142 **** ScriptMapParams(Extension="*", Flags=0) ] ! vd = VirtualDirParameters(Name=virtualdir[1:], Description = Extension.__doc__, ScriptMaps = sm, --- 88,92 ---- ScriptMapParams(Extension="*", Flags=0) ] ! vd = VirtualDirParameters(Name="/", Description = Extension.__doc__, ScriptMaps = sm, |
From: Mark H. <mha...@us...> - 2009-01-05 12:49:58
|
Update of /cvsroot/pywin32/pywin32/isapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4191 Modified Files: Tag: py3k install.py isapicon.py Log Message: first cut at 2to3-lovin' Index: isapicon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/isapicon.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** isapicon.py 12 Oct 2006 07:00:37 -0000 1.2 --- isapicon.py 5 Jan 2009 12:49:52 -0000 1.2.4.1 *************** *** 112,113 **** --- 112,120 ---- HSE_IO_FINAL_SEND = 0x00000010 HSE_IO_CACHE_RESPONSE = 0x00000020 + + HSE_EXEC_URL_NO_HEADERS = 0x02 + HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR = 0x04 + HSE_EXEC_URL_IGNORE_VALIDATION_AND_RANGE = 0x10 + HSE_EXEC_URL_DISABLE_CUSTOM_ERROR = 0x20 + HSE_EXEC_URL_SSI_CMD = 0x40 + HSE_EXEC_URL_HTTP_CACHE_ELIGIBLE = 0x80 Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/install.py,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** install.py 26 Nov 2008 09:03:30 -0000 1.11.2.1 --- install.py 5 Jan 2009 12:49:52 -0000 1.11.2.2 *************** *** 4,7 **** --- 4,8 ---- # Created July 2004, Mark Hammond. import sys, os, imp, shutil, stat + import operator from win32com.client import GetObject, Dispatch from win32com.client.gencache import EnsureModule, EnsureDispatch *************** *** 34,42 **** _DEFAULT_ENABLE_DEFAULT_DOC = False ! is_debug_build = False ! for imp_ext, _, _ in imp.get_suffixes(): ! if imp_ext == "_d.pyd": ! is_debug_build = True ! break this_dir = os.path.abspath(os.path.dirname(__file__)) --- 35,40 ---- _DEFAULT_ENABLE_DEFAULT_DOC = False ! _extensions = [ext for ext, _, _ in imp.get_suffixes()] ! is_debug_build = '_d.pyd' in _extensions this_dir = os.path.abspath(os.path.dirname(__file__)) *************** *** 63,66 **** --- 61,65 ---- Headers = _DEFAULT_HEADERS Path = None # defaults to WWW root. + Type = _IIS_WEBVIRTUALDIR AccessExecute = _DEFAULT_ACCESS_EXECUTE AccessRead = _DEFAULT_ACCESS_READ *************** *** 77,80 **** --- 76,87 ---- def __init__(self, **kw): self.__dict__.update(kw) + + def is_root(self): + "This virtual directory is a root directory if parent and name are blank" + parent, name = self.split_path() + return not parent and not name + + def split_path(self): + return split_path(self.Name) class ScriptMapParams: *************** *** 92,95 **** --- 99,111 ---- self.__dict__.update(kw) + def __str__(self): + "Format this parameter suitable for IIS" + items = [self.Extension, self.Module, self.Flags] + # IIS gets upset if there is a trailing verb comma, but no verbs + if self.Verbs: + items.append(self.Verbs) + items = [str(item) for item in items] + return ','.join(items) + class ISAPIParameters: ServerName = _DEFAULT_SERVER_NAME *************** *** 107,114 **** # Convert an ADSI COM exception to the Win32 error code embedded in it. def _GetWin32ErrorCode(com_exc): ! hr, msg, exc, narg = com_exc ! # If we have more details in the 'exc' struct, use it. ! if exc: ! hr = exc[-1] if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32: raise --- 123,130 ---- # Convert an ADSI COM exception to the Win32 error code embedded in it. def _GetWin32ErrorCode(com_exc): ! hr = com_exc.hresult ! # If we have more details in the 'excepinfo' struct, use it. ! if com_exc.excepinfo: ! hr = com_exc.excepinfo[-1] if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32: raise *************** *** 127,185 **** return FindWebServer(options, server)+"/ROOT"+name ! def FindWebServer(options, server_desc): ! # command-line options get first go, and are assumed in 'mbcs' encoding ! # (well, assumed MBCS by the time they got to sys.argv...) ! if options.server: ! server_desc = options.server ! # but someone may have explicitly already set unicode... ! if type(server_desc) != unicode: ! server_desc = server_desc.decode("mbcs") ! # If the config passed by the caller doesn't specify one, use the default ! if not server_desc: ! server = _IIS_OBJECT+"/1" ! else: ! # Assume the user has passed either the instance_id or "server ! # description" - loop over all objects until we find it. ! ob = GetObject(_IIS_OBJECT) ! look = server_desc.lower().strip() ! for sub in ob: ! # ID is generally a number, but no need to assume that. ! this_id = getattr(sub, "Name", "").lower().strip() ! this_comment = getattr(sub, "ServerComment", "").lower().strip() ! if this_id == look or this_comment == look: ! server = sub.AdsPath ! break ! else: ! raise ItemNotFound( ! "No web sites match the description '%s'" % (server_desc,)) ! # Check it is good. try: ! GetObject(server) except pythoncom.com_error as details: ! hr, msg, exc, arg_err = details ! if exc and exc[2]: ! msg = exc[2] ! raise ItemNotFound( ! "WebServer %s: %s" % (server, msg)) return server ! def CreateDirectory(params, options): ! _CallHook(params, "PreInstall", options) ! if not params.Name: ! raise ConfigurationError("No Name param") ! slash = params.Name.rfind("/") ! if slash >= 0: ! parent = params.Name[:slash] ! name = params.Name[slash+1:] ! else: ! parent = "" ! name = params.Name ! webDir = GetObject(FindPath(options, params.Server, parent)) ! if parent: ! # Note that the directory won't be visible in the IIS UI ! # unless the directory exists on the filesystem. ! keyType = _IIS_WEBDIR ! else: ! keyType = _IIS_WEBVIRTUALDIR # We used to go to lengths to keep an existing virtual directory # in place. However, in some cases the existing directories got --- 143,235 ---- return FindWebServer(options, server)+"/ROOT"+name ! def LocateWebServerPath(description): ! """ ! Find an IIS web server whose name or comment matches the provided ! description (case-insensitive). ! ! >>> LocateWebServerPath('Default Web Site') # doctest: +SKIP ! ! or ! ! >>> LocateWebServerPath('1') #doctest: +SKIP ! """ ! assert len(description) >= 1, "Server name or comment is required" ! iis = GetObject(_IIS_OBJECT) ! description = description.lower().strip() ! for site in iis: ! # Name is generally a number, but no need to assume that. ! site_attributes = [getattr(site, attr, "").lower().strip() ! for attr in ("Name", "ServerComment")] ! if description in site_attributes: ! return site.AdsPath ! msg = "No web sites match the description '%s'" % description ! raise ItemNotFound(msg) ! ! def GetWebServer(description = None): ! """ ! Load the web server instance (COM object) for a given instance ! or description. ! If None is specified, the default website is retrieved (indicated ! by the identifier 1. ! """ ! description = description or "1" ! path = LocateWebServerPath(description) ! server = LoadWebServer(path) ! return server ! ! def LoadWebServer(path): try: ! server = GetObject(path) except pythoncom.com_error as details: ! msg = details.strerror ! if exc.excepinfo and exc.excepinfo[2]: ! msg = exc.excepinfo[2] ! msg = "WebServer %s: %s" % (path, msg) ! raise ItemNotFound(msg) return server ! def FindWebServer(options, server_desc): ! """ ! Legacy function to allow options to define a .server property ! to override the other parameter. Use GetWebServer instead. ! """ ! # options takes precedence ! server_desc = options.server or server_desc ! # make sure server_desc is unicode (could be mbcs if passed in ! # sys.argv). ! if server_desc and not isinstance(server_desc, str): ! server_desc = server_desc.decode('mbcs') ! ! # get the server (if server_desc is None, the default site is acquired) ! server = GetWebServer(server_desc) ! return server.adsPath ! ! def split_path(path): ! """ ! Get the parent path and basename. ! ! >>> split_path('/') ! ['', ''] ! ! >>> split_path('') ! ['', ''] ! ! >>> split_path('foo') ! ['', 'foo'] ! ! >>> split_path('/foo') ! ['', 'foo'] ! ! >>> split_path('/foo/bar') ! ['/foo', 'bar'] ! ! >>> split_path('foo/bar') ! ['/foo', 'bar'] ! """ ! ! if not path.startswith('/'): path = '/' + path ! return path.rsplit('/', 1) ! ! def _CreateDirectory(iis_dir, name, params): # We used to go to lengths to keep an existing virtual directory # in place. However, in some cases the existing directories got *************** *** 190,208 **** # Also seen the Class change to a generic IISObject - so nuke # *any* existing object, regardless of Class ! existing = GetObject(FindPath(options, params.Server, params.Name)) ! webDir.Delete(existing.Class, existing.Name) ! log(2, "Deleted old directory '%s'" % (params.Name,)) except pythoncom.com_error: pass ! newDir = webDir.Create(keyType, name) ! log(2, "Creating new directory '%s'..." % (params.Name,)) friendly = params.Description or params.Name newDir.AppFriendlyName = friendly try: ! path = params.Path or webDir.Path newDir.Path = path except AttributeError: pass newDir.AppCreate2(params.AppProtection) --- 240,262 ---- # Also seen the Class change to a generic IISObject - so nuke # *any* existing object, regardless of Class ! assert name.strip("/"), "mustn't delete the root!" ! iis_dir.Delete('', name) ! log(2, "Deleted old directory '%s'" % (name,)) except pythoncom.com_error: pass ! newDir = iis_dir.Create(params.Type, name) ! log(2, "Creating new directory '%s' in %s..." % (name,iis_dir.Name)) friendly = params.Description or params.Name newDir.AppFriendlyName = friendly + + # Note that the new directory won't be visible in the IIS UI + # unless the directory exists on the filesystem. try: ! path = params.Path or iis_dir.Path newDir.Path = path except AttributeError: + # If params.Type is IIS_WEBDIRECTORY, an exception is thrown pass newDir.AppCreate2(params.AppProtection) *************** *** 220,248 **** newDir.DefaultDoc = params.DefaultDoc newDir.SetInfo() - smp_items = [] - for smp in params.ScriptMaps: - item = "%s,%s,%s" % (smp.Extension, smp.Module, smp.Flags) - # IIS gets upset if there is a trailing verb comma, but no verbs - if smp.Verbs: - item += "," + smp.Verbs - smp_items.append(item) - if params.ScriptMapUpdate == "replace": - newDir.ScriptMaps = smp_items - elif params.ScriptMapUpdate == "end": - for item in smp_items: - if item not in newDir.ScriptMaps: - newDir.ScriptMaps = newDir.ScriptMaps + (item,) - elif params.ScriptMapUpdate == "start": - for item in smp_items: - if item not in newDir.ScriptMaps: - newDir.ScriptMaps = (item,) + newDir.ScriptMaps - else: - raise ConfigurationError( - "Unknown ScriptMapUpdate option '%s'" % (params.ScriptMapUpdate,)) - newDir.SetInfo() - _CallHook(params, "PostInstall", options, newDir) - log(1, "Configured Virtual Directory: %s" % (params.Name,)) return newDir def CreateISAPIFilter(filterParams, options): server = FindWebServer(options, filterParams.Server) --- 274,330 ---- newDir.DefaultDoc = params.DefaultDoc newDir.SetInfo() return newDir + + def CreateDirectory(params, options): + _CallHook(params, "PreInstall", options) + if not params.Name: + raise ConfigurationError("No Name param") + parent, name = params.split_path() + target_dir = GetObject(FindPath(options, params.Server, parent)) + + if not params.is_root(): + target_dir = _CreateDirectory(target_dir, name, params) + + AssignScriptMaps(params.ScriptMaps, target_dir, params.ScriptMapUpdate) + + _CallHook(params, "PostInstall", options, target_dir) + log(1, "Configured Virtual Directory: %s" % (params.Name,)) + return target_dir + + def AssignScriptMaps(script_maps, target, update='replace'): + """ + @param script_maps ScriptMapParameter[] + @param target An IIS Virtual Directory to assign the script maps + @param update How to update the maps ('start', 'end', or 'replace') + """ + # determine which function to use to assign script maps + script_map_func = '_AssignScriptMaps' + update.capitalize() + try: + script_map_func = eval(script_map_func) + except NameError: + msg = "Unknown ScriptMapUpdate option '%s'" % update + raise ConfigurationError(msg) + # use the str method to format the script maps for IIS + script_maps = [str(s) for s in script_maps] + # call the correct function + script_map_func(target, script_maps) + target.SetInfo() + + def get_unique_items(sequence, reference): + "Return items in sequence that can't be found in reference." + return tuple([item for item in sequence if item not in reference]) + + def _AssignScriptMapsReplace(target, script_maps): + target.ScriptMaps = script_maps + + def _AssignScriptMapsEnd(target, script_maps): + unique_new_maps = get_unique_items(script_maps, target.ScriptMaps) + target.ScriptMaps = target.ScriptMaps + unique_new_maps + + def _AssignScriptMapsStart(target, script_maps): + unique_new_maps = get_unique_items(script_maps, target.ScriptMaps) + target.ScriptMaps = unique_new_maps + target.ScriptMaps + def CreateISAPIFilter(filterParams, options): server = FindWebServer(options, filterParams.Server) *************** *** 250,261 **** try: filters = GetObject(server+"/Filters") ! except pythoncom.com_error as xxx_todo_changeme: ! # Brand new sites don't have the '/Filters' collection - create it. ! # Any errors other than 'not found' we shouldn't ignore. ! (hr, msg, exc, arg) = xxx_todo_changeme.args # Brand new sites don't have the '/Filters' collection - create it. # Any errors other than 'not found' we shouldn't ignore. ! if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32 or \ ! winerror.HRESULT_CODE(hr) != winerror.ERROR_PATH_NOT_FOUND: raise server_ob = GetObject(server) --- 332,340 ---- try: filters = GetObject(server+"/Filters") ! except pythoncom.com_error as exc: # Brand new sites don't have the '/Filters' collection - create it. # Any errors other than 'not found' we shouldn't ignore. ! if winerror.HRESULT_FACILITY(exc.hresult) != winerror.FACILITY_WIN32 or \ ! winerror.HRESULT_CODE(exc.hresult) != winerror.ERROR_PATH_NOT_FOUND: raise server_ob = GetObject(server) *************** *** 265,268 **** --- 344,348 ---- # As for VirtualDir, delete an existing one. + assert filterParams.Name.strip("/"), "mustn't delete the root!" try: filters.Delete(_IIS_FILTER, filterParams.Name) *************** *** 297,300 **** --- 377,381 ---- return try: + assert filterParams.Name.strip("/"), "mustn't delete the root!" filters.Delete(_IIS_FILTER, filterParams.Name) log(2, "Deleted ISAPI filter '%s'" % (filterParams.Name,)) *************** *** 411,414 **** --- 492,533 ---- _CallHook(params, "PostInstall", options) + def RemoveDirectory(params, options): + if params.is_root(): + return + try: + directory = GetObject(FindPath(options, params.Server, params.Name)) + except pythoncom.com_error as details: + rc = _GetWin32ErrorCode(details) + if rc != winerror.ERROR_PATH_NOT_FOUND: + raise + log(2, "VirtualDirectory '%s' did not exist" % params.Name) + directory = None + if directory is not None: + # Be robust should IIS get upset about unloading. + try: + directory.AppUnLoad() + except: + exc_val = sys.exc_info()[1] + log(2, "AppUnLoad() for %s failed: %s" % (params.Name, exc_val)) + # Continue trying to delete it. + try: + parent = GetObject(directory.Parent) + parent.Delete(directory.Class, directory.Name) + log (1, "Deleted Virtual Directory: %s" % (params.Name,)) + except: + exc_val = sys.exc_info()[1] + log(1, "Failed to remove directory %s: %s" % (params.Name, exc_val)) + + def RemoveScriptMaps(vd_params, options): + "Remove script maps from the already installed virtual directory" + parent, name = vd_params.split_path() + target_dir = GetObject(FindPath(options, vd_params.Server, parent)) + installed_maps = list(target_dir.ScriptMaps) + for _map in map(str, vd_params.ScriptMaps): + if _map in installed_maps: + installed_maps.remove(_map) + target_dir.ScriptMaps = installed_maps + target_dir.SetInfo() + def Uninstall(params, options): _CallHook(params, "PreRemove", options) *************** *** 418,444 **** for vd in params.VirtualDirs: _CallHook(vd, "PreRemove", options) ! try: ! directory = GetObject(FindPath(options, vd.Server, vd.Name)) ! except pythoncom.com_error as details: ! rc = _GetWin32ErrorCode(details) ! if rc != winerror.ERROR_PATH_NOT_FOUND: ! raise ! log(2, "VirtualDirectory '%s' did not exist" % vd.Name) ! directory = None ! if directory is not None: ! # Be robust should IIS get upset about unloading. ! try: ! directory.AppUnLoad() ! except: ! exc_val = sys.exc_info()[1] ! log(2, "AppUnLoad() for %s failed: %s" % (vd.Name, exc_val)) ! # Continue trying to delete it. ! try: ! parent = GetObject(directory.Parent) ! parent.Delete(directory.Class, directory.Name) ! log (1, "Deleted Virtual Directory: %s" % (vd.Name,)) ! except: ! exc_val = sys.exc_info()[1] ! log(1, "Failed to remove directory %s: %s" % (vd.Name, exc_val)) _CallHook(vd, "PostRemove", options) --- 537,546 ---- for vd in params.VirtualDirs: _CallHook(vd, "PreRemove", options) ! ! RemoveDirectory(vd, options) ! if vd.is_root(): ! # if this is installed to the root virtual directory, we can't delete it ! # so remove the script maps. ! RemoveScriptMaps(vd, options) _CallHook(vd, "PostRemove", options) *************** *** 487,491 **** return dll_name ! def InstallModule(conf_module_name, params, options): if not hasattr(sys, "frozen"): conf_module_name = os.path.abspath(conf_module_name) --- 589,600 ---- return dll_name ! # Note the 'log' params to these 'builtin' args - old versions of pywin32 ! # didn't log at all in this function (by intent; anyone calling this was ! # responsible). So existing code that calls this function with the old ! # signature (ie, without a 'log' param) still gets the same behaviour as ! # before... ! ! def InstallModule(conf_module_name, params, options, log=lambda *args:None): ! "Install the extension" if not hasattr(sys, "frozen"): conf_module_name = os.path.abspath(conf_module_name) *************** *** 496,510 **** _PatchParamsModule(params, loader_dll) Install(params, options) ! def UninstallModule(conf_module_name, params, options): loader_dll = GetLoaderModuleName(conf_module_name, False) _PatchParamsModule(params, loader_dll, False) Uninstall(params, options) standard_arguments = { ! "install" : "Install the extension", ! "remove" : "Remove the extension" } # We support 2 ways of extending our command-line/install support. # * Many of the installation items allow you to specify "PreInstall", --- 605,640 ---- _PatchParamsModule(params, loader_dll) Install(params, options) + log(1, "Installation complete.") ! def UninstallModule(conf_module_name, params, options, log=lambda *args:None): ! "Remove the extension" loader_dll = GetLoaderModuleName(conf_module_name, False) _PatchParamsModule(params, loader_dll, False) Uninstall(params, options) + log(1, "Uninstallation complete.") standard_arguments = { ! "install" : InstallModule, ! "remove" : UninstallModule, } + def build_usage(handler_map): + docstrings = [handler.__doc__ for handler in handler_map.values()] + all_args = dict(zip(iter(handler_map.keys()), docstrings)) + arg_names = "|".join(iter(all_args.keys())) + usage_string = "%prog [options] [" + arg_names + "]\n" + usage_string += "commands:\n" + for arg, desc in all_args.items(): + usage_string += " %-10s: %s" % (arg, desc) + "\n" + return usage_string[:-1] + + def MergeStandardOptions(options, params): + """ + Take an options object generated by the command line and merge + the values into the IISParameters object. + """ + pass + + # We support 2 ways of extending our command-line/install support. # * Many of the installation items allow you to specify "PreInstall", *************** *** 546,558 **** # build a usage string if we don't have one. if not parser.get_usage(): ! all_args = standard_arguments.copy() ! for arg, handler in custom_arg_handlers.items(): ! all_args[arg] = handler.__doc__ ! arg_names = "|".join(all_args.keys()) ! usage_string = "%prog [options] [" + arg_names + "]\n" ! usage_string += "commands:\n" ! for arg, desc in all_args.items(): ! usage_string += " %-10s: %s" % (arg, desc) + "\n" ! parser.set_usage(usage_string[:-1]) parser.add_option("-q", "--quiet", --- 676,686 ---- # build a usage string if we don't have one. if not parser.get_usage(): ! all_handlers = standard_arguments.copy() ! all_handlers.update(custom_arg_handlers) ! parser.set_usage(build_usage(all_handlers)) ! ! # allow the user to use uninstall as a synonym for remove if it wasn't ! # defined by the custom arg handlers. ! all_handlers.setdefault('uninstall', all_handlers['remove']) parser.add_option("-q", "--quiet", *************** *** 567,570 **** --- 695,699 ---- (options, args) = parser.parse_args(argv[1:]) + MergeStandardOptions(options, params) verbose = options.verbose if not args: *************** *** 572,588 **** try: for arg in args: ! if arg == "install": ! InstallModule(conf_module_name, params, options) ! log(1, "Installation complete.") ! elif arg in ["remove", "uninstall"]: ! UninstallModule(conf_module_name, params, options) ! log(1, "Uninstallation complete.") ! else: ! handler = custom_arg_handlers.get(arg, None) ! if handler is None: ! parser.error("Invalid arg '%s'" % (arg,)) ! handler(options, log, arg) except (ItemNotFound, InstallationError) as details: if options.verbose > 1: traceback.print_exc() print("%s: %s" % (details.__class__.__name__, details)) --- 701,710 ---- try: for arg in args: ! handler = all_handlers[arg] ! handler(conf_module_name, params, options, log) except (ItemNotFound, InstallationError) as details: if options.verbose > 1: traceback.print_exc() print("%s: %s" % (details.__class__.__name__, details)) + except KeyError: + parser.error("Invalid arg '%s'" % arg) |
From: Mark H. <mha...@us...> - 2009-01-05 12:49:58
|
Update of /cvsroot/pywin32/pywin32/isapi/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4191/test Modified Files: Tag: py3k extension_simple.py Log Message: first cut at 2to3-lovin' Index: extension_simple.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/test/extension_simple.py,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** extension_simple.py 26 Nov 2008 09:03:30 -0000 1.2.4.1 --- extension_simple.py 5 Jan 2009 12:49:52 -0000 1.2.4.2 *************** *** 10,14 **** from isapi.simple import SimpleFilter import traceback ! import urllib import winerror --- 10,14 ---- from isapi.simple import SimpleFilter import traceback ! import urllib.request, urllib.parse, urllib.error import winerror *************** *** 82,86 **** us = ecb.GetServerVariable("UNICODE_SERVER_NAME") ! if not isinstance(us, unicode): raise RuntimeError, "unexpected type!" if us != unicode(ecb.GetServerVariable("SERVER_NAME")): --- 82,86 ---- us = ecb.GetServerVariable("UNICODE_SERVER_NAME") ! if not isinstance(us, str): raise RuntimeError, "unexpected type!" if us != unicode(ecb.GetServerVariable("SERVER_NAME")): |
From: Mark H. <mha...@us...> - 2009-01-05 12:49:30
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4174/src Modified Files: Tag: py3k PyExtensionObjects.cpp PyExtensionObjects.h PyFilterObjects.h StdAfx.h Log Message: merge changes from trunk Index: StdAfx.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/StdAfx.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** StdAfx.h 6 Oct 2004 05:11:54 -0000 1.1 --- StdAfx.h 5 Jan 2009 12:49:22 -0000 1.1.4.1 *************** *** 35,38 **** --- 35,52 ---- #include "Python.h" + // No Py_RETURN_NONE in py23 + #if (PY_VERSION_HEX < 0x02040000) + /* Macro for returning Py_None from a function */ + #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None + #endif + + // include structmember here to deal with warnings related to WRITE_RESTRICTED + #ifdef WRITE_RESTRICTED + #undef WRITE_RESTRICTED + #endif + #include "structmember.h" + // avoid anyone accidently using the wrong WRITE_RESTRICTED... + #undef WRITE_RESTRICTED + //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. Index: PyExtensionObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** PyExtensionObjects.h 15 May 2008 10:57:09 -0000 1.5 --- PyExtensionObjects.h 5 Jan 2009 12:49:22 -0000 1.5.2.1 *************** *** 27,32 **** #include "ControlBlock.h" - - #include "structmember.h" #include "tupleobject.h" --- 27,30 ---- *************** *** 97,104 **** --- 95,107 ---- static PyObject * DoneWithSession(PyObject *self, PyObject * args); //HSE_REQ_DONE_WITH_SESSION static PyObject * GetImpersonationToken(PyObject *self, PyObject * args); // HSE_REQ_GET_IMPERSONATION_TOKEN + static PyObject * GetAnonymousToken(PyObject *self, PyObject * args); // HSE_REQ_GET_ANONYMOUS_TOKEN static PyObject * TransmitFile(PyObject *self, PyObject * args); // HSE_REQ_TRANSMIT_FILE static PyObject * MapURLToPath(PyObject *self, PyObject * args); // HSE_REQ_MAP_URL_TO_PATH static PyObject * IsKeepConn(PyObject *self, PyObject * args); // HSE_REQ_IS_KEEP_CONN static PyObject * SetFlushFlag(PyObject *self, PyObject * args); // HSE_REQ_SET_FLUSH_FLAG + static PyObject * ExecURL(PyObject *self, PyObject * args); // HSE_REQ_EXEC_URL + static PyObject * GetExecURLStatus(PyObject *self, PyObject * args); // HSE_REQ_GET_EXEC_URL_STATUS + static PyObject * IOCompletion(PyObject *self, PyObject * args); // HSE_REQ_IO_COMPLETION + static PyObject * ReportUnhealthy(PyObject *self, PyObject * args); // HSE_REQ_REPORT_UNHEALTHY static PyObject * IsSessionActive(PyObject *self, PyObject * args); Index: PyFilterObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.h,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** PyFilterObjects.h 22 Feb 2008 23:03:06 -0000 1.6 --- PyFilterObjects.h 5 Jan 2009 12:49:22 -0000 1.6.2.1 *************** *** 27,32 **** #include "FilterContext.h" - - #include "structmember.h" #include "tupleobject.h" --- 27,30 ---- Index: PyExtensionObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.cpp,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** PyExtensionObjects.cpp 3 Jul 2008 13:30:04 -0000 1.9 --- PyExtensionObjects.cpp 5 Jan 2009 12:49:22 -0000 1.9.2.1 *************** *** 29,32 **** --- 29,135 ---- #include "PythonEng.h" + // Asynch IO callbacks are a little tricky, as we never know how many + // callbacks a single connection might make (often each callback will trigger + // another IO request.) So we keep the Python objects used by the callback + // mechanism in a map, keyed by connection ID, of asynch callback handlers. + // Each element is a tuple of (callback, user_args). This is done rather than + // using the 'pContext' param of the callback to ensure lifetimes of the + // callback and the 'user arg' are maintained correctly. The item is removed + // as the HSE_REQ_DONE_WITH_SESSION callback is made, or of the callback + // raises an exception. + static PyObject *g_callbackMap = NULL; + + BOOL SetupIOCallback(EXTENSION_CONTROL_BLOCK *ecb, PyObject *ob) + { + if (!g_callbackMap) { + if (!(g_callbackMap = PyDict_New())) + return FALSE; + } + PyObject *key = PyLong_FromVoidPtr(ecb->ConnID); + if (!key) + return FALSE; + if (0!=PyDict_SetItem(g_callbackMap, key, ob)) { + Py_DECREF(key); + return FALSE; + } + Py_DECREF(key); + return TRUE; + } + + void CleanupIOCallback(EXTENSION_CONTROL_BLOCK *ecb) + { + if (!g_callbackMap) + return; + PyObject *key = PyLong_FromVoidPtr(ecb->ConnID); + if (!key) + return; // ack - not much more we can do. + if (!PyDict_DelItem(g_callbackMap, key)) + PyErr_Clear(); + Py_DECREF(key); + return; + } + + #define CALLBACK_ERROR(msg) {ExtensionError(NULL, msg);goto done;} + + extern "C" void WINAPI DoIOCallback(EXTENSION_CONTROL_BLOCK *ecb, PVOID pContext, DWORD cbIO, DWORD dwError) + { + CEnterLeavePython _celp; + CControlBlock * pcb = NULL; + PyECB *pyECB = NULL; + BOOL worked = FALSE; + PyObject *callback = NULL; + PyObject *user_arg = NULL; + PyObject *args = NULL; + PyObject *key = NULL; + PyObject *ob = NULL; + PyObject *result = NULL; + + if (!g_callbackMap) + CALLBACK_ERROR("Callback when no callback map exists"); + + key = PyLong_FromVoidPtr(ecb->ConnID); + if (!key) + CALLBACK_ERROR("Failed to create map key from connection ID"); + ob = PyDict_GetItem(g_callbackMap, key); + if (!ob) + CALLBACK_ERROR("Failed to locate map entry for this commID"); + // get the Python ECB object... + pcb = new CControlBlock(ecb); + pyECB = new PyECB(pcb); + if (!pyECB || !pcb) + CALLBACK_ERROR("Failed to create Python oject for ECB"); + + // this should be impossible... + if (!PyTuple_Check(ob) || (PyTuple_Size(ob)!=1 && PyTuple_Size(ob)!=2)) + CALLBACK_ERROR("Object in callback map not a tuple of correct size?"); + + callback = PyTuple_GET_ITEM(ob, 0); + user_arg = PyTuple_Size(ob)==2 ? PyTuple_GET_ITEM(ob, 1) : Py_None; + args = Py_BuildValue("(OOkk)", pyECB, user_arg, cbIO, dwError); + if (!args) + CALLBACK_ERROR("Failed to build callback args"); + result = PyObject_Call(callback, args, NULL); + Py_DECREF(args); + if (!result) + CALLBACK_ERROR("Callback failed"); + Py_DECREF(result); + worked = TRUE; + done: + // If the callback failed, then its likely this request will end + // up hanging. So on error we nuke ourselves from the map then + // call DoneWithSession. We still hold the GIL, so we should be + // safe from races... + Py_XDECREF(pyECB); + if (!worked) { + // free the item from the map. + CleanupIOCallback(ecb); + // clobber the callback. + ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_IO_COMPLETION, NULL, NULL,NULL); + // and tell IIS there we are done with an error. + DWORD status = HSE_STATUS_ERROR; + ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_DONE_WITH_SESSION, &status, NULL, 0); + } + } + // @doc // @object HSE_VERSION_INFO|An object used by ISAPI GetExtensionVersion *************** *** 124,128 **** // EXTENSION_CONTROL_BLOCK. struct memberlist PyECB::PyECB_memberlist[] = { ! {"Version", T_INT, ECBOFF(m_version), READONLY}, {"ConnID", T_INT, ECBOFF(m_connID), READONLY}, --- 227,232 ---- // EXTENSION_CONTROL_BLOCK. struct memberlist PyECB::PyECB_memberlist[] = { ! {"Version", T_INT, ECBOFF(m_version), READONLY}, ! // XXX - ConnID 64bit issue? {"ConnID", T_INT, ECBOFF(m_connID), READONLY}, *************** *** 156,161 **** --- 260,270 ---- {"Redirect", PyECB::Redirect,1}, // @pymeth Redirect| {"IsKeepAlive", PyECB::IsKeepAlive,1}, // @pymeth IsKeepAlive| + {"GetAnonymousToken", PyECB::GetAnonymousToken, 1}, // @pymeth GetAnonymousToken|Calls ServerSupportFunction with HSE_REQ_GET_ANONYMOUS_TOKEN or HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN {"GetImpersonationToken", PyECB::GetImpersonationToken, 1}, // @pymeth GetImpersonationToken| {"IsKeepConn", PyECB::IsKeepConn, 1}, // @pymeth IsKeepConn|Calls ServerSupportFunction with HSE_REQ_IS_KEEP_CONN + {"ExecURL", PyECB::ExecURL, 1}, // @pymeth ExecURL|Calls ServerSupportFunction with HSE_REQ_EXEC_URL + {"GetExecURLStatus", PyECB::GetExecURLStatus, 1}, // @pymeth GetExecURLStatus|Calls ServerSupportFunction with HSE_REQ_GET_EXEC_URL_STATUS + {"IOCompletion", PyECB::IOCompletion, 1}, // @pymeth IOCompletion|Calls ServerSupportFunction with HSE_REQ_IO_COMPLETION + {"ReportUnhealthy", PyECB::ReportUnhealthy, 1}, // @pymeth ReportUnhealthy|Calls ServerSupportFunction with HSE_REQ_REPORT_UNHEALTHY {NULL} }; *************** *** 558,561 **** --- 667,702 ---- } + // @pymethod int|EXTENSION_CONTROL_BLOCK|GetAnonymousToken|Calls ServerSupportFunction with HSE_REQ_GET_ANONYMOUS_TOKEN or HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN + PyObject * PyECB::GetAnonymousToken(PyObject *self, PyObject *args) + { + PyECB * pecb = (PyECB *) self; + if (!pecb || !pecb->Check()) return NULL; + EXTENSION_CONTROL_BLOCK *ecb = pecb->m_pcb->GetECB(); + + PyObject *obStr; + // @pyparm string/unicode|metabase_path|| + if (!PyArg_ParseTuple(args, "O:GetImpersonationToken", &obStr)) + return NULL; + HANDLE handle; + BOOL bRes; + if (PyString_Check(obStr)) { + Py_BEGIN_ALLOW_THREADS + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_GET_ANONYMOUS_TOKEN, + PyString_AS_STRING(obStr), + (DWORD *)&handle,NULL); + Py_END_ALLOW_THREADS + } else if (PyUnicode_Check(obStr)) { + Py_BEGIN_ALLOW_THREADS + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN, + PyUnicode_AS_UNICODE(obStr), + (DWORD *)&handle,NULL); + Py_END_ALLOW_THREADS + } else + return PyErr_Format(PyExc_TypeError, "must pass a string or unicode object (got %s)", obStr->ob_type->tp_name); + if (!bRes) + return SetPyECBError("ServerSupportFunction(HSE_REQ_GET_IMPERSONATION_TOKEN)"); + return PyLong_FromVoidPtr(handle); + } + // @pymethod int|EXTENSION_CONTROL_BLOCK|IsKeepConn|Calls ServerSupportFunction with HSE_REQ_IS_KEEP_CONN PyObject * PyECB::IsKeepConn(PyObject *self, PyObject *args) *************** *** 575,578 **** --- 716,827 ---- } + // @pymethod int|EXTENSION_CONTROL_BLOCK|ExecURL|Calls ServerSupportFunction with HSE_REQ_EXEC_URL + // @comm This function is only available in IIS6 and later. + PyObject * PyECB::ExecURL(PyObject *self, PyObject *args) + { + PyObject *obInfo, *obEntity; + HSE_EXEC_URL_INFO i; + memset(&i, 0, sizeof(i)); // to be sure, to be sure... + if (!PyArg_ParseTuple(args, "zzzOOi:ExecURL", + &i.pszUrl, // @pyparm string|url|| + &i.pszMethod, // @pyparm string|method|| + &i.pszChildHeaders, // @pyparm string|clientHeaders|| + &obInfo, // @pyparm object|info||Must be None + &obEntity, // @pyparm object|entity||Must be None + &i.dwExecUrlFlags)) // @pyparm int|flags|| + return NULL; + + if (obInfo != Py_None || obEntity != Py_None) + return PyErr_Format(PyExc_ValueError, "info and entity params must be None"); + + i.pUserInfo = NULL; + i.pEntity = NULL; + PyECB * pecb = (PyECB *) self; + EXTENSION_CONTROL_BLOCK *ecb = pecb->m_pcb->GetECB(); + if (!pecb || !pecb->Check()) return NULL; + BOOL bRes; + Py_BEGIN_ALLOW_THREADS + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_EXEC_URL, &i, NULL,NULL); + Py_END_ALLOW_THREADS + if (!bRes) + return SetPyECBError("ServerSupportFunction(HSE_REQ_EXEC_URL)"); + Py_RETURN_NONE; + } + + // @pymethod int|EXTENSION_CONTROL_BLOCK|GetExecURLStatus|Calls ServerSupportFunction with HSE_REQ_GET_EXEC_URL_STATUS + PyObject * PyECB::GetExecURLStatus(PyObject *self, PyObject *args) + { + if (!PyArg_ParseTuple(args, ":GetExecURLStatus")) + return NULL; + + PyECB * pecb = (PyECB *) self; + EXTENSION_CONTROL_BLOCK *ecb = pecb->m_pcb->GetECB(); + if (!pecb || !pecb->Check()) return NULL; + BOOL bRes; + HSE_EXEC_URL_STATUS status; + Py_BEGIN_ALLOW_THREADS + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_GET_EXEC_URL_STATUS, &status, NULL,NULL); + Py_END_ALLOW_THREADS + if (!bRes) + return SetPyECBError("ServerSupportFunction(HSE_REQ_GET_EXEC_URL_STATUS)"); + // @rdesc The result of a tuple of 3 integers - (uHttpStatusCode, uHttpSubStatus, dwWin32Error) + // @seeapi HSE_EXEC_URL_STATUS + return Py_BuildValue("HHk", status.uHttpStatusCode, status.uHttpSubStatus, status.dwWin32Error); + } + + // @pymethod int|EXTENSION_CONTROL_BLOCK|IOCompletion|Set a callback that will be used for handling asynchronous I/O operations. + // @comm If you call this multiple times, the previous callback will be discarded. + // @comm A reference to the callback and args are held until <om + // EXTENSION_CONTROL_BLOCK.DoneWithSession> is called. If the callback + // function fails, DoneWithSession(HSE_STATUS_ERROR) will automatically be + // called and no further callbacks for the ECB will be made. + PyObject * PyECB::IOCompletion(PyObject *self, PyObject *args) + { + PyECB * pecb = (PyECB *) self; + if (!pecb || !pecb->Check()) return NULL; + EXTENSION_CONTROL_BLOCK *ecb = pecb->m_pcb->GetECB(); + + PyObject *obCallback; + PyObject *obArg = NULL; + if (!PyArg_ParseTuple(args, "O|O:IOCompletion", + &obCallback, // @pyparm callable|func||The function to call. + &obArg)) + return NULL; + + if (!PyCallable_Check(obCallback)) + return PyErr_Format(PyExc_TypeError, "first param must be callable"); + // now we have checked the params just ignore them! Stick args itself + // in our map. + if (!SetupIOCallback(ecb, args)) + return NULL; + + BOOL bRes; + Py_BEGIN_ALLOW_THREADS + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_IO_COMPLETION, DoIOCallback, NULL, NULL); + Py_END_ALLOW_THREADS + if (!bRes) + return SetPyECBError("ServerSupportFunction(HSE_REQ_IO_COMPLETION)"); + Py_RETURN_NONE; + } + + // @pymethod int|EXTENSION_CONTROL_BLOCK|ReportUnhealthy|Calls ServerSupportFunction with HSE_REQ_REPORT_UNHEALTHY + PyObject * PyECB::ReportUnhealthy(PyObject *self, PyObject *args) + { + char *reason = NULL; + if (!PyArg_ParseTuple(args, "|z:ReportUnhealthy", + &reason)) // @pyparm string|reason|None|An optional reason to be written to the log. + return NULL; + + PyECB * pecb = (PyECB *) self; + EXTENSION_CONTROL_BLOCK *ecb = pecb->m_pcb->GetECB(); + if (!pecb || !pecb->Check()) return NULL; + BOOL bRes; + Py_BEGIN_ALLOW_THREADS + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_REPORT_UNHEALTHY, reason, NULL,NULL); + Py_END_ALLOW_THREADS + if (!bRes) + return SetPyECBError("ServerSupportFunction(HSE_REQ_REPORT_UNHEALTHY)"); + Py_RETURN_NONE; + } class PyTFD { *************** *** 729,732 **** --- 978,985 ---- return NULL; + // Free any resources we've allocated on behalf of this ECB - this + // currently means just the io-completion callback. + CleanupIOCallback(pecb->m_pcb->GetECB()); + Py_BEGIN_ALLOW_THREADS pecb->m_pcb->DoneWithSession(status); |
From: Mark H. <mha...@us...> - 2009-01-05 11:09:26
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30801/pywin/framework/editor Modified Files: document.py Log Message: Merge EOL-detection and start of decent encoding detection (BOM only for now) from py3k-integration branch. Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/document.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** document.py 2 Oct 2008 13:03:55 -0000 1.12 --- document.py 5 Jan 2009 11:09:20 -0000 1.13 *************** *** 36,41 **** self.scModuleName=GetEditorOption("Source Control Module", "") self.scModule = None # Loaded when first used. ! # Skip the direct parent ! object.CmdTarget.__init__(self, template.CreateWin32uiDocument()) def OnCloseDocument(self ): --- 36,40 ---- self.scModuleName=GetEditorOption("Source Control Module", "") self.scModule = None # Loaded when first used. ! ParentEditorDocument.__init__(self, template, template.CreateWin32uiDocument()) def OnCloseDocument(self ): |
From: Mark H. <mha...@us...> - 2009-01-05 11:09:25
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30801/pywin/scintilla Modified Files: document.py view.py Log Message: Merge EOL-detection and start of decent encoding detection (BOM only for now) from py3k-integration branch. Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** view.py 3 Jan 2009 05:52:28 -0000 1.32 --- view.py 5 Jan 2009 11:09:21 -0000 1.33 *************** *** 387,396 **** def SaveTextFile(self, filename): doc = self.GetDocument() ! s = self.GetTextRange() ! # Save in binary mode so line endings are not translated. ! # Edit control uses '\r\n', and universal newlines mode replaces ALL '\r' with '\r\n'. ! f = open(filename, 'wb') ! f.write(s.encode('mbcs')) ! f.close() doc.SetModifiedFlag(0) return 1 --- 387,398 ---- def SaveTextFile(self, filename): doc = self.GetDocument() ! # Open in binary mode as scintilla itself ensures the ! # line endings are already appropriate, and our doc save ! # method handles encoding, BOMs, etc. ! f = open(filename, 'wb') ! try: ! doc._SaveTextToFile(self, f) ! finally: ! f.close() doc.SetModifiedFlag(0) return 1 Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** document.py 26 Nov 2008 08:39:33 -0000 1.8 --- document.py 5 Jan 2009 11:09:20 -0000 1.9 *************** *** 1,13 **** import win32ui from pywin.mfc import docview ! from pywin import is_platform_unicode, default_platform_encoding, default_scintilla_encoding import scintillacon import win32con import string ! import array ParentScintillaDocument=docview.Document class CScintillaDocument(ParentScintillaDocument): "A SyntEdit document. " def DeleteContents(self): pass --- 1,24 ---- import win32ui from pywin.mfc import docview ! from pywin import default_scintilla_encoding import scintillacon import win32con import string ! import os ! import codecs ! ! crlf_bytes = "\r\n".encode("ascii") ! lf_bytes = "\n".encode("ascii") ParentScintillaDocument=docview.Document class CScintillaDocument(ParentScintillaDocument): "A SyntEdit document. " + def __init__(self, *args): + self.bom = None # the BOM, if any, read from the file. + # the encoding we detected from the source. Might have + # detected via the BOM or an encoding decl. + self.source_encoding = None + ParentScintillaDocument.__init__(self, *args) + def DeleteContents(self): pass *************** *** 18,42 **** self.SetPathName(filename) # Must set this early! try: ! if is_platform_unicode: ! # Scintilla in UTF-8 mode - translate accordingly. ! import codecs ! f = codecs.open(filename, 'rb', default_platform_encoding) ! else: ! f = open(filename, 'rb') try: ! text = f.read() finally: f.close() - if is_platform_unicode: - # Translate from locale-specific (MCBS) encoding to UTF-8 for Scintilla - text = text.encode(default_scintilla_encoding) except IOError: win32ui.MessageBox("Could not load the file from %s" % filename) return 0 - self._SetLoadedText(text) - ## if self.GetFirstView(): - ## self.GetFirstView()._SetLoadedText(text) - ## self.SetModifiedFlag(0) # No longer dirty return 1 --- 29,43 ---- self.SetPathName(filename) # Must set this early! try: ! # load the text as binary we can get smart ! # about detecting any existing EOL conventions. ! f = open(filename, 'rb') try: ! self._LoadTextFromFile(f) finally: f.close() except IOError: win32ui.MessageBox("Could not load the file from %s" % filename) return 0 return 1 *************** *** 54,58 **** # File related functions # Helper to transfer text from the MFC document to the control. ! def _SetLoadedText(self, text): view = self.GetFirstView() if view.IsWindow(): --- 55,111 ---- # File related functions # Helper to transfer text from the MFC document to the control. ! def _LoadTextFromFile(self, f): ! # detect EOL mode - we don't support \r only - so find the ! # first '\n' and guess based on the char before. ! l = f.readline() ! # If line ends with \r\n or has no line ending, use CRLF. ! if l.endswith(crlf_bytes) or not l.endswith(lf_bytes): ! eol_mode = scintillacon.SC_EOL_CRLF ! else: ! eol_mode = scintillacon.SC_EOL_LF ! ! # Detect the encoding. ! # XXX - todo - support pep263 encoding declarations as well as ! # the BOM detection here (but note that unlike our BOM, the ! # encoding declaration could change between loading and saving ! # - particularly with a new file - so it also needs to be ! # implemented at save time.) ! for bom, encoding in ( ! (codecs.BOM_UTF8, "utf8"), ! (codecs.BOM_UTF16_LE, "utf_16_le"), ! (codecs.BOM_UTF16_BE, "utf_16_be"), ! ): ! if l.startswith(bom): ! self.bom = bom ! self.source_encoding = encoding ! l = l[len(bom):] # remove it. ! break ! ! # reading by lines would be too slow? Maybe we can use the ! # incremental encoders? For now just stick with loading the ! # entire file in memory. ! text = l + f.read() ! ! # Translate from source encoding to UTF-8 bytes for Scintilla ! source_encoding = self.source_encoding ! # This latin1 sucks until we get pep263 support; if we don't ! # know an encoding we just write as binary (maybe we should ! # try ascii to let the 'decoding failed' handling below to ! # provide a nice warning that the file is non-ascii) ! if source_encoding is None: ! source_encoding = 'latin1' ! # we could optimize this by avoiding utf8 to-ing and from-ing, ! # but then we would lose the ability to handle invalid utf8 ! # (and even then, the use of encoding aliases makes this tricky) ! # To create an invalid utf8 file: ! # >>> open(filename, "wb").write(codecs.BOM_UTF8+"bad \xa9har\r\n") ! try: ! dec = text.decode(source_encoding) ! except UnicodeError: ! print "WARNING: Failed to decode bytes from %r encoding - treating as latin1" % source_encoding ! dec = text.decode('latin1') ! # and put it back as utf8 - this shouldn't fail. ! text = dec.encode(default_scintilla_encoding) ! view = self.GetFirstView() if view.IsWindow(): *************** *** 61,70 **** # Make sure the control isnt read-only view.SetReadOnly(0) - - doc = self view.SendScintilla(scintillacon.SCI_CLEARALL) ! view.SendMessage(scintillacon.SCI_ADDTEXT, buffer(text)) view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) def FinalizeViewCreation(self, view): --- 114,135 ---- # Make sure the control isnt read-only view.SetReadOnly(0) view.SendScintilla(scintillacon.SCI_CLEARALL) ! view.SendMessage(scintillacon.SCI_ADDTEXT, text) view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) + # set EOL mode + view.SendScintilla(scintillacon.SCI_SETEOLMODE, eol_mode) + + def _SaveTextToFile(self, view, f): + s = view.GetTextRange() # already decoded from scintilla's encoding + if self.bom: + f.write(self.bom) + source_encoding = self.source_encoding + if source_encoding is None: + source_encoding = 'latin1' + + f.write(s.encode(source_encoding)) + self.SetModifiedFlag(0) + def FinalizeViewCreation(self, view): |
From: Mark H. <mha...@us...> - 2009-01-05 11:07:30
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30686/Pythonwin/pywin/scintilla Modified Files: control.py Log Message: better py3k-friendly use of array module, more comments and cleanups Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** control.py 14 Nov 2008 00:22:25 -0000 1.19 --- control.py 5 Jan 2009 11:07:24 -0000 1.20 *************** *** 14,18 **** import string import os - import sys import scintillacon --- 14,17 ---- *************** *** 34,37 **** --- 33,39 ---- dllid = win32api.LoadLibrary("Scintilla.DLL") + # null_byte is str in py2k, bytes on py3k + null_byte = "\0".encode('ascii') + ## These are from Richedit.h - need to add to win32con or commctrl EM_GETTEXTRANGE = 1099 *************** *** 199,210 **** def SCICallTipShow(self, text, pos=-1): if pos==-1: pos = self.GetSel()[0] ! if isinstance(text, unicode): ! # I'm really not sure what the correct encoding ! # to use is - but it has gotta be better than total ! # failure due to the array module ! text = text.encode("mbcs") ! buff = array.array('c', text + "\0") ! addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_CALLTIPSHOW, pos, addressBuffer) def SCICallTipCancel(self): self.SendScintilla(scintillacon.SCI_CALLTIPCANCEL) --- 201,206 ---- def SCICallTipShow(self, text, pos=-1): if pos==-1: pos = self.GetSel()[0] ! buff = (text + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_CALLTIPSHOW, pos, buff) def SCICallTipCancel(self): self.SendScintilla(scintillacon.SCI_CALLTIPCANCEL) *************** *** 220,225 **** self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, buff) def SCISetProperty(self, name, value): ! name_buff = array.array('c', name + "\0") ! val_buff = array.array("c", str(value) + "\0") address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] --- 216,221 ---- self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, buff) def SCISetProperty(self, name, value): ! name_buff = array.array('b', (name + '\0').encode(default_scintilla_encoding)) ! val_buff = array.array("b", (str(value)+'\0').encode(default_scintilla_encoding)) address_name_buffer = name_buff.buffer_info()[0] address_val_buffer = val_buff.buffer_info()[0] *************** *** 297,304 **** def GetSelText(self): start, end = self.GetSel() ! txtBuf = array.array('c', " " * ((end-start)+1)) addressTxtBuf = txtBuf.buffer_info()[0] self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf) ! return txtBuf.tostring().decode(default_scintilla_encoding) def SetSel(self, start=0, end=None): --- 293,308 ---- def GetSelText(self): start, end = self.GetSel() ! txtBuf = array.array('b', null_byte * (end-start+1)) addressTxtBuf = txtBuf.buffer_info()[0] + # EM_GETSELTEXT is documented as returning the number of chars + # not including the NULL, but scintilla includes the NULL. A + # quick glance at the scintilla impl doesn't make this + # obvious - the NULL is included in the 'selection' object + # and reflected in the length of that 'selection' object. + # I expect that is a bug in scintilla and may be fixed by now, + # but we just blindly assume that the last char is \0 and + # strip it. self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf) ! return txtBuf.tostring()[:-1].decode(default_scintilla_encoding) def SetSel(self, start=0, end=None): *************** *** 313,317 **** assert end <= self.GetTextLength(), "The end postion is invalid (%d/%d)" % (end, self.GetTextLength()) cr = struct.pack('ll', start, end) ! crBuff = array.array('c', cr) addressCrBuff = crBuff.buffer_info()[0] rc = self.SendScintilla(EM_EXSETSEL, 0, addressCrBuff) --- 317,321 ---- assert end <= self.GetTextLength(), "The end postion is invalid (%d/%d)" % (end, self.GetTextLength()) cr = struct.pack('ll', start, end) ! crBuff = array.array('b', cr) addressCrBuff = crBuff.buffer_info()[0] rc = self.SendScintilla(EM_EXSETSEL, 0, addressCrBuff) *************** *** 344,356 **** assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid" ! initer = ("=" * (end - start + 1)).encode("ascii") # ensure bytes in both 2x and 3k ! if sys.version_info >= (3,): ! byte_format = 'b' ! else: ! byte_format = 'c' ! buff = array.array(byte_format, initer) addressBuffer = buff.buffer_info()[0] tr = struct.pack('llP', start, end, addressBuffer) ! trBuff = array.array(byte_format, tr) addressTrBuff = trBuff.buffer_info()[0] numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff) --- 348,356 ---- assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid" ! initer = null_byte * (end - start + 1) ! buff = array.array('b', initer) addressBuffer = buff.buffer_info()[0] tr = struct.pack('llP', start, end, addressBuffer) ! trBuff = array.array('b', tr) addressTrBuff = trBuff.buffer_info()[0] numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff) |
From: Mark H. <mha...@us...> - 2009-01-05 11:06:32
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30645/Pythonwin/pywin/idle Modified Files: CallTips.py Log Message: use inspect module as aid to making py3k-friendly Index: CallTips.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/CallTips.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CallTips.py 27 Nov 2008 03:53:25 -0000 1.4 --- CallTips.py 5 Jan 2009 11:06:23 -0000 1.5 *************** *** 4,8 **** import string import sys ! import types class CallTips: --- 4,9 ---- import string import sys ! import inspect ! import traceback class CallTips: *************** *** 101,105 **** # constructor (ie, __init__() ) or None if we can't find one. try: ! return class_ob.__init__.im_func except AttributeError: for base in class_ob.__bases__: --- 102,109 ---- # constructor (ie, __init__() ) or None if we can't find one. try: ! if sys.version_info < (3,): ! return class_ob.__init__.im_func ! else: ! return class_ob.__init__.__func__ except AttributeError: for base in class_ob.__bases__: *************** *** 113,146 **** if ob is not None: argOffset = 0 ! if type(ob)==types.ClassType: # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None - else: - argOffset = 1 - elif type(ob)==types.MethodType: - # bit of a hack for methods - turn it into a function - # but we drop the "self" param. - fob = ob.im_func - argOffset = 1 else: fob = ob ! # Try and build one for Python defined functions ! if type(fob) in [types.FunctionType, types.LambdaType]: try: ! realArgs = fob.func_code.co_varnames[argOffset:fob.func_code.co_argcount] ! defaults = fob.func_defaults or [] ! defaults = list(map(lambda name: "=%s" % name, defaults)) ! defaults = [""] * (len(realArgs)-len(defaults)) + defaults ! items = map(lambda arg, dflt: arg+dflt, realArgs, defaults) ! if fob.func_code.co_flags & 0x4: ! items.append("...") ! if fob.func_code.co_flags & 0x8: ! items.append("***") ! argText = ", ".join(items) ! argText = "(%s)" % argText except: ! pass # See if we can use the docstring if hasattr(ob, "__doc__"): --- 117,135 ---- if ob is not None: argOffset = 0 ! if inspect.isclass(ob): # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: fob = lambda: None else: fob = ob ! if inspect.isfunction(fob) or inspect.ismethod(fob): try: ! # py3k has a 'getfullargspec' which can handle py3k specific things. ! arg_getter = getattr(inspect, "getfullargspec", inspect.getargspec) ! argText = inspect.formatargspec(*arg_getter(fob)) except: ! print "Failed to format the args" ! traceback.print_exc() # See if we can use the docstring if hasattr(ob, "__doc__"): *************** *** 167,184 **** def t1(): "()" def t2(a, b=None): "(a, b=None)" ! def t3(a, *args): "(a, ...)" ! def t4(*args): "(...)" ! def t5(a, *args): "(a, ...)" ! def t6(a, b=None, *args, **kw): "(a, b=None, ..., ***)" class TC: ! "(a=None, ...)" ! def __init__(self, a=None, *b): "(a=None, ...)" ! def t1(self): "()" ! def t2(self, a, b=None): "(a, b=None)" ! def t3(self, a, *args): "(a, ...)" ! def t4(self, *args): "(...)" ! def t5(self, a, *args): "(a, ...)" ! def t6(self, a, b=None, *args, **kw): "(a, b=None, ..., ***)" def test( tests ): --- 156,173 ---- def t1(): "()" def t2(a, b=None): "(a, b=None)" ! def t3(a, *args): "(a, *args)" ! def t4(*args): "(*args)" ! def t5(a, *args): "(a, *args)" ! def t6(a, b=None, *args, **kw): "(a, b=None, *args, **kw)" class TC: ! "(self, a=None, *b)" ! def __init__(self, a=None, *b): "(self, a=None, *b)" ! def t1(self): "(self)" ! def t2(self, a, b=None): "(self, a, b=None)" ! def t3(self, a, *args): "(self, a, *args)" ! def t4(self, *args): "(self, *args)" ! def t5(self, a, *args): "(self, a, *args)" ! def t6(self, a, b=None, *args, **kw): "(self, a, b=None, *args, **kw)" def test( tests ): *************** *** 196,197 **** --- 185,187 ---- test(tests) + |
From: Mark H. <mha...@us...> - 2009-01-05 11:06:06
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30595/com/win32com/client Modified Files: combrowse.py Log Message: rationalize rich-cmp support for 'browser' related items Index: combrowse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/combrowse.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** combrowse.py 4 Jan 2009 22:35:14 -0000 1.14 --- combrowse.py 5 Jan 2009 11:06:00 -0000 1.15 *************** *** 37,42 **** def __cmp__(self, other): return cmp(self.name, other.name) - def __eq__(self, other): - return self.name==other.name class HLICOM(browser.HLIPythonObject): --- 37,40 ---- |
From: Mark H. <mha...@us...> - 2009-01-05 11:06:06
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30595/Pythonwin/pywin/tools Modified Files: hierlist.py Log Message: rationalize rich-cmp support for 'browser' related items Index: hierlist.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/hierlist.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** hierlist.py 26 Nov 2008 08:39:33 -0000 1.10 --- hierlist.py 5 Jan 2009 11:06:00 -0000 1.11 *************** *** 313,314 **** --- 313,331 ---- def GetSelectedBitmapColumn(self): return None # same as other + # for py3k/rich-comp sorting compatibility. + def __cmp__(self): + # this is always overridden, but to be sure... + return cmp(id(self), id(other)) + def __lt__(self, other): + try: + return self.__cmp__(self, other) < 0 + except TypeError: + # we want unrelated items to be sortable... + return id(self) < id(other) + # for py3k/rich-comp equality compatibility. + def __eq__(self, other): + try: + return __cmp__(self, other) == 0 + except TypeError: + # unrelated items compare false + return 0 |
From: Mark H. <mha...@us...> - 2009-01-05 11:03:52
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30356/Pythonwin/pywin/mfc Modified Files: activex.py Log Message: py3k-friendly dynamic class creation Index: activex.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/activex.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** activex.py 14 Nov 2008 00:22:25 -0000 1.4 --- activex.py 5 Jan 2009 11:03:45 -0000 1.5 *************** *** 1,6 **** """Support for ActiveX control hosting in Pythonwin. """ ! import win32ui, win32uiole, window ! import new class Control(window.Wnd): --- 1,12 ---- """Support for ActiveX control hosting in Pythonwin. """ ! import win32ui, win32uiole ! import window ! # 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 class Control(window.Wnd): *************** *** 62,66 **** if name is None: name = controlClass.__name__ ! return new.classobj("OCX" + name, (Control, controlClass), {}) def MakeControlInstance( controlClass, name = None ): --- 68,72 ---- if name is None: name = controlClass.__name__ ! return new_type("OCX" + name, (Control, controlClass), {}) def MakeControlInstance( controlClass, name = None ): |
From: Mark H. <mha...@us...> - 2009-01-05 11:03:12
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30244/Pythonwin/pywin/framework Modified Files: toolmenu.py Log Message: whitespace normalization Index: toolmenu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/toolmenu.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** toolmenu.py 7 Feb 2004 02:06:56 -0000 1.3 --- toolmenu.py 5 Jan 2009 11:03:05 -0000 1.4 *************** *** 14,22 **** defaultToolMenuItems = [ ('Browser', 'win32ui.GetApp().OnViewBrowse(0,0)'), ! ('Browse PythonPath', 'from pywin.tools import browseProjects;browseProjects.Browse()'), ! ('Edit Python Path', 'from pywin.tools import regedit;regedit.EditRegistry()'), ! ('COM Makepy utility', 'from win32com.client import makepy;makepy.main()'), ! ('COM Browser', 'from win32com.client import combrowse;combrowse.main()'), ! ('Trace Collector Debugging tool', 'from pywin.tools import TraceCollector;TraceCollector.MakeOutputWindow()'), ] --- 14,22 ---- defaultToolMenuItems = [ ('Browser', 'win32ui.GetApp().OnViewBrowse(0,0)'), ! ('Browse PythonPath', 'from pywin.tools import browseProjects;browseProjects.Browse()'), ! ('Edit Python Path', 'from pywin.tools import regedit;regedit.EditRegistry()'), ! ('COM Makepy utility', 'from win32com.client import makepy;makepy.main()'), ! ('COM Browser', 'from win32com.client import combrowse;combrowse.main()'), ! ('Trace Collector Debugging tool', 'from pywin.tools import TraceCollector;TraceCollector.MakeOutputWindow()'), ] |