pywin32-checkins Mailing List for Python for Windows Extensions (Page 3)
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: <pyw...@li...> - 2013-06-13 09:16:49
|
changeset 758c693673d2 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=758c693673d2 summary: Add support for VT_I8 and VT_UI8 when converting a variant into a Pythonobject (Stefan Schukat via patch #128) changeset cbcbd126551c in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=cbcbd126551c summary: Conversions from a Python object to a variant now does a better job at deciding what variant type to use (Stefan Schukat) diffstat: CHANGES.txt | 7 +++ com/win32com/src/oleargs.cpp | 81 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 70 insertions(+), 18 deletions(-) diffs (120 lines): diff -r 1594b8c27383 -r cbcbd126551c CHANGES.txt --- a/CHANGES.txt Thu Jun 13 18:29:09 2013 +1000 +++ b/CHANGES.txt Thu Jun 13 19:16:16 2013 +1000 @@ -6,6 +6,13 @@ Since build 218: ---------------- + * Conversions from a Python object to a variant now does a better job at + deciding what variant type to use, taking into account the size and sign of + the value (Stefan Schukat via patch #127) + + * Add support for VT_I8 and VT_UI8 when converting a variant into a Python + object (Stefan Schukat via patch #128) + * win32com.mapi.exchange Added 64-bit support by excluding the 32-bit Ex2kSdk.lib functions from 64-bit builds. Unfortunately, this means that only IExchangeManageStore::CreateStoreEntryID diff -r 1594b8c27383 -r cbcbd126551c com/win32com/src/oleargs.cpp --- a/com/win32com/src/oleargs.cpp Thu Jun 13 18:29:09 2013 +1000 +++ b/com/win32com/src/oleargs.cpp Thu Jun 13 19:16:16 2013 +1000 @@ -145,29 +145,58 @@ } else if (PyLong_Check(obj)) { - __int64 lval = PyLong_AsLongLong(obj); - if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_OverflowError)) + int sign = _PyLong_Sign(obj); + size_t nbits = _PyLong_NumBits(obj); + if (nbits == (size_t)-1 && PyErr_Occurred()) return FALSE; - if (PyErr_Occurred()) { - PyErr_Clear(); + if (64 < nbits) { // too big for 64 bits! Use a double. - double dval = PyLong_AsDouble(obj); V_VT(var) = VT_R8; - V_R8(var) = dval; + V_R8(var) = PyLong_AsDouble(obj); + } + else if (32 < nbits) { + // between 32 and 64 use longlong + // signed and using all bits use unsigned + if (sign > 0 && 64 == nbits) { + V_VT(var) = VT_UI8; + V_UI8(var) = PyLong_AsUnsignedLongLong(obj); + } else { + // Negative so use signed + V_VT(var) = VT_I8; + V_I8(var) = PyLong_AsLongLong(obj); + // Problem if value is between LLONG_MIN and -ULLONG_MAX + if (PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { + // Take now double + PyErr_Clear(); + V_VT(var) = VT_R8; + V_R8(var) = PyLong_AsDouble(obj); + } else { + return FALSE; + } + } + } } else { - // 64 bits is OK - but if it fits in 32 we will - // use that. Prefer VT_I4 if possible as VBScript - // etc like it better. - if (lval >= LONG_MIN && lval <= LONG_MAX) { + // less then 32 bit use standard long + // positive and using all bits so unsigned + if (sign > 0 && 32 == nbits) { + V_VT(var) = VT_UI4; + V_UI4(var) = PyLong_AsUnsignedLong(obj); + } else { + // Negative so use signed V_VT(var) = VT_I4; - V_I4(var) = (long)lval; - // OK, we know it must be > LONG_MAX, but zero is clearer - } else if (lval >= 0 && lval <= ULONG_MAX) { - V_VT(var) = VT_UI4; - V_UI4(var) = (unsigned long)lval; - } else { - V_VT(var) = VT_I8; - V_I8(var) = lval; + V_I4(var) = PyLong_AsLong(obj); + // Problem if value is between LONG_MIN and -ULONG_MAX + if (PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { + // Take now double + PyErr_Clear(); + V_VT(var) = VT_I8; + V_I8(var) = PyLong_AsLongLong(obj); + } else { + return FALSE; + } + } } } } @@ -371,6 +400,22 @@ result = PyInt_FromLong(V_I4(&varValue)); break; + case VT_UI8: + // The result may be too large for a simple "long". If so, + // we must return a long. + if (V_UI8(&varValue) <= LONG_MAX) + result = PyInt_FromLong((long)V_UI8(&varValue)); + else + result = PyLong_FromUnsignedLongLong(V_UI8(&varValue)); + break; + + case VT_I8: + if ((LONG_MIN <= V_I8(&varValue)) && (V_I8(&varValue) <= LONG_MAX)) + result = PyInt_FromLong((long)V_I8(&varValue)); + else + result = PyLong_FromLongLong(V_I8(&varValue)); + break; + case VT_HRESULT: case VT_ERROR: result = PyInt_FromLong(V_ERROR(&varValue)); |
From: <pyw...@li...> - 2013-06-13 08:29:24
|
changeset 606c6302d0df in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=606c6302d0df summary: configure adodbapi as 'binary' to prevent the eol extension complaining changeset 9cb6d1c727e7 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=9cb6d1c727e7 summary: Ignore PT_MV_TSTRING along with PT_TSTRING (Nick Czeczulin) changeset 1594b8c27383 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=1594b8c27383 summary: Get the exchange module (mostly) working in 64bit builds (Nick Czeczulin) diffstat: .hgeol | 4 +++ CHANGES.txt | 5 +++ com/win32comext/mapi/mapiutil.py | 2 +- com/win32comext/mapi/src/PyIExchangeManageStore.i | 1 + com/win32comext/mapi/src/exchange.i | 30 +++++++++++++++++++--- setup.py | 25 +++++++++++++------ 6 files changed, 54 insertions(+), 13 deletions(-) diffs (187 lines): diff -r 4ded0a838f8c -r 1594b8c27383 .hgeol --- a/.hgeol Mon Apr 29 10:01:40 2013 -0400 +++ b/.hgeol Thu Jun 13 18:29:09 2013 +1000 @@ -2,4 +2,8 @@ **.dsp = CRLF **.dsw = CRLF **.vbp = CRLF +# adodbapi appears to have been checked in with windows line endings +# and without the 'eol' extension enabled, so we say it's binary to stop +# hg continually thinking it has changed. +path:adodbapi = bin ** = native diff -r 4ded0a838f8c -r 1594b8c27383 CHANGES.txt --- a/CHANGES.txt Mon Apr 29 10:01:40 2013 -0400 +++ b/CHANGES.txt Thu Jun 13 18:29:09 2013 +1000 @@ -6,6 +6,11 @@ Since build 218: ---------------- + * win32com.mapi.exchange + Added 64-bit support by excluding the 32-bit Ex2kSdk.lib functions from 64-bit builds. + Unfortunately, this means that only IExchangeManageStore::CreateStoreEntryID + is currently available in a 64-bit build. (Nick Czeczulin) + * adodbapi updated to version 2.4.3 -- new examples folder includes short programs for reading and writing .xls spreadsheets and reading ACCESS .mdb files using SQL. New functions .is64bit.Python() and .is64bit.os() to help pick the correct drivers. diff -r 4ded0a838f8c -r 1594b8c27383 com/win32comext/mapi/mapiutil.py --- a/com/win32comext/mapi/mapiutil.py Mon Apr 29 10:01:40 2013 -0400 +++ b/com/win32comext/mapi/mapiutil.py Thu Jun 13 18:29:09 2013 +1000 @@ -72,7 +72,7 @@ # PT_TSTRING is a conditional assignment # for either PT_UNICODE or PT_STRING8 and # should not be returned during a lookup. - if name == 'PT_TSTRING': + if name in ['PT_TSTRING', 'PT_MV_TSTRING']: continue ptTable[value] = name diff -r 4ded0a838f8c -r 1594b8c27383 com/win32comext/mapi/src/PyIExchangeManageStore.i --- a/com/win32comext/mapi/src/PyIExchangeManageStore.i Mon Apr 29 10:01:40 2013 -0400 +++ b/com/win32comext/mapi/src/PyIExchangeManageStore.i Thu Jun 13 18:29:09 2013 +1000 @@ -10,6 +10,7 @@ %{ #include <edkmdb.h> #define INITGUID +#include <initguid.h> #define USES_IID_IExchangeManageStore #include <edkguid.h> %} diff -r 4ded0a838f8c -r 1594b8c27383 com/win32comext/mapi/src/exchange.i --- a/com/win32comext/mapi/src/exchange.i Mon Apr 29 10:01:40 2013 -0400 +++ b/com/win32comext/mapi/src/exchange.i Thu Jun 13 18:29:09 2013 +1000 @@ -28,16 +28,21 @@ #include "MAPIUTIL.H" #include "EDKMDB.H" -#include "EDKMAPI.H" -#include "EDKCFG.H" -#include "EDKUTILS.H" -#define INITGUID #define USES_IID_IExchangeManageStore #include <edkguid.h> #include "PyIExchangeManageStore.h" +%} +/* + Only include Ex2KSdk.lib functions for 32-bit builds. +*/ +#ifdef SWIG_PY32BIT +%{ +#include "EDKMAPI.H" +#include "EDKCFG.H" +#include "EDKUTILS.H" // What is the correct story here?? The Exchange SDK story sucks - it seems // certain functions in the stand-alone version are simply commented out. @@ -52,7 +57,10 @@ #if !defined(DONT_HAVE_MBLOGON) # include "MBLOGON.H" #endif +%} +#endif +%{ static int AddIID(PyObject *dict, const char *key, REFGUID guid) { PyObject *obiid = PyWinObject_FromIID(guid); @@ -67,11 +75,24 @@ %} + +// IExchangeManageStore::CreateStoreEntryId flags +#define OPENSTORE_USE_ADMIN_PRIVILEGE OPENSTORE_USE_ADMIN_PRIVILEGE +#define OPENSTORE_PUBLIC OPENSTORE_PUBLIC +#define OPENSTORE_HOME_LOGON OPENSTORE_HOME_LOGON +#define OPENSTORE_TAKE_OWNERSHIP OPENSTORE_TAKE_OWNERSHIP +#define OPENSTORE_OVERRIDE_HOME_MDB OPENSTORE_OVERRIDE_HOME_MDB + + %init %{ if ( PyCom_RegisterClientType(&PyIExchangeManageStore::type, &IID_IExchangeManageStore) != 0 ) return MODINIT_ERROR_RETURN; ADD_IID(IID_IExchangeManageStore); %} +/* + Only include Ex2KSdk.lib functions for 32-bit builds. +*/ +#ifdef SWIG_PY32BIT // @pyswig int, int|HrGetExchangeStatus|Obtains the current state of the server on a computer. // @rdesc The result is a tuple of serviceState, serverState HRESULT HrGetExchangeStatus( @@ -510,3 +531,4 @@ IMAPISession *INPUT, // @pyparm <o PyIMAPISession>|session||The MAPI session object IMAPIProp **OUTPUT ); +#endif /* SWIG_PY32BIT */ diff -r 4ded0a838f8c -r 1594b8c27383 setup.py --- a/setup.py Mon Apr 29 10:01:40 2013 -0400 +++ b/setup.py Thu Jun 13 18:29:09 2013 +1000 @@ -546,7 +546,7 @@ keyname = "SOFTWARE\Microsoft\Exchange\SDK" for root in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER: try: - keyob = _winreg.OpenKey(root, keyname) + keyob = _winreg.OpenKey(root, keyname, 0, _winreg.KEY_READ | _winreg.KEY_WOW64_32KEY) value, type_id = _winreg.QueryValueEx(keyob, "INSTALLDIR") if type_id == _winreg.REG_SZ: sdk_install_dir = value @@ -562,7 +562,11 @@ kw.setdefault("library_dirs", []).insert(0, d) # The stand-alone exchange SDK has these libs - libs += " Ex2KSdk sadapi mapi32 netapi32" + if distutils.util.get_platform() == 'win-amd64': + # Additional utility functions are only available for 32-bit builds. + pass + else: + libs += " version user32 advapi32 Ex2KSdk sadapi netapi32" kw["libraries"] = libs WinExt_win32com.__init__(self, name, **kw) @@ -791,10 +795,11 @@ def _why_cant_build_extension(self, ext): # Return None, or a reason it can't be built. - # This kinda sucks, but I'm giving up on exchange support in 64bit - # builds. - if self.plat_name == 'win-amd64' and ext.name in ['exchange', 'exchdapi']: - return "Can't get exchange support working in 64bit builds" + # Exclude exchange 32-bit utility libraries from 64-bit + # builds. Note that the exchange module now builds, but only + # includes interfaces for 64-bit builds. + if self.plat_name == 'win-amd64' and ext.name in ['exchdapi']: + return "No 64-bit library for utility functions available." include_dirs = self.compiler.include_dirs + \ os.environ.get("INCLUDE", "").split(os.pathsep) if self.windows_h_version is None: @@ -1345,6 +1350,10 @@ swig_cmd.extend(self.current_extension.extra_swig_commands) if not is_py3k: swig_cmd.append("-DSWIG_PY2K") + if distutils.util.get_platform() == 'win-amd64': + swig_cmd.append("-DSWIG_PY64BIT") + else: + swig_cmd.append("-DSWIG_PY32BIT") target = swig_targets[source] try: interface_parent = swig_interface_parents[ @@ -1932,12 +1941,12 @@ %(mapi)s/mapiutil.cpp %(mapi)s/mapiguids.cpp """ % dirs).split()), - WinExt_win32com_mapi('exchange', libraries="version user32 advapi32", + WinExt_win32com_mapi('exchange', libraries="mapi32", sources=(""" %(mapi)s/exchange.i %(mapi)s/exchange.cpp %(mapi)s/PyIExchangeManageStore.i %(mapi)s/PyIExchangeManageStore.cpp """ % dirs).split()), - WinExt_win32com_mapi('exchdapi', libraries="advapi32", + WinExt_win32com_mapi('exchdapi', libraries="mapi32", sources=(""" %(mapi)s/exchdapi.i %(mapi)s/exchdapi.cpp """ % dirs).split()), |
From: <pyw...@li...> - 2013-04-29 14:02:34
|
changeset 4ded0a838f8c in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=4ded0a838f8c summary: Compile message files first (bug #3612178, patch from Tim Golden) diffstat: setup.py | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diffs (36 lines): diff -r 083fadd62226 -r 4ded0a838f8c setup.py --- a/setup.py Fri Apr 19 03:16:23 2013 -0400 +++ b/setup.py Mon Apr 29 10:01:40 2013 -0400 @@ -91,7 +91,12 @@ from distutils.command.build_py import build_py from distutils.command.build_scripts import build_scripts -from distutils.command.bdist_msi import bdist_msi +try: + from distutils.command.bdist_msi import bdist_msi +except ImportError: + # py24 and earlier + bdist_msi = None + from distutils.msvccompiler import get_build_version from distutils import log @@ -1538,8 +1543,8 @@ win32_extensions.append( WinExt_win32("perfmondata", sources=[ + "win32/src/PerfMon/PyPerfMsgs.mc", "win32/src/PerfMon/perfmondata.cpp", - "win32/src/PerfMon/PyPerfMsgs.mc", ], libraries="advapi32", unicode_mode=True, @@ -1674,7 +1679,7 @@ ] win32_extensions += [ WinExt_win32('servicemanager', - sources = ["win32/src/PythonService.cpp", "win32/src/PythonServiceMessages.mc"], + sources = ["win32/src/PythonServiceMessages.mc", "win32/src/PythonService.cpp"], extra_compile_args = ['-DPYSERVICE_BUILD_DLL'], libraries = "user32 ole32 advapi32 shell32", windows_h_version = 0x500, |
From: <pyw...@li...> - 2013-04-19 07:17:27
|
changeset d77ee537aaef in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=d77ee537aaef summary: Make sure file exists and is not a directory before opening changeset 083fadd62226 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=083fadd62226 summary: Fix error checking in DocumentProperties (bug #3611214) diffstat: Pythonwin/pywin/framework/sgrepmdi.py | 15 +++++++++------ win32/src/win32print/win32print.cpp | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diffs (37 lines): diff -r f7dd8d279929 -r 083fadd62226 Pythonwin/pywin/framework/sgrepmdi.py --- a/Pythonwin/pywin/framework/sgrepmdi.py Sun Apr 14 01:00:24 2013 -0400 +++ b/Pythonwin/pywin/framework/sgrepmdi.py Fri Apr 19 03:16:23 2013 -0400 @@ -257,12 +257,15 @@ f = self.flist[self.fndx] if self.verbose: self.GetFirstView().Append('# ..'+f+'\n') - win32ui.SetStatusText("Searching "+f, 0) - lines = open(f, 'r').readlines() - for i in range(len(lines)): - line = lines[i] - if self.pat.search(line) != None: - self.GetFirstView().Append(f+'('+repr(i+1) + ') '+line) + # Directories may match the file type pattern, and files may be removed + # while grep is running + if os.path.isfile(f): + win32ui.SetStatusText("Searching "+f, 0) + lines = open(f, 'r').readlines() + for i in range(len(lines)): + line = lines[i] + if self.pat.search(line) != None: + self.GetFirstView().Append(f+'('+repr(i+1) + ') '+line) else: self.fndx = -1 self.fpndx = self.fpndx + 1 diff -r f7dd8d279929 -r 083fadd62226 win32/src/win32print/win32print.cpp --- a/win32/src/win32print/win32print.cpp Sun Apr 14 01:00:24 2013 -0400 +++ b/win32/src/win32print/win32print.cpp Fri Apr 19 03:16:23 2013 -0400 @@ -1344,7 +1344,7 @@ &&PyWinObject_AsDEVMODE(obdmoutput, &dmoutput, TRUE) &&PyWinObject_AsDEVMODE(obdminput, &dminput, TRUE)){ rc=DocumentProperties(hwnd, hprinter, devicename, dmoutput, dminput, mode); - if (ret < 0) + if (rc < 0) PyWin_SetAPIError("DocumentProperties"); else{ if (obdmoutput!=Py_None) |
From: <pyw...@li...> - 2013-04-14 05:01:16
|
changeset 6eb23bcb9730 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=6eb23bcb9730 summary: Handle REG_QWORD (64-bit ints) changeset f7dd8d279929 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=f7dd8d279929 summary: Remove some more 2.3 workarounds diffstat: Pythonwin/win32uiExt.h | 9 --------- com/win32com/client/genpy.py | 22 +++++++--------------- com/win32com/test/pippo_server.py | 5 ----- win32/Demos/OpenEncryptedFileRaw.py | 2 +- win32/Demos/win32rcparser_demo.py | 6 ------ win32/src/win32apimodule.cpp | 31 +++++++++++++++++++++++++++++-- win32/test/test_win32api.py | 1 + win32/test/test_win32file.py | 11 ++--------- win32/test/testall.py | 21 +++++++-------------- 9 files changed, 47 insertions(+), 61 deletions(-) diffs (225 lines): diff -r 07ce8a09c2ac -r f7dd8d279929 Pythonwin/win32uiExt.h --- a/Pythonwin/win32uiExt.h Wed Apr 10 23:03:24 2013 -0400 +++ b/Pythonwin/win32uiExt.h Sun Apr 14 01:00:24 2013 -0400 @@ -993,19 +993,10 @@ template <class T> const AFX_MSGMAP_ENTRY CPythonPrtDlgFramework<T>::_messageEntries[] = { -#if _MFC_VER < 0x0700 - // Python 2.3 (ie, VS6) doesn't like the new version below. - ON_MESSAGE(WM_INITDIALOG, HandleInitDialog) - ON_COMMAND(IDC_PRINT_TO_FILE, HandlePrintToFile) - ON_COMMAND(IDC_PRINT_COLLATE, HandleCollate) - ON_COMMAND_RANGE(IDC_PRINT_RANGE_ALL, IDC_PRINT_RANGE_PAGES, HandlePrintRange) -#else - // Either vista/x64 doesn't like the old version above. ON_MESSAGE(WM_INITDIALOG, &CPythonPrtDlgFramework<T>::HandleInitDialog) ON_COMMAND(IDC_PRINT_TO_FILE, &CPythonPrtDlgFramework<T>::HandlePrintToFile) ON_COMMAND(IDC_PRINT_COLLATE, &CPythonPrtDlgFramework<T>::HandleCollate) ON_COMMAND_RANGE(IDC_PRINT_RANGE_ALL, IDC_PRINT_RANGE_PAGES, &CPythonPrtDlgFramework<T>::HandlePrintRange) -#endif {0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 } }; diff -r 07ce8a09c2ac -r f7dd8d279929 com/win32com/client/genpy.py --- a/com/win32com/client/genpy.py Wed Apr 10 23:03:24 2013 -0400 +++ b/com/win32com/client/genpy.py Sun Apr 14 01:00:24 2013 -0400 @@ -204,22 +204,14 @@ vdesc = entry.desc if vdesc[4] == pythoncom.VAR_CONST: val = vdesc[1] - if sys.version_info <= (2,4) and (isinstance(val, int) or isinstance(val, long)): - # in python 2.3, 0x80000000L == 2147483648 - if val==2147483648: # == 0x80000000L - special case for 2.3... - use = "0x80000000L" # 'L' for future warning - elif val > 2147483648 or val < 0: # avoid a FutureWarning - use = long(val) - else: - use = hex(val) - else: - use = repr(val) - # Make sure the repr of the value is valid python syntax - # still could cause an error on import if it contains a module or type name - # not available in the global namespace - try: + + use = repr(val) + # Make sure the repr of the value is valid python syntax + # still could cause an error on import if it contains a module or type name + # not available in the global namespace + try: compile(use, '<makepy>', 'eval') - except SyntaxError: + except SyntaxError: # At least add the repr as a string, so it can be investigated further # Sanitize it, in case the repr contains its own quotes. (??? line breaks too ???) use = use.replace('"',"'") diff -r 07ce8a09c2ac -r f7dd8d279929 com/win32com/test/pippo_server.py --- a/com/win32com/test/pippo_server.py Wed Apr 10 23:03:24 2013 -0400 +++ b/com/win32com/test/pippo_server.py Sun Apr 14 01:00:24 2013 -0400 @@ -8,11 +8,6 @@ import winerror from win32com.server.util import wrap -try: - __file__ # 2.3 only for __main__ -except NameError: - __file__ = sys.argv[0] - class CPippo: # # COM declarations diff -r 07ce8a09c2ac -r f7dd8d279929 win32/Demos/OpenEncryptedFileRaw.py --- a/win32/Demos/OpenEncryptedFileRaw.py Wed Apr 10 23:03:24 2013 -0400 +++ b/win32/Demos/OpenEncryptedFileRaw.py Sun Apr 14 01:00:24 2013 -0400 @@ -6,7 +6,7 @@ ## print fnamein, fnameout, buflen f.write(input_buffer) ## python 2.3 throws an error if return value is a plain int - return long(winerror.ERROR_SUCCESS) + return winerror.ERROR_SUCCESS def WriteCallback(output_buffer, data, buflen): fnamebackup, fnameout, f = data diff -r 07ce8a09c2ac -r f7dd8d279929 win32/Demos/win32rcparser_demo.py --- a/win32/Demos/win32rcparser_demo.py Wed Apr 10 23:03:24 2013 -0400 +++ b/win32/Demos/win32rcparser_demo.py Sun Apr 14 01:00:24 2013 -0400 @@ -7,12 +7,6 @@ import commctrl import sys, os -# We use the .rc file in our 'test' directory. -try: - __file__ -except NameError: # pre 2.3 - __file__ = sys.argv[0] - this_dir = os.path.abspath(os.path.dirname(__file__)) g_rcname = os.path.abspath( os.path.join( this_dir, "..", "test", "win32rcparser", "test.rc")) diff -r 07ce8a09c2ac -r f7dd8d279929 win32/src/win32apimodule.cpp --- a/win32/src/win32apimodule.cpp Wed Apr 10 23:03:24 2013 -0400 +++ b/win32/src/win32apimodule.cpp Sun Apr 14 01:00:24 2013 -0400 @@ -3546,6 +3546,25 @@ } } return true; + + case REG_QWORD: + *retDataSize=sizeof(ULONGLONG); + *retDataBuf = (BYTE *)PyMem_MALLOC(*retDataSize); + if (*retDataBuf==NULL){ + PyErr_NoMemory(); + return false; + } + if (value==Py_None){ + *(ULONGLONG *)*retDataBuf=0; + return true; + } + * (ULONGLONG *)*retDataBuf=PyLong_AsUnsignedLongLong(value); + if (* (ULONGLONG *)*retDataBuf == -1 && PyErr_Occurred()){ + PyMem_Free(*retDataBuf); + *retDataBuf=NULL; + return false; + } + return true; case REG_SZ: case REG_EXPAND_SZ:{ *retDataBuf=NULL; @@ -3592,9 +3611,15 @@ switch (typ) { case REG_DWORD: if (retDataSize==0) - obData = Py_BuildValue("i", 0); + obData = PyInt_FromLong(0); + else // ??? Should be returned as unsigned ??? + obData = PyInt_FromLong(*(int *)retDataBuf); + break; + case REG_QWORD: + if (retDataSize==0) + obData = PyInt_FromLong(0); else - obData = Py_BuildValue("i", *(int *)retDataBuf); + obData = PyLong_FromUnsignedLongLong(*(ULONGLONG *)retDataBuf); break; case REG_SZ: case REG_EXPAND_SZ:{ @@ -4299,6 +4324,8 @@ // @flag REG_BINARY|Binary data in any form. // @flag REG_DWORD|A 32-bit number. // @flag REG_DWORD_LITTLE_ENDIAN|A 32-bit number in little-endian format. This is equivalent to REG_DWORD.<nl>In little-endian format, a multi-byte value is stored in memory from the lowest byte (the little end) to the highest byte. For example, the value 0x12345678 is stored as (0x78 0x56 0x34 0x12) in little-endian format. + // @flag REG_QWORD|A 64-bit number. + // @flag REG_QWORD_LITTLE_ENDIAN|A 64-bit number in little-endian format. This is equivalent to REG_QWORD.<nl>In little-endian format, a multi-byte value is stored in memory from the lowest byte (the little end) to the highest byte. For example, the value 0x12345678 is stored as (0x78 0x56 0x34 0x12) in little-endian format. // Windows NT and Windows 95 are designed to run on little-endian computer architectures. A user may connect to computers that have big-endian architectures, such as some UNIX systems. // @flag REG_DWORD_BIG_ENDIAN|A 32-bit number in big-endian format. // In big-endian format, a multi-byte value is stored in memory from the highest byte (the big end) to the lowest byte. For example, the value 0x12345678 is stored as (0x12 0x34 0x56 0x78) in big-endian format. diff -r 07ce8a09c2ac -r f7dd8d279929 win32/test/test_win32api.py --- a/win32/test/test_win32api.py Wed Apr 10 23:03:24 2013 -0400 +++ b/win32/test/test_win32api.py Sun Apr 14 01:00:24 2013 -0400 @@ -71,6 +71,7 @@ ('REG_MULTI_SZ', win32con.REG_MULTI_SZ, ['string 1','string 2','string 3','string 4']), ('REG_MULTI_SZ_empty', win32con.REG_MULTI_SZ, []), ('REG_DWORD', win32con.REG_DWORD, 666), + ('REG_QWORD', win32con.REG_QWORD, 2**33), ('REG_BINARY', win32con.REG_BINARY, str2bytes('\x00\x01\x02\x03\x04\x05\x06\x07\x08\x01\x00')), ) diff -r 07ce8a09c2ac -r f7dd8d279929 win32/test/test_win32file.py --- a/win32/test/test_win32file.py Wed Apr 10 23:03:24 2013 -0400 +++ b/win32/test/test_win32file.py Sun Apr 14 01:00:24 2013 -0400 @@ -37,10 +37,7 @@ class TestSimpleOps(unittest.TestCase): def testSimpleFiles(self): - try: - fd, filename = tempfile.mkstemp() - except AttributeError: - self.fail("This test requires Python 2.3 or later") + fd, filename = tempfile.mkstemp() os.close(fd) os.unlink(filename) handle = win32file.CreateFile(filename, win32file.GENERIC_WRITE, 0, None, win32con.CREATE_NEW, 0, None) @@ -720,11 +717,7 @@ class TestTransmit(unittest.TestCase): def test_transmit(self): import binascii - try: - bytes = os.urandom(1024*1024) - except AttributeError: - # must be py2.3... - bytes = ''.join([chr(random.randint(0,255)) for _ in range(5)]) + bytes = os.urandom(1024*1024) val = binascii.hexlify(bytes) val_length = len(val) f = tempfile.TemporaryFile() diff -r 07ce8a09c2ac -r f7dd8d279929 win32/test/testall.py --- a/win32/test/testall.py Wed Apr 10 23:03:24 2013 -0400 +++ b/win32/test/testall.py Sun Apr 14 01:00:24 2013 -0400 @@ -73,20 +73,13 @@ def __init__(self, argv): self.argv = argv def __call__(self): - try: - import subprocess - p = subprocess.Popen(self.argv, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - output, _ = p.communicate() - rc = p.returncode - except ImportError: - # py2.3? - fin, fout, ferr = os.popen3(" ".join(self.argv)) - fin.close() - output = fout.read() + ferr.read() - fout.close() - rc = ferr.close() + import subprocess + p = subprocess.Popen(self.argv, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + output, _ = p.communicate() + rc = p.returncode + if rc: base = os.path.basename(self.argv[1]) # See if we can detect and reconstruct an exception in the output. |
From: <pyw...@li...> - 2013-04-11 03:04:58
|
changeset 07ce8a09c2ac in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=07ce8a09c2ac summary: Remove more Python 2.3 workarounds diffstat: Pythonwin/pywin/debugger/debugger.py | 8 +- SWIG/swig_lib/python/pywintypes.i | 13 +- com/win32com/client/build.py | 8 +- com/win32com/test/testShell.py | 7 - com/win32comext/authorization/src/PyGSecurityInformation.cpp | 4 - com/win32comext/shell/src/shell.cpp | 13 - isapi/src/StdAfx.h | 6 - isapi/threaded_extension.py | 9 - pywin32_postinstall.py | 4 +- setup.py | 227 +++------- win32/src/PyWinTypes.h | 103 +---- win32/src/odbc.cpp | 6 - win32/src/win32consolemodule.cpp | 4 - win32/src/win32dynamicdialog.cpp | 5 - win32/src/win32file.i | 8 +- win32/src/win32gui.i | 19 - win32/test/test_win32file.py | 7 +- 17 files changed, 73 insertions(+), 378 deletions(-) diffs (truncated from 815 to 300 lines): diff -r cc9272f5fb01 -r 07ce8a09c2ac Pythonwin/pywin/debugger/debugger.py --- a/Pythonwin/pywin/debugger/debugger.py Mon Apr 08 08:51:02 2013 -0400 +++ b/Pythonwin/pywin/debugger/debugger.py Wed Apr 10 23:03:24 2013 -0400 @@ -651,10 +651,7 @@ try: if start_stepping: self.skipBotFrame = SKIP_STEP else: self.skipBotFrame = SKIP_RUN - if sys.version_info > (2,2): - exec cmd in globals, locals - else: - _doexec(cmd, globals, locals) + exec cmd in globals, locals except bdb.BdbQuit: pass finally: @@ -986,6 +983,3 @@ line = linecache.getline(filename, lineno) print "%s(%d): %s" % (os.path.basename(filename), lineno, line[:-1].expandtabs(4)) return 0 - -def _doexec(cmd, globals, locals): - exec cmd in globals, locals diff -r cc9272f5fb01 -r 07ce8a09c2ac SWIG/swig_lib/python/pywintypes.i --- a/SWIG/swig_lib/python/pywintypes.i Mon Apr 08 08:51:02 2013 -0400 +++ b/SWIG/swig_lib/python/pywintypes.i Wed Apr 10 23:03:24 2013 -0400 @@ -47,18 +47,7 @@ // PyLong_AsUnsignedLongMask isn't ideal - no overflow checking - but // this is what the 'k' format specifier in PyArg_ParseTuple uses, and // that is what much of pywin32 uses for DWORDS, so we use it here too - // Also, Python 2.3 and below will not accept a plain int for the PyLong_* functions - #if (PY_VERSION_HEX < 0x02040000) - { - PyObject *tmpLong = PyNumber_Long($source); - if (tmpLong == NULL) - return NULL; - $target = PyLong_AsUnsignedLongMask(tmpLong); - Py_DECREF(tmpLong); - } - #else - $target = PyLong_AsUnsignedLongMask($source); - #endif + $target = PyLong_AsUnsignedLongMask($source); if ($target==(DWORD)-1 && PyErr_Occurred()) return NULL; } diff -r cc9272f5fb01 -r 07ce8a09c2ac com/win32com/client/build.py --- a/com/win32com/client/build.py Mon Apr 08 08:51:02 2013 -0400 +++ b/com/win32com/client/build.py Wed Apr 10 23:03:24 2013 -0400 @@ -394,13 +394,7 @@ assert typeinfo is not None, "Cant build vtables without type info!" meth_list = list(self.mapFuncs.values()) + list(self.propMapGet.values()) + list(self.propMapPut.values()) - - if sys.version_info < (2,4): - def cmp_vtable_off(m1, m2): - return cmp(m1.desc[7], m2.desc[7]) - meth_list.sort(cmp_vtable_off) - else: - meth_list.sort(key=lambda m: m.desc[7]) + meth_list.sort(key=lambda m: m.desc[7]) # Now turn this list into the run-time representation # (ready for immediate use or writing to gencache) diff -r cc9272f5fb01 -r 07ce8a09c2ac com/win32com/test/testShell.py --- a/com/win32com/test/testShell.py Mon Apr 08 08:51:02 2013 -0400 +++ b/com/win32com/test/testShell.py Wed Apr 10 23:03:24 2013 -0400 @@ -145,9 +145,6 @@ self._testSimple(True) def testComplex(self): - if sys.hexversion < 0x2030000: - # no kw-args to dict in 2.2 - not worth converting! - return clsid = pythoncom.MakeIID("{CD637886-DB8B-4b04-98B5-25731E1495BE}") ctime, atime, wtime = self._getTestTimes() d = dict(cFileName="foo.txt", @@ -163,10 +160,6 @@ def testUnicode(self): # exercise a bug fixed in build 210 - multiple unicode objects failed. - if sys.hexversion < 0x2030000: - # no kw-args to dict in 2.2 - not worth converting! - return - ctime, atime, wtime = self._getTestTimes() d = [dict(cFileName="foo.txt", sizel=(1,2), diff -r cc9272f5fb01 -r 07ce8a09c2ac com/win32comext/authorization/src/PyGSecurityInformation.cpp --- a/com/win32comext/authorization/src/PyGSecurityInformation.cpp Mon Apr 08 08:51:02 2013 -0400 +++ b/com/win32comext/authorization/src/PyGSecurityInformation.cpp Wed Apr 10 23:03:24 2013 -0400 @@ -281,11 +281,7 @@ else{ hr=InvokeViaPolicy("MapGeneric", &result, "OBk", obObjectType, *pAceFlags, *pMask); if (!FAILED(hr)){ -#if (PY_VERSION_HEX < 0x02030000) - *pMask=PyLong_AsUnsignedLong(result); -#else *pMask=PyInt_AsUnsignedLongMask(result); -#endif if ((*pMask==-1) && PyErr_Occurred()) hr=MAKE_PYCOM_GATEWAY_FAILURE_CODE("MapGeneric"); else diff -r cc9272f5fb01 -r 07ce8a09c2ac com/win32comext/shell/src/shell.cpp --- a/com/win32comext/shell/src/shell.cpp Mon Apr 08 08:51:02 2013 -0400 +++ b/com/win32comext/shell/src/shell.cpp Wed Apr 10 23:03:24 2013 -0400 @@ -1053,8 +1053,6 @@ return ok; } -#if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ - // Callback for BrowseForFolder struct PyCallback { PyObject *fn; @@ -1096,8 +1094,6 @@ return rc; } -#endif // PY_VERSION_HEX - // @object PySHELL_ITEM_RESOURCE|Tuple of (<o PyIID>, str) that identifies a shell resource BOOL PyWinObject_AsSHELL_ITEM_RESOURCE(PyObject *ob, SHELL_ITEM_RESOURCE *psir) { @@ -1144,9 +1140,7 @@ TCHAR retPath[MAX_PATH]; bi.pszDisplayName = retPath; LPITEMIDLIST pl = NULL; -#if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ PyCallback pycb; -#endif if(!PyArg_ParseTuple(args, "|OOOlOO:SHBrowseForFolder", &obhwndOwner, // @pyparm <o PyHANDLE>|hwndOwner|None|Parent window for the dialog box, can be None @@ -1159,7 +1153,6 @@ if (!PyWinObject_AsHANDLE(obhwndOwner, (HANDLE *)&bi.hwndOwner)) return NULL; if (obcb != Py_None) { -#if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ if (!PyCallable_Check(obcb)) { PyErr_SetString(PyExc_TypeError, "Callback item must None or a callable object"); goto done; @@ -1168,12 +1161,6 @@ pycb.data = obcbparam; bi.lParam = (LPARAM)&pycb; bi.lpfn = PyBrowseCallbackProc; -#else // PY_VERSION_HEX - PyErr_SetString(PyExc_NotImplementedError, - "Callbacks can only be specified in Python 2.3+"); - return NULL; -#endif // PY_VERSION_HEX - } // else bi.lParam/lpfn remains 0 if (!PyObject_AsPIDL(obPIDL, (LPITEMIDLIST *)&bi.pidlRoot, TRUE)) goto done; diff -r cc9272f5fb01 -r 07ce8a09c2ac isapi/src/StdAfx.h --- a/isapi/src/StdAfx.h Mon Apr 08 08:51:02 2013 -0400 +++ b/isapi/src/StdAfx.h Wed Apr 10 23:03:24 2013 -0400 @@ -37,12 +37,6 @@ #undef small #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 diff -r cc9272f5fb01 -r 07ce8a09c2ac isapi/threaded_extension.py --- a/isapi/threaded_extension.py Mon Apr 08 08:51:02 2013 -0400 +++ b/isapi/threaded_extension.py Wed Apr 10 23:03:24 2013 -0400 @@ -11,15 +11,6 @@ from win32event import INFINITE from pywintypes import OVERLAPPED -# Python 2.3 and earlier insists on "C" locale - if it isn't, subtle things -# break, such as floating point constants loaded from .pyc files. -# The threading module uses such floating-points as an argument to sleep(), -# resulting in extremely long sleeps when tiny intervals are specified. -# We can work around this by resetting the C locale before the import. -if sys.hexversion < 0x02040000: - import locale - locale.setlocale(locale.LC_NUMERIC, "C") - import threading import traceback diff -r cc9272f5fb01 -r 07ce8a09c2ac pywin32_postinstall.py --- a/pywin32_postinstall.py Mon Apr 08 08:51:02 2013 -0400 +++ b/pywin32_postinstall.py Wed Apr 10 23:03:24 2013 -0400 @@ -451,9 +451,7 @@ # Check the MFC dll exists - it is doesn't, point them at it # (I should install it, but its a bit tricky with distutils) # Unfortunately, this is quite likely on Windows XP and MFC71.dll - if sys.hexversion < 0x2040000: - mfc_dll = "mfc42.dll" - elif sys.hexversion < 0x2060000: + if sys.hexversion < 0x2060000: mfc_dll = "mfc71.dll" elif sys.hexversion < 0x2070000: mfc_dll = "mfc90.dll" diff -r cc9272f5fb01 -r 07ce8a09c2ac setup.py --- a/setup.py Mon Apr 08 08:51:02 2013 -0400 +++ b/setup.py Wed Apr 10 23:03:24 2013 -0400 @@ -19,13 +19,10 @@ versions. Below are the Windows SDK versions required (and the URL - although these are subject to being changed by MS at any time:) -Python 2.3->2.5: +Python 2.4->2.5: Microsoft Windows Software Development Kit Update for Windows Vista (version 6.0) http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065 - ** If you want to build Python 2.3, be sure to install the SDK compilers - too - although we don't use them, this setup option installs some .lib - files we do need. - ** + Python 2.6+: Microsoft Windows SDK for Windows 7 and .NET Framework 4 (version 7.1) http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b @@ -94,27 +91,9 @@ from distutils.command.build_py import build_py from distutils.command.build_scripts import build_scripts -try: - from distutils.command.bdist_msi import bdist_msi -except ImportError: - # py23 and earlier - bdist_msi = None -try: - from distutils.msvccompiler import get_build_version -except ImportError: - # py22 - def get_build_version(): - return 6.0 -# nor distutils.log -try: - from distutils import log -except ImportError: - class Log: - def debug(self, msg, *args): - print msg % args - def info(self, msg, *args): - print msg % args - log = Log() +from distutils.command.bdist_msi import bdist_msi +from distutils.msvccompiler import get_build_version +from distutils import log # some modules need a static CRT to avoid problems caused by them having a # manifest. @@ -460,16 +439,14 @@ # basic info - but its better than nothing!) # For now use the temp dir - later we may package them, so should # maybe move them next to the output file. - # ack - but fails with obscure errors in py23 :( - if sys.version_info > (2,4): - pch_dir = os.path.join(build_ext.build_temp) - if not build_ext.debug: - self.extra_compile_args.append("/Zi") - self.extra_compile_args.append("/Fd%s\%s_vc.pdb" % - (pch_dir, self.name)) - self.extra_link_args.append("/DEBUG") - self.extra_link_args.append("/PDB:%s\%s.pdb" % - (pch_dir, self.name)) + pch_dir = os.path.join(build_ext.build_temp) + if not build_ext.debug: + self.extra_compile_args.append("/Zi") + self.extra_compile_args.append("/Fd%s\%s_vc.pdb" % + (pch_dir, self.name)) + self.extra_link_args.append("/DEBUG") + self.extra_link_args.append("/PDB:%s\%s.pdb" % + (pch_dir, self.name)) # enable unwind semantics - some stuff needs it and I can't see # it hurting self.extra_compile_args.append("/EHsc") @@ -807,16 +784,6 @@ os.environ["LIB"] += ";" + os.path.join(sdk_dir, 'VC', 'LIB') log.debug("Vista SDK found: %%LIB%% now %s", os.environ["LIB"]) - if sys.hexversion < 0x02030000: - # Python 2.2 distutils doesn't handle the 'PC'/PCBuild directory for - # us (it only exists if building from the source tree) - extra = os.path.join(sys.exec_prefix, 'PC') - if extra not in self.include_dirs and os.path.isdir(extra): - self.compiler.add_include_dir(extra) - extra = os.path.join(sys.exec_prefix, 'PCBuild') - if extra not in self.library_dirs and os.path.isdir(extra): - self.compiler.add_library_dir(os.path.join(extra)) - def _why_cant_build_extension(self, ext): # Return None, or a reason it can't be built. # This kinda sucks, but I'm giving up on exchange support in 64bit @@ -884,9 +851,6 @@ return "No library '%s'" % lib self.found_libraries[lib.lower()] = found patched_libs.append(os.path.splitext(os.path.basename(found))[0]) - # axdebug struggles under debug builds - worry about that when I care :) |
From: <pyw...@li...> - 2013-04-08 12:51:47
|
changeset cc9272f5fb01 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=cc9272f5fb01 summary: Remove rest of .dsp files diffstat: .hgignore | 7 + MANIFEST.in | 1 - Pythonwin/Scintilla.dsp | 97 --- Pythonwin/_All Pythonwin.dsp | 81 -- Pythonwin/dde.dsp | 134 ---- Pythonwin/pythonwin.dsp | 154 ----- Pythonwin/win32ui.dsp | 959 --------------------------------- Pythonwin/win32uiole.dsp | 144 ---- setup.py | 259 ++++++-- win32/PyWinTypes.dsp | 185 ------ win32/PythonService servicemanager.dsp | 146 ----- win32/src/win32popen.cpp | 1 - win32/src/win32popenWin9x.cpp | 63 -- win32/src/win32popenWin9x.rc | 4 - win32/win32popenWin9x.dsp | 75 -- 15 files changed, 205 insertions(+), 2105 deletions(-) diffs (truncated from 2465 to 300 lines): diff -r 125b33816ad5 -r cc9272f5fb01 .hgignore --- a/.hgignore Mon Apr 08 02:04:05 2013 -0400 +++ b/.hgignore Mon Apr 08 08:51:02 2013 -0400 @@ -11,6 +11,7 @@ *.ncb *.opt *.plg +*.flg *.chm *.chw *.pyc @@ -43,3 +44,9 @@ win32/src/win32service_messages.h win32/src/win32evtlog_messages.h isapi/src/pyISAPI_messages.h + +# VC2003 and up project files +*.sln +*.suo +*.vcproj +*.user diff -r 125b33816ad5 -r cc9272f5fb01 MANIFEST.in --- a/MANIFEST.in Mon Apr 08 02:04:05 2013 -0400 +++ b/MANIFEST.in Mon Apr 08 08:51:02 2013 -0400 @@ -12,7 +12,6 @@ # don't know how to include "Python and Extensions.dsw" - spaces upset things # Core win32 stuff include win32/src/*.rc -include win32/src/win32popenWin9x.cpp include win32/scripts/*.py include win32/help/*.d include win32/help/*.html diff -r 125b33816ad5 -r cc9272f5fb01 Pythonwin/Scintilla.dsp --- a/Pythonwin/Scintilla.dsp Mon Apr 08 02:04:05 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Scintilla" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=Scintilla - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "Scintilla.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "Scintilla.mak" CFG="Scintilla - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Scintilla - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "Scintilla - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "Scintilla - Win32 Release" - -# PROP BASE Use_MFC -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\Scintilla\Release" -# PROP BASE Cmd_Line "NMAKE /f Scintilla.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "Scintilla.exe" -# PROP BASE Bsc_Name "Scintilla.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\Scintilla\Release" -# PROP Cmd_Line "cd Scintilla && nmake /nologo /f makefile_pythonwin" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Build\Scintilla.dll" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "Scintilla - Win32 Debug" - -# PROP BASE Use_MFC -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\Scintilla\Debug" -# PROP BASE Cmd_Line "NMAKE /f Scintilla.mak" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "Scintilla.exe" -# PROP BASE Bsc_Name "Scintilla.bsc" -# PROP BASE Target_Dir "" -# PROP Use_MFC -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\Scintilla\Debug" -# PROP Cmd_Line "cd Scintilla && nmake /f makefile_pythonwin DEBUG=1" -# PROP Rebuild_Opt "/a" -# PROP Target_File "Build\Scintilla_d.dll" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "Scintilla - Win32 Release" -# Name "Scintilla - Win32 Debug" - -!IF "$(CFG)" == "Scintilla - Win32 Release" - -!ELSEIF "$(CFG)" == "Scintilla - Win32 Debug" - -!ENDIF - -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff -r 125b33816ad5 -r cc9272f5fb01 Pythonwin/_All Pythonwin.dsp --- a/Pythonwin/_All Pythonwin.dsp Mon Apr 08 02:04:05 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -# Microsoft Developer Studio Project File - Name="_All Pythonwin" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) External Target" 0x0106 - -CFG=_All Pythonwin - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "_All Pythonwin.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "_All Pythonwin.mak" CFG="_All Pythonwin - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "_All Pythonwin - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE "_All Pythonwin - Win32 Debug" (based on "Win32 (x86) External Target") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName ""$/Python/Pythonwin", OOAAAAAA" -# PROP Scc_LocalPath "." - -!IF "$(CFG)" == "_All Pythonwin - Win32 Release" - -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Cmd_Line "NMAKE /f "_All Pythonwin.mak"" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "_All Pythonwin.exe" -# PROP BASE Bsc_Name "_All Pythonwin.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Cmd_Line "" -# PROP Rebuild_Opt "" -# PROP Target_File "_All Pythonwin.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ELSEIF "$(CFG)" == "_All Pythonwin - Win32 Debug" - -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Cmd_Line "NMAKE /f "_All Pythonwin.mak"" -# PROP BASE Rebuild_Opt "/a" -# PROP BASE Target_File "_All Pythonwin.exe" -# PROP BASE Bsc_Name "_All Pythonwin.bsc" -# PROP BASE Target_Dir "" -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "" -# PROP Rebuild_Opt "" -# PROP Target_File "_All Pythonwin.exe" -# PROP Bsc_Name "" -# PROP Target_Dir "" - -!ENDIF - -# Begin Target - -# Name "_All Pythonwin - Win32 Release" -# Name "_All Pythonwin - Win32 Debug" - -!IF "$(CFG)" == "_All Pythonwin - Win32 Release" - -!ELSEIF "$(CFG)" == "_All Pythonwin - Win32 Debug" - -!ENDIF - -# End Target -# End Project diff -r 125b33816ad5 -r cc9272f5fb01 Pythonwin/dde.dsp --- a/Pythonwin/dde.dsp Mon Apr 08 02:04:05 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dde" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=dde - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dde.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dde.mak" CFG="dde - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dde - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "dde - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName ""$/Python/win32", EJAAAAAA" -# PROP Scc_LocalPath "." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dde - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\dde\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\dde\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\win32\src" /D "_AFXDLL" /D "_AFXEXT" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "NDEBUG" /D "STRICT" /YX"stdafxdde.h" /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1ec00000" /subsystem:windows /dll /debug /machine:I386 /out:"Build\dde.pyd" /libpath:"..\win32\build" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "dde - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\dde\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\dde\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\win32\src" /D "_AFXDLL" /D "_AFXEXT" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "_DEBUG" /D "STRICT" /YX"stdafxdde.h" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0x409 /d "_DEBUG" |
From: <pyw...@li...> - 2013-04-08 06:04:52
|
changeset 125b33816ad5 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=125b33816ad5 summary: Remove several .dsp files and specify sources in setup.py diffstat: setup.py | 44 ++++++++---- win32/perfmon.dsp | 117 -------------------------------- win32/perfmondata.dsp | 179 -------------------------------------------------- win32/win2kras.dsp | 99 --------------------------- win32/win32help.dsp | 102 ---------------------------- win32/win32lz.dsp | 102 ---------------------------- win32/win32pdh.dsp | 102 ---------------------------- win32/win32print.dsp | 97 --------------------------- win32/win32ras.dsp | 102 ---------------------------- win32/win32trace.dsp | 102 ---------------------------- win32/win32wnet.dsp | 113 ------------------------------- 11 files changed, 29 insertions(+), 1130 deletions(-) diffs (truncated from 1249 to 300 lines): diff -r ce279fb3d610 -r 125b33816ad5 setup.py --- a/setup.py Sun Apr 07 23:55:50 2013 -0400 +++ b/setup.py Mon Apr 08 02:04:05 2013 -0400 @@ -1617,11 +1617,15 @@ win32_extensions = [pywintypes] win32_extensions.append( - WinExt_win32("perfmondata", - libraries="advapi32", - unicode_mode=True, - export_symbol_file = "win32/src/PerfMon/perfmondata.def", - is_regular_dll = 1, + WinExt_win32("perfmondata", + sources=[ + "win32/src/PerfMon/perfmondata.cpp", + "win32/src/PerfMon/PyPerfMsgs.mc", + ], + libraries="advapi32", + unicode_mode=True, + export_symbol_file = "win32/src/PerfMon/perfmondata.def", + is_regular_dll = 1, ), ) @@ -1629,9 +1633,14 @@ # (name, libraries, UNICODE, WINVER, sources) ("mmapfile", "", None, None, "win32/src/mmapfilemodule.cpp"), ("odbc", "odbc32 odbccp32", None, None, "win32/src/odbc.cpp"), - ("perfmon", "", True), + ("perfmon", "", True, None, """ + win32/src/PerfMon/MappingManager.cpp + win32/src/PerfMon/PerfCounterDefn.cpp + win32/src/PerfMon/PerfObjectType.cpp + win32/src/PerfMon/PyPerfMon.cpp + """), ("timer", "user32", None, None, "win32/src/timermodule.cpp"), - ("win2kras", "rasapi32", None, 0x0500), + ("win2kras", "rasapi32", None, 0x0500, "win32/src/win2krasmodule.cpp"), ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ("win32crypt", "Crypt32", None, 0x0500, 'win32/src/win32crypt.i'), ("win32file", "", None, 0x0500, """ @@ -1643,19 +1652,19 @@ # win32gui handled below ("win32job", "user32", True, 0x0500, 'win32/src/win32job.i'), - ("win32lz", "lz32", None), + ("win32lz", "lz32", None, None, "win32/src/win32lzmodule.cpp"), ("win32net", "netapi32 advapi32", True, None, """ win32/src/win32net/win32netfile.cpp win32/src/win32net/win32netgroup.cpp win32/src/win32net/win32netmisc.cpp win32/src/win32net/win32netmodule.cpp win32/src/win32net/win32netsession.cpp win32/src/win32net/win32netuse.cpp win32/src/win32net/win32netuser.cpp """), - ("win32pdh", "", True), + ("win32pdh", "", True, None, "win32/src/win32pdhmodule.cpp"), ("win32pipe", "", None, None, 'win32/src/win32pipe.i win32/src/win32popen.cpp'), - ("win32print", "winspool user32 gdi32", None, 0x0500), + ("win32print", "winspool user32 gdi32", None, 0x0500, "win32/src/win32print/win32print.cpp"), ("win32process", "advapi32 user32", None, 0x0500, "win32/src/win32process.i"), ("win32profile", "Userenv", True, None, 'win32/src/win32profilemodule.cpp'), - ("win32ras", "rasapi32 user32", None, 0x0500), + ("win32ras", "rasapi32 user32", None, 0x0500, "win32/src/win32rasmodule.cpp"), ("win32security", "advapi32 user32 netapi32", True, 0x0500, """ win32/src/win32security.i win32/src/win32security_sspi.cpp win32/src/win32security_ds.cpp @@ -1664,12 +1673,16 @@ win32/src/win32service_messages.mc win32/src/win32service.i """), - ("win32trace", "advapi32", None), - ("win32wnet", "netapi32 mpr", None), + ("win32trace", "advapi32", None, None, "win32/src/win32trace.cpp"), + ("win32wnet", "netapi32 mpr", None, None, """ + win32/src/win32wnet/PyNCB.cpp + win32/src/win32wnet/PyNetresource.cpp + win32/src/win32wnet/win32wnet.cpp + """), ("win32inet", "wininet", None, 0x500, """ win32/src/win32inet.i - win32/src/win32inet_winhttp.cpp""" - ), + win32/src/win32inet_winhttp.cpp + """), ("win32console", "kernel32", True, 0x0501, "win32/src/win32consolemodule.cpp"), ("win32ts", "WtsApi32", True, 0x0501, "win32/src/win32tsmodule.cpp"), ("_win32sysloader", "", None, 0x0501, "win32/src/_win32sysloader.cpp"), @@ -1760,6 +1773,7 @@ win32help_libs += " RunTmChk" win32_extensions += [ WinExt_win32('win32help', + sources = ["win32/src/win32helpmodule.cpp"], libraries=win32help_libs, windows_h_version = 0x500), ] diff -r ce279fb3d610 -r 125b33816ad5 win32/perfmon.dsp --- a/win32/perfmon.dsp Sun Apr 07 23:55:50 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="perfmon" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=perfmon - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "perfmon.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "perfmon.mak" CFG="perfmon - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "perfmon - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "perfmon - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "perfmon - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\perfmon\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\perfmon\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\win32\src" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "STRICT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0xc09 /d "NDEBUG" -# ADD RSC /l 0xc09 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Build\perfmon.pyd" - -!ELSEIF "$(CFG)" == "perfmon - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\perfmon\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\perfmon\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\win32\src" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "STRICT" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0xc09 /d "_DEBUG" -# ADD RSC /l 0xc09 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Build\perfmon_d.pyd" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "perfmon - Win32 Release" -# Name "perfmon - Win32 Debug" -# Begin Source File - -SOURCE=.\src\perfmon\MappingManager.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\perfmon\PerfCounterDefn.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\perfmon\PerfObjectType.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\perfmon\PyPerfMon.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\perfmon\pyperfmon.h -# End Source File -# Begin Source File - -SOURCE=.\src\perfmon\PyPerfMonControl.h -# End Source File -# End Target -# End Project diff -r ce279fb3d610 -r 125b33816ad5 win32/perfmondata.dsp --- a/win32/perfmondata.dsp Sun Apr 07 23:55:50 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -# Microsoft Developer Studio Project File - Name="perfmondata" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=perfmondata - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "perfmondata.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "perfmondata.mak" CFG="perfmondata - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "perfmondata - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "perfmondata - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName ""$/Python/win32/PerfMon", PNCAAAAA" -# PROP Scc_LocalPath "." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "perfmondata - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\perfmondata\Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\perfmon\Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "STRICT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0xc09 /d "NDEBUG" -# ADD RSC /l 0xc09 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /def:".\src\perfmon\perfmondata.def" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "perfmondata - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Build" -# PROP BASE Intermediate_Dir "Build\Temp\perfmondata\Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Build" -# PROP Intermediate_Dir "Build\Temp\perfmondata\Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -F90=df.exe -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "STRICT" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" -# ADD BASE RSC /l 0xc09 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo |
From: Vern C. <kf...@ya...> - 2013-04-08 05:20:28
|
I have now manually merged these changes into the other copy of the adodbapi source. I had missed the one in adodbapitest.py -- thank you so much for finding it! I am in the midst of a major update to adodbapi. All of the bugs in the tracker have been taken care of. Any remaining incompatibilities with django will be removed and django-mssql refactored to call our fork of adodbapi. This is expected to lead to the inclusion of SQL Server support as part of mainstream django! Without your help, it would not have happened. -- Vernon ________________________________ From: "pyw...@li..." <pyw...@li...> To: pyw...@li... Sent: Sunday, April 7, 2013 9:56 PM Subject: [pywin32-checkins] /hgroot/pywin32/pywin32: Remove decimal_23 (opening salvo for re... changeset ce279fb3d610 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=ce279fb3d610 summary: Remove decimal_23 (opening salvo for removing python 2.3 support) diffstat: adodbapi/adodbapi.py | 5 +- adodbapi/test/adodbapitest.py | 7 +- com/win32com/decimal_23.py | 3047 ------------------------------------ com/win32com/readme.htm | 14 - com/win32com/src/PyComHelpers.cpp | 6 - com/win32com/test/testPyComTest.py | 8 +- setup.py | 4 +- 7 files changed, 7 insertions(+), 3084 deletions(-) diffs (truncated from 3159 to 300 lines): diff -r 461250d92627 -r ce279fb3d610 adodbapi/adodbapi.py --- a/adodbapi/adodbapi.py Sun Apr 07 19:11:08 2013 -0400 +++ b/adodbapi/adodbapi.py Sun Apr 07 23:55:50 2013 -0400 @@ -40,10 +40,7 @@ #import traceback import datetime -try: - import decimal -except ImportError: #perhaps running Cpython 2.3 - import win32com.decimal_23 as decimal +import decimal # or # from django.utils import _decimal as decimal |
From: <pyw...@li...> - 2013-04-08 03:56:58
|
changeset ce279fb3d610 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=ce279fb3d610 summary: Remove decimal_23 (opening salvo for removing python 2.3 support) diffstat: adodbapi/adodbapi.py | 5 +- adodbapi/test/adodbapitest.py | 7 +- com/win32com/decimal_23.py | 3047 ------------------------------------ com/win32com/readme.htm | 14 - com/win32com/src/PyComHelpers.cpp | 6 - com/win32com/test/testPyComTest.py | 8 +- setup.py | 4 +- 7 files changed, 7 insertions(+), 3084 deletions(-) diffs (truncated from 3159 to 300 lines): diff -r 461250d92627 -r ce279fb3d610 adodbapi/adodbapi.py --- a/adodbapi/adodbapi.py Sun Apr 07 19:11:08 2013 -0400 +++ b/adodbapi/adodbapi.py Sun Apr 07 23:55:50 2013 -0400 @@ -40,10 +40,7 @@ #import traceback import datetime -try: - import decimal -except ImportError: #perhaps running Cpython 2.3 - import win32com.decimal_23 as decimal +import decimal # or # from django.utils import _decimal as decimal diff -r 461250d92627 -r ce279fb3d610 adodbapi/test/adodbapitest.py --- a/adodbapi/test/adodbapitest.py Sun Apr 07 19:11:08 2013 -0400 +++ b/adodbapi/test/adodbapitest.py Sun Apr 07 23:55:50 2013 -0400 @@ -51,11 +51,8 @@ import ado_consts except ImportError: from adodbapi import ado_consts - -try: - import decimal -except ImportError: - import win32com.decimal_23 as decimal + +import decimal def str2bytes(sval): if sys.version_info < (3,0) and isinstance(sval, str): diff -r 461250d92627 -r ce279fb3d610 com/win32com/decimal_23.py --- a/com/win32com/decimal_23.py Sun Apr 07 19:11:08 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3047 +0,0 @@ -# <win32com> -# This is a clone of Python 2.4's 'decimal' module. It will only be used when -# 'import decimal' fails - so is likely to be used in Python 2.3. -# </win32com> -# Copyright (c) 2004 Python Software Foundation. -# All rights reserved. - -# Written by Eric Price <eprice at tjhsst.edu> -# and Facundo Batista <facundo at taniquetil.com.ar> -# and Raymond Hettinger <python at rcn.com> -# and Aahz <aahz at pobox.com> -# and Tim Peters - -# This module is currently Py2.3 compatible and should be kept that way -# unless a major compelling advantage arises. IOW, 2.3 compatibility is -# strongly preferred, but not guaranteed. - -# Also, this module should be kept in sync with the latest updates of -# the IBM specification as it evolves. Those updates will be treated -# as bug fixes (deviation from the spec is a compatibility, usability -# bug) and will be backported. At this point the spec is stabilizing -# and the updates are becoming fewer, smaller, and less significant. - -""" -This is a Py2.3 implementation of decimal floating point arithmetic based on -the General Decimal Arithmetic Specification: - - www2.hursley.ibm.com/decimal/decarith.html - -and IEEE standard 854-1987: - - www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html - -Decimal floating point has finite precision with arbitrarily large bounds. - -The purpose of the module is to support arithmetic using familiar -"schoolhouse" rules and to avoid the some of tricky representation -issues associated with binary floating point. The package is especially -useful for financial applications or for contexts where users have -expectations that are at odds with binary floating point (for instance, -in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead -of the expected Decimal("0.00") returned by decimal floating point). - -Here are some examples of using the decimal module: - ->>> from decimal import * ->>> setcontext(ExtendedContext) ->>> Decimal(0) -Decimal("0") ->>> Decimal("1") -Decimal("1") ->>> Decimal("-.0123") -Decimal("-0.0123") ->>> Decimal(123456) -Decimal("123456") ->>> Decimal("123.45e12345678901234567890") -Decimal("1.2345E+12345678901234567892") ->>> Decimal("1.33") + Decimal("1.27") -Decimal("2.60") ->>> Decimal("12.34") + Decimal("3.87") - Decimal("18.41") -Decimal("-2.20") ->>> dig = Decimal(1) ->>> print dig / Decimal(3) -0.333333333 ->>> getcontext().prec = 18 ->>> print dig / Decimal(3) -0.333333333333333333 ->>> print dig.sqrt() -1 ->>> print Decimal(3).sqrt() -1.73205080756887729 ->>> print Decimal(3) ** 123 -4.85192780976896427E+58 ->>> inf = Decimal(1) / Decimal(0) ->>> print inf -Infinity ->>> neginf = Decimal(-1) / Decimal(0) ->>> print neginf --Infinity ->>> print neginf + inf -NaN ->>> print neginf * inf --Infinity ->>> print dig / 0 -Infinity ->>> getcontext().traps[DivisionByZero] = 1 ->>> print dig / 0 -Traceback (most recent call last): - ... - ... - ... -DivisionByZero: x / 0 ->>> c = Context() ->>> c.traps[InvalidOperation] = 0 ->>> print c.flags[InvalidOperation] -0 ->>> c.divide(Decimal(0), Decimal(0)) -Decimal("NaN") ->>> c.traps[InvalidOperation] = 1 ->>> print c.flags[InvalidOperation] -1 ->>> c.flags[InvalidOperation] = 0 ->>> print c.flags[InvalidOperation] -0 ->>> print c.divide(Decimal(0), Decimal(0)) -Traceback (most recent call last): - ... - ... - ... -InvalidOperation: 0 / 0 ->>> print c.flags[InvalidOperation] -1 ->>> c.flags[InvalidOperation] = 0 ->>> c.traps[InvalidOperation] = 0 ->>> print c.divide(Decimal(0), Decimal(0)) -NaN ->>> print c.flags[InvalidOperation] -1 ->>> -""" - -__all__ = [ - # Two major classes - 'Decimal', 'Context', - - # Contexts - 'DefaultContext', 'BasicContext', 'ExtendedContext', - - # Exceptions - 'DecimalException', 'Clamped', 'InvalidOperation', 'DivisionByZero', - 'Inexact', 'Rounded', 'Subnormal', 'Overflow', 'Underflow', - - # Constants for use in setting up contexts - 'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING', - 'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', - - # Functions for manipulating contexts - 'setcontext', 'getcontext' -] - -import copy - -#Rounding -ROUND_DOWN = 'ROUND_DOWN' -ROUND_HALF_UP = 'ROUND_HALF_UP' -ROUND_HALF_EVEN = 'ROUND_HALF_EVEN' -ROUND_CEILING = 'ROUND_CEILING' -ROUND_FLOOR = 'ROUND_FLOOR' -ROUND_UP = 'ROUND_UP' -ROUND_HALF_DOWN = 'ROUND_HALF_DOWN' - -#Rounding decision (not part of the public API) -NEVER_ROUND = 'NEVER_ROUND' # Round in division (non-divmod), sqrt ONLY -ALWAYS_ROUND = 'ALWAYS_ROUND' # Every operation rounds at end. - -#Errors - -class DecimalException(ArithmeticError): - """Base exception class. - - Used exceptions derive from this. - If an exception derives from another exception besides this (such as - Underflow (Inexact, Rounded, Subnormal) that indicates that it is only - called if the others are present. This isn't actually used for - anything, though. - - handle -- Called when context._raise_error is called and the - trap_enabler is set. First argument is self, second is the - context. More arguments can be given, those being after - the explanation in _raise_error (For example, - context._raise_error(NewError, '(-x)!', self._sign) would - call NewError().handle(context, self._sign).) - - To define a new exception, it should be sufficient to have it derive - from DecimalException. - """ - def handle(self, context, *args): - pass - - -class Clamped(DecimalException): - """Exponent of a 0 changed to fit bounds. - - This occurs and signals clamped if the exponent of a result has been - altered in order to fit the constraints of a specific concrete - representation. This may occur when the exponent of a zero result would - be outside the bounds of a representation, or when a large normal - number would have an encoded exponent that cannot be represented. In - this latter case, the exponent is reduced to fit and the corresponding - number of zero digits are appended to the coefficient ("fold-down"). - """ - - -class InvalidOperation(DecimalException): - """An invalid operation was performed. - - Various bad things cause this: - - Something creates a signaling NaN - -INF + INF - 0 * (+-)INF - (+-)INF / (+-)INF - x % 0 - (+-)INF % x - x._rescale( non-integer ) - sqrt(-x) , x > 0 - 0 ** 0 - x ** (non-integer) - x ** (+-)INF - An operand is invalid - """ - def handle(self, context, *args): - if args: - if args[0] == 1: #sNaN, must drop 's' but keep diagnostics - return Decimal( (args[1]._sign, args[1]._int, 'n') ) - return NaN - -class ConversionSyntax(InvalidOperation): - """Trying to convert badly formed string. - - This occurs and signals invalid-operation if an string is being - converted to a number and it does not conform to the numeric string - syntax. The result is [0,qNaN]. - """ - - def handle(self, context, *args): - return (0, (0,), 'n') #Passed to something which uses a tuple. - -class DivisionByZero(DecimalException, ZeroDivisionError): - """Division by 0. - - This occurs and signals division-by-zero if division of a finite number - by zero was attempted (during a divide-integer or divide operation, or a - power operation with negative right-hand operand), and the dividend was - not zero. - - The result of the operation is [sign,inf], where sign is the exclusive - or of the signs of the operands for divide, or is 1 for an odd power of - -0, for power. - """ - - def handle(self, context, sign, double = None, *args): - if double is not None: - return (Infsign[sign],)*2 - return Infsign[sign] - -class DivisionImpossible(InvalidOperation): - """Cannot perform the division adequately. - - This occurs and signals invalid-operation if the integer result of a - divide-integer or remainder operation had too many digits (would be - longer than precision). The result is [0,qNaN]. - """ - - def handle(self, context, *args): - return (NaN, NaN) - -class DivisionUndefined(InvalidOperation, ZeroDivisionError): - """Undefined result of division. - - This occurs and signals invalid-operation if division by zero was - attempted (during a divide-integer, divide, or remainder operation), and - the dividend is also zero. The result is [0,qNaN]. - """ |
From: <pyw...@li...> - 2013-04-07 23:12:08
|
changeset 461250d92627 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=461250d92627 summary: Add a counterpart to VB's Nothing, from patch 3609027 by Stefan Schukat diffstat: com/win32com/src/MiscTypes.cpp | 32 ++++++++++++++++++++++++++++++++ com/win32com/src/PythonCOM.cpp | 7 ++++++- com/win32com/src/include/PythonCOM.h | 10 +++++++++- com/win32com/src/oleargs.cpp | 6 ++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diffs (116 lines): diff -r 582b206cd792 -r 461250d92627 com/win32com/src/MiscTypes.cpp --- a/com/win32com/src/MiscTypes.cpp Mon Apr 01 05:36:54 2013 -0400 +++ b/com/win32com/src/MiscTypes.cpp Sun Apr 07 19:11:08 2013 -0400 @@ -195,6 +195,38 @@ } +// code changed by ssc +///////////////////////////////////////////////////////////////////////////// +// class PyOleNothing +PyOleNothing::PyOleNothing() +{ + ob_type = &PyOleNothingType; + _Py_NewReference(this); +} + +static void nothing_dealloc(PyOleNothing *o) +{ + delete o; +} + +PyTypeObject PyOleNothingType = +{ + PYWIN_OBJECT_HEAD + "PyOleNothing", + sizeof(PyOleNothingType), + 0, + (destructor)nothing_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ +}; +// end code changed by ssc + ///////////////////////////////////////////////////////////////////////////// // class PyOleEmpty PyOleEmpty::PyOleEmpty() diff -r 582b206cd792 -r 461250d92627 com/win32com/src/PythonCOM.cpp --- a/com/win32com/src/PythonCOM.cpp Mon Apr 01 05:36:54 2013 -0400 +++ b/com/win32com/src/PythonCOM.cpp Sun Apr 07 19:11:08 2013 -0400 @@ -35,7 +35,7 @@ PyObject *g_obEmpty = NULL; PyObject *g_obMissing = NULL; PyObject *g_obArgNotFound = NULL; - +PyObject *g_obNothing = NULL; PyObject *PyCom_InternalError = NULL; // Storage related functions. @@ -2154,6 +2154,11 @@ g_obArgNotFound = new PyOleArgNotFound; PyDict_SetItemString(dict, "ArgNotFound", g_obArgNotFound); +// code changed by ssc + g_obNothing = new PyOleNothing; + PyDict_SetItemString(dict, "Nothing", g_obNothing); +// end code changed by ssc + // Add some symbolic constants to the module // pycom_Error = PyString_FromString("pythoncom.error"); if (PyWinExc_COMError==NULL) diff -r 582b206cd792 -r 461250d92627 com/win32com/src/include/PythonCOM.h --- a/com/win32com/src/include/PythonCOM.h Mon Apr 01 05:36:54 2013 -0400 +++ b/com/win32com/src/include/PythonCOM.h Sun Apr 07 19:11:08 2013 -0400 @@ -227,6 +227,7 @@ extern PYCOM_EXPORT PyTypeObject PyOleEmptyType; // equivalent to VT_EMPTY extern PYCOM_EXPORT PyTypeObject PyOleMissingType; // special Python handling. extern PYCOM_EXPORT PyTypeObject PyOleArgNotFoundType; // special VT_ERROR value +extern PYCOM_EXPORT PyTypeObject PyOleNothingType; // special VT_ERROR value // ALL of these set an appropriate Python error on bad return. @@ -415,7 +416,7 @@ EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr, PyObject *addnlArgs); ///////////////////////////////////////////////////////////////////////////// -// class PyOleEmpty +// Various special purpose singletons class PYCOM_EXPORT PyOleEmpty : public PyObject { public: @@ -434,6 +435,13 @@ PyOleArgNotFound(); }; +class PYCOM_EXPORT PyOleNothing : public PyObject +{ +public: + PyOleNothing(); +}; + + // We need to dynamically create C++ Python objects // These helpers allow each type object to create it. #define MAKE_PYCOM_CTOR(classname) static PyIUnknown * classname::PyObConstruct(IUnknown *pInitObj) {return new classname(pInitObj);} diff -r 582b206cd792 -r 461250d92627 com/win32com/src/oleargs.cpp --- a/com/win32com/src/oleargs.cpp Mon Apr 01 05:36:54 2013 -0400 +++ b/com/win32com/src/oleargs.cpp Sun Apr 07 19:11:08 2013 -0400 @@ -216,6 +216,12 @@ else if (obj->ob_type == &PyOleEmptyType) { bGoodEmpty = TRUE; } +// code changed by ssc + else if (obj->ob_type == &PyOleNothingType) { + V_VT(var) = VT_DISPATCH; + V_DISPATCH(var) = NULL; + } +// end code changed by ssc else if (obj->ob_type == &PyOleArgNotFoundType) { // use default parameter |
From: <pyw...@li...> - 2013-04-01 09:38:52
|
changeset 582b206cd792 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=582b206cd792 summary: Check for new name of Decimal class from _decimal module in 3.3 (bug #3609059) diffstat: com/win32com/src/oleargs.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diffs (13 lines): diff -r cf327029212a -r 582b206cd792 com/win32com/src/oleargs.cpp --- a/com/win32com/src/oleargs.cpp Fri Mar 29 07:11:19 2013 -0600 +++ b/com/win32com/src/oleargs.cpp Mon Apr 01 05:36:54 2013 -0400 @@ -260,7 +260,8 @@ return FALSE; V_VT(var) = VT_RECORD; } - else if (strcmp(obj->ob_type->tp_name, "Decimal")==0) + // Decimal class from new _decimal module in Python 3.3 shows different name + else if (strcmp(obj->ob_type->tp_name, "Decimal")==0 || strcmp(obj->ob_type->tp_name, "decimal.Decimal")==0) { if (!PyObject_AsCurrency(obj, &V_CY(var))) return FALSE; |
From: <pyw...@li...> - 2013-03-29 13:11:47
|
changeset cf327029212a in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=cf327029212a summary: correct typo & remove unused line diffstat: adodbapi/schema_table.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diffs (19 lines): diff -r e7a557e939d7 -r cf327029212a adodbapi/schema_table.py --- a/adodbapi/schema_table.py Fri Mar 29 07:00:07 2013 -0600 +++ b/adodbapi/schema_table.py Fri Mar 29 07:11:19 2013 -0600 @@ -1,4 +1,4 @@ -""" coll using an open ADO connection --> list of table names""" +"""call using an open ADO connection --> list of table names""" import adodbapi def names(connection_object): @@ -8,8 +8,7 @@ tables = [] while not schema.EOF: name = adodbapi.getIndexedValue(schema.Fields,'TABLE_NAME').Value - type = adodbapi.getIndexedValue(schema.Fields,'TABLE_TYPE').Value + tables.append(name) schema.MoveNext() - tables.append(name) del schema return tables |
From: <pyw...@li...> - 2013-03-29 13:00:50
|
changeset 391e96f815fc in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=391e96f815fc summary: Update adodbapi to version 2.4.3. Split supfolders into separate /test and /examples changeset f56cea9acff0 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=f56cea9acff0 summary: remove adodbapi tests directory changeset e7a557e939d7 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=e7a557e939d7 summary: remove adodbapi tests directory diffstat: .hgignore | 1 + .hgtags | 1 + CHANGES.txt | 10 +- adodbapi/ado_consts.py | 1 + adodbapi/adodbapi.py | 169 +- adodbapi/examples/db_print.py | 52 + adodbapi/examples/db_table_names.py | 24 + adodbapi/examples/test.mdb | 0 adodbapi/examples/xls_read.py | 43 + adodbapi/examples/xls_write.py | 32 + adodbapi/is64bit.py | 33 + adodbapi/readme.txt | 444 ++++--- adodbapi/schema_table.py | 15 + adodbapi/test/RunTests.bat | 22 + adodbapi/test/adodbapitest.py | 993 ++++++++++++++++++ adodbapi/test/adodbapitestconfig.py | 108 + adodbapi/test/dbapi20.py | 870 +++++++++++++++ adodbapi/test/is64bit.py | 33 + adodbapi/test/setuptestframework.py | 86 + adodbapi/test/test_adodbapi_dbapi20.py | 137 ++ adodbapi/test/tryconnection2.py | 10 + adodbapi/test/tryconnection3.py | 10 + adodbapi/tests/.cvsignore | 2 - adodbapi/tests/RunTests.bat | 20 - adodbapi/tests/adodbapitest.py | 924 ---------------- adodbapi/tests/adodbapitestconfig.py | 134 -- adodbapi/tests/db_print.py | 89 - adodbapi/tests/dbapi20.py | 867 --------------- adodbapi/tests/testADOdbapi.py | 919 ---------------- adodbapi/tests/testADOdbapiConfig.py | 138 -- adodbapi/tests/testRun.bat | 21 - adodbapi/tests/test_adodbapi_dbapi20.py | 123 -- com/win32com/src/PyComHelpers.cpp | 11 + com/win32com/src/PythonCOM.cpp | 343 ++++- com/win32com/src/Register.cpp | 21 +- com/win32com/src/extensions/PyICancelMethodCalls.cpp | 96 + com/win32com/src/extensions/PyIClientSecurity.cpp | 248 ++++ com/win32com/src/extensions/PyIContext.cpp | 141 ++ com/win32com/src/extensions/PyIEnumContextProps.cpp | 159 ++ com/win32com/src/extensions/PyIEnumSTATPROPSETSTG.cpp | 113 ++ com/win32com/src/extensions/PyIEnumSTATPROPSTG.cpp | 124 ++- com/win32com/src/extensions/PyIPropertySetStorage.cpp | 86 + com/win32com/src/extensions/PyIPropertyStorage.cpp | 364 ++++++- com/win32com/src/extensions/PyIServerSecurity.cpp | 197 +++ com/win32com/src/include/PyICancelMethodCalls.h | 41 + com/win32com/src/include/PyIClientSecurity.h | 60 + com/win32com/src/include/PyIContext.h | 23 + com/win32com/src/include/PyIEnumContextProps.h | 24 + com/win32com/src/include/PyIEnumSTATPROPSETSTG.h | 27 + com/win32com/src/include/PyIEnumSTATPROPSTG.h | 26 + com/win32com/src/include/PyIPropertySetStorage.h | 33 + com/win32com/src/include/PyIPropertyStorage.h | 64 + com/win32com/src/include/PyIServerSecurity.h | 55 + com/win32com/src/include/PythonCOM.h | 1 + com/win32com/src/include/stdafx.h | 5 +- com/win32comext/shell/demos/ITransferAdviseSink.py | 74 + com/win32comext/shell/shellcon.py | 84 + com/win32comext/shell/src/PyICurrentItem.cpp | 41 + com/win32comext/shell/src/PyICurrentItem.h | 36 + com/win32comext/shell/src/PyIDisplayItem.cpp | 42 + com/win32comext/shell/src/PyIDisplayItem.h | 36 + com/win32comext/shell/src/PyIEnumResources.cpp | 268 ++++ com/win32comext/shell/src/PyIEnumResources.h | 49 + com/win32comext/shell/src/PyIIdentityName.cpp | 41 + com/win32comext/shell/src/PyIIdentityName.h | 36 + com/win32comext/shell/src/PyIRelatedItem.cpp | 108 + com/win32comext/shell/src/PyIRelatedItem.h | 41 + com/win32comext/shell/src/PyIShellItemResources.cpp | 433 +++++++ com/win32comext/shell/src/PyIShellItemResources.h | 82 + com/win32comext/shell/src/PyITransferAdviseSink.cpp | 427 +++++++ com/win32comext/shell/src/PyITransferAdviseSink.h | 76 + com/win32comext/shell/src/PyITransferDestination.cpp | 194 +++ com/win32comext/shell/src/PyITransferDestination.h | 53 + com/win32comext/shell/src/PyITransferMediumItem.cpp | 41 + com/win32comext/shell/src/PyITransferMediumItem.h | 36 + com/win32comext/shell/src/PyITransferSource.cpp | 703 ++++++++++++ com/win32comext/shell/src/PyITransferSource.h | 107 + com/win32comext/shell/src/shell.cpp | 56 +- com/win32comext/shell/src/shell_pch.h | 8 + setup.py | 17 +- win32/src/win32print/win32print.cpp | 6 +- win32/src/win32process.i | 68 + 82 files changed, 8077 insertions(+), 3679 deletions(-) diffs (truncated from 12816 to 300 lines): diff -r 4c7503da2658 -r e7a557e939d7 .hgignore --- a/.hgignore Wed Feb 06 09:37:53 2013 -0500 +++ b/.hgignore Fri Mar 29 07:00:07 2013 -0600 @@ -17,6 +17,7 @@ *.pyo Pythonwin/Scintilla/win32/*.pdb PyWin32.kpf +.idea #Pycharm # COM test bits com\TestSources\Build diff -r 4c7503da2658 -r e7a557e939d7 .hgtags --- a/.hgtags Wed Feb 06 09:37:53 2013 -0500 +++ b/.hgtags Fri Mar 29 07:00:07 2013 -0600 @@ -49,3 +49,4 @@ b7968cc5d12a148df3005979adb804ab79dd1d17 b218 b7968cc5d12a148df3005979adb804ab79dd1d17 b218 ed400a27739ff3ff7a850e69f574a1ad66de6c5e b218 +e97376eb14b6d95e79e01e1bf68ef8427bcbafdc b218.3 diff -r 4c7503da2658 -r e7a557e939d7 CHANGES.txt --- a/CHANGES.txt Wed Feb 06 09:37:53 2013 -0500 +++ b/CHANGES.txt Fri Mar 29 07:00:07 2013 -0600 @@ -6,6 +6,12 @@ Since build 218: ---------------- +* adodbapi updated to version 2.4.3 -- new examples folder includes short programs for + reading and writing .xls spreadsheets and reading ACCESS .mdb files using SQL. + New functions .is64bit.Python() and .is64bit.os() to help pick the correct drivers. + New function .schema_table.names() returns a list of all tables in a database. + see adodbapi/README.txt for more information. + * Fix issue implementing COM objects from within a virtualenv (Kevin Smyth via issue #3597965) @@ -296,7 +302,7 @@ * Added win32inet.WinHttpGetDefaultProxyConfiguration() -* Pythonwin updates from Rémi Paucher; enter completes auto-complete in +* Pythonwin updates from R�mi Paucher; enter completes auto-complete in the editor and interactive windows, auto-complete should now work on French keyboards. (XXX - some of this was reverted - update!) @@ -622,7 +628,7 @@ multiple file names, prevent Windows handle leak in IQueryAssociations. * win32com.adsi: Always return extended error info when available, and expose ADsGetLastError explicitly. -* Leonard Ritter and Robert Förtsch contributed some IE extension samples +* Leonard Ritter and Robert F�rtsch contributed some IE extension samples (see win32com\demos) * .chm documentation now includes a link to search MSDN and google for many API functions diff -r 4c7503da2658 -r e7a557e939d7 adodbapi/ado_consts.py --- a/adodbapi/ado_consts.py Wed Feb 06 09:37:53 2013 -0500 +++ b/adodbapi/ado_consts.py Fri Mar 29 07:00:07 2013 -0600 @@ -26,6 +26,7 @@ # CommandTypeEnum adCmdText = 1 adCmdStoredProc = 4 +adSchemaTables = 20 # ParameterDirectionEnum adParamInput = 1 diff -r 4c7503da2658 -r e7a557e939d7 adodbapi/adodbapi.py --- a/adodbapi/adodbapi.py Wed Feb 06 09:37:53 2013 -0500 +++ b/adodbapi/adodbapi.py Fri Mar 29 07:00:07 2013 -0600 @@ -26,7 +26,7 @@ or IronPython version 2.6 and later, or, after running through 2to3.py, CPython 3.0 or later. """ -__version__ = '2.4.2.2' +__version__ = '2.4.3' version = 'adodbapi v' + __version__ # N.O.T.E.:... # if you have been using an older version of adodbapi and are getting errors because @@ -46,15 +46,9 @@ import win32com.decimal_23 as decimal # or # from django.utils import _decimal as decimal + onIronPython = sys.platform == 'cli' -if not onIronPython: - try: - import win32com.client - except ImportError: - import warnings - warnings.warn("pywin32 package required but not found.",ImportWarning) - -# --- define objects to smooth out IronPython <-> CPython differences +# --- define objects to smooth out IronPython <-> CPython differences if onIronPython: from System import Activator, Type, DBNull, DateTime, Array, Byte from System import Decimal as SystemDecimal @@ -66,13 +60,15 @@ return obj.Item[index] else: #pywin32 try: + import win32com.client import pythoncom import pywintypes pythoncom.__future_currency__ = True def Dispatch(dispatch): return win32com.client.Dispatch(dispatch) - except: - pass #warning already given above + except ImportError: + import warnings + warnings.warn("pywin32 package required but not found.",ImportWarning) def getIndexedValue(obj,index): return obj(index) DBNull = type(None) @@ -107,6 +103,22 @@ raise errorclass(errorvalue) # ----- Time converters ---------------------------------------------- + +# all purpose date to ISO format converter +def _dateObjectToIsoFormatString(obj): + if isinstance(obj, datetime.datetime): + s = obj.strftime('%Y-%m-%d %H:%M:%S') + elif isinstance(obj, datetime.date): #exact midnight + s = obj.strftime('%Y-%m-%d 00:00:00') + elif isinstance(obj, time.struct_time): + s = time.strftime('%Y-%m-%d %H:%M:%S',obj) + else: + try: #usually datetime.datetime + s = obj.isoformat() + except: #but may be mxdatetime + s = obj.Format('%Y-%m-%d %H:%M:%S') + return s + class TimeConverter(object): # this is a generic time converter skeleton def __init__(self): # the details will be filled in by instances self._ordinal_1899_12_31=datetime.date(1899,12,31).toordinal()-1 @@ -131,7 +143,7 @@ raise NotImplementedError #"Abstract class" def DateObjectToIsoFormatString(self,obj): "This function should return a string in the format 'YYYY-MM-dd HH:MM:SS:ms' (ms optional) " - raise NotImplementedError #"Abstract class" + raise NotImplementedError #"Abstract class" # -- Optional: if mx extensions are installed you may use mxDateTime ---- try: @@ -156,7 +168,7 @@ def Timestamp(self,year,month,day,hour,minute,second): return mx.DateTime.Timestamp(year,month,day,hour,minute,second) def DateObjectToIsoFormatString(self,obj): - return obj.Format('%Y-%m-%d %H:%M:%S') + return _dateObjectToIsoFormatString(obj) else: class mxDateTimeConverter(TimeConverter): pass # if no mx is installed @@ -203,16 +215,7 @@ fractPart = ms / 86400000.0 return integerPart + fractPart def DateObjectToIsoFormatString(self,obj): - if isinstance(obj,datetime.datetime): - s = obj.strftime('%Y-%m-%d %H:%M:%S') - elif isinstance(obj,datetime.date): #exact midnight - s = obj.strftime('%Y-%m-%d 00:00:00') - else: - try: #usually datetime.datetime - s = obj.isoformat() - except: #but may be mxdatetime - s = obj.Format('%Y-%m-%d %H:%M:%S') - return s + return _dateObjectToIsoFormatString(obj) class pythonTimeConverter(TimeConverter): # the old, ?nix type date and time def __init__(self): #caution: this Class gets confised by timezones and DST @@ -244,11 +247,7 @@ def Timestamp(self,year,month,day,hour,minute,second): return time.localtime(time.mktime((year,month,day,hour,minute,second,0,0,-1))) def DateObjectToIsoFormatString(self,obj): - try: - s = time.strftime('%Y-%m-%d %H:%M:%S',obj) - except: - s = obj.strftime('%Y-%m-%d') - return s + return _dateObjectToIsoFormatString(obj) dateconverter = pythonDateTimeConverter() # default # ----------------------------------------------------------- @@ -372,17 +371,16 @@ except: return '[]' -def _configure_parameter(p, value, settings_known): +def _configure_parameter(p, value, adotype, settings_known): """Configure the given ADO Parameter 'p' with the Python 'value'.""" - if verbose > 3: - print 'Configuring parameter %s type=%s value="%s"' % (p.Name,p.Type,repr(value)) - if p.Direction not in [adc.adParamInput, adc.adParamInputOutput, adc.adParamUnknown]: - return + if adotype in adoBinaryTypes: + p.Size = len(value) + p.AppendChunk(value) - if isinstance(value,StringTypes): #v2.1 Jevon + elif isinstance(value,StringTypes): #v2.1 Jevon L = len(value) - if p.Type in adoStringTypes: #v2.2.1 Cole + if adotype in adoStringTypes: #v2.2.1 Cole if settings_known: L = min(L,p.Size) #v2.1 Cole limit data to defined size p.Value = value[:L] #v2.1 Jevon & v2.1 Cole else: @@ -390,10 +388,6 @@ if L>0: #v2.1 Cole something does not like p.Size as Zero p.Size = L #v2.1 Jevon - elif isinstance(value, memoryViewType): - p.Size = len(value) - p.AppendChunk(value) - elif isinstance(value, decimal.Decimal): if onIronPython: s = str(value) @@ -415,7 +409,7 @@ p.Precision = digit_count + exponent elif type(value) in dateconverter.types: - if settings_known and p.Type in adoDateTimeTypes: + if settings_known and adotype in adoDateTimeTypes: p.Value=dateconverter.COMDate(value) else: #probably a string #Known problem with JET Provider. Date can not be specified as a COM date. @@ -425,7 +419,7 @@ p.Value = s p.Size = len(s) - elif isinstance(value, longType) and onIronPython: # Iron Python Long + elif onIronPython and isinstance(value, longType) and sys.version_info < (2,7,2): # Iron Python Long s = SystemDecimal(value) # feature workaround for IPy 2.0 p.Value = s @@ -911,20 +905,23 @@ cursor if the sproc defines an integer return value. """ self._new_command(procname, adc.adCmdStoredProc) - self._buildADOparameterList(procname, parameters) + self._buildADOparameterList(procname, parameters, do_refresh=True) + if verbose > 2: + print 'Params=', format_parameters(self.cmd.Parameters, True) self._execute_command() - if parameters != None: - retLst=[] - for p in tuple(self.cmd.Parameters): - if verbose > 2: - print 'returning=', p.Name, p.Type, p.Direction, repr(p.Value) - pyObject=_convert_to_python(p.Value,variantConversions[p.Type]) - if p.Direction == adc.adParamReturnValue: - self.returnValue=pyObject - else: - retLst.append(pyObject) - return retLst + retLst=[] + for p in tuple(self.cmd.Parameters): + if verbose > 2: + print "Returned=Name: %s, Dir.: %s, Type: %s, Size: %s, Value: \"%s\", Precision: %s, NumericScale: %s" % \ + (p.Name, adc.directions[p.Direction], adc.adTypeNames.get(p.Type, str(p.Type)+' (unknown type)'), + p.Size, p.Value, p.Precision, p.NumericScale) + pyObject = _convert_to_python(p.Value,variantConversions[p.Type]) + if p.Direction == adc.adParamReturnValue: + self.returnValue = pyObject + else: + retLst.append(pyObject) + return retLst # return the parameter list to the caller def _reformat_operation(self,operation,parameters): if parameters: @@ -934,44 +931,40 @@ operation, parameters = self._namedToQmark(operation,parameters) return operation,parameters - def _buildADOparameterList(self, operation, parameters): + def _buildADOparameterList(self, operation, parameters, do_refresh=False): self.parameters = parameters self.cmd.CommandText = operation - if parameters != None: + + parameters_known = False + if do_refresh: # needed only if we are calling a stored procedure try: # attempt to use ADO's parameter list self.cmd.Parameters.Refresh() - self.parameters_known = True - except: # if it blows up - self.parameters_known = False - if not self.parameters_known: #-- build own parameter list - if verbose: - print('error in COM Refresh(), so adodbapi is building a parameter list') + parameters_known = True + except: + pass + + if parameters != None: + if parameters_known: # use ado parameter list + i = 0 |
From: <pyw...@li...> - 2013-03-24 16:38:08
|
changeset 8afce48995bf in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=8afce48995bf summary: Add EnumProcessModulesEx (feature request 3608155) diffstat: win32/src/win32process.i | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diffs (99 lines): diff -r 4eb23404a352 -r 8afce48995bf win32/src/win32process.i --- a/win32/src/win32process.i Sun Mar 24 10:37:00 2013 -0400 +++ b/win32/src/win32process.i Sun Mar 24 12:37:29 2013 -0400 @@ -24,6 +24,8 @@ typedef BOOL (WINAPI *EnumProcessModulesfunc)(HANDLE, HMODULE *, DWORD, LPDWORD); static EnumProcessModulesfunc pfnEnumProcessModules = NULL; typedef DWORD (WINAPI *GetModuleFileNameExfunc)(HANDLE, HMODULE, WCHAR *, DWORD); +typedef BOOL (WINAPI *EnumProcessModulesExfunc)(HANDLE, HMODULE*, DWORD, LPDWORD, DWORD); +static EnumProcessModulesExfunc pfnEnumProcessModulesEx = NULL; static GetModuleFileNameExfunc pfnGetModuleFileNameEx = NULL; typedef DWORD (WINAPI *GetProcessIdfunc)(HANDLE); static GetProcessIdfunc pfnGetProcessId = NULL; @@ -1252,6 +1254,65 @@ } %} +// @pyswig (long,....)|EnumProcessModulesEx|Lists 32 or 64-bit modules load by a process +// @comm Requires Vista or later +%native(EnumProcessModulesEx) PyEnumProcessModulesEx; +%{ +PyObject *PyEnumProcessModulesEx(PyObject *self, PyObject *args) +{ + CHECK_PFN(EnumProcessModulesEx); + HMODULE *hmods=NULL, *hmod=NULL; + HANDLE hprocess=NULL; + DWORD nbr_hmods_allocated=100, nbr_hmods_returned=0, tuple_ind=0; + DWORD bytes_allocated=0,bytes_needed=0; + DWORD FilterFlag = LIST_MODULES_DEFAULT; + PyObject *ret=NULL, *obhmod=NULL, *obhprocess; + // @pyparm <o PyHANDLE>|hProcess||Process handle as returned by OpenProcess + // @pyparm int|FilterFlag|LIST_MODULES_DEFAULT|Controls whether 32 or 64-bit modules are returned + if (!PyArg_ParseTuple(args, "O|k:EnumProcessModulesEx", &obhprocess, &FilterFlag)) + return NULL; + if (!PyWinObject_AsHANDLE(obhprocess, &hprocess)) + return NULL; + bytes_allocated=nbr_hmods_allocated*sizeof(HMODULE); + do{ + if (hmods){ + free(hmods); + bytes_allocated=bytes_needed; // unlike EnumProcesses, this one tells you if more space is needed + } + hmods=(HMODULE *)malloc(bytes_allocated); + if (hmods==NULL){ + PyErr_SetString(PyExc_MemoryError,"EnumProcessModulesEx: unable to allocate HMODULE list"); + return NULL; + } + if (!(*pfnEnumProcessModulesEx)(hprocess, hmods, bytes_allocated, &bytes_needed, FilterFlag)){ + PyWin_SetAPIError("EnumProcessModulesEx",GetLastError()); + goto done; + } + } + while (bytes_needed>bytes_allocated); + + nbr_hmods_returned=bytes_needed/sizeof(HMODULE); + ret=PyTuple_New(nbr_hmods_returned); + if (ret==NULL) + goto done; + hmod=hmods; + for (tuple_ind=0;tuple_ind<nbr_hmods_returned;tuple_ind++){ + obhmod=PyWinLong_FromHANDLE(*hmod); + if (obhmod==NULL){ + Py_DECREF(ret); + ret=NULL; + goto done; + } + PyTuple_SET_ITEM(ret,tuple_ind,obhmod); + hmod++; + } +done: + if (hmods) + free (hmods); + return ret; +} +%} + // @pyswig <o PyUNICODE>|GetModuleFileNameEx|Return name of module loaded by another process (uses process handle, not pid) %native(GetModuleFileNameEx) PyGetModuleFileNameEx; %{ @@ -1565,6 +1626,7 @@ if (hmodule!=NULL){ pfnEnumProcesses = (EnumProcessesfunc)GetProcAddress(hmodule, "EnumProcesses"); pfnEnumProcessModules = (EnumProcessModulesfunc)GetProcAddress(hmodule, "EnumProcessModules"); + pfnEnumProcessModulesEx = (EnumProcessModulesExfunc)GetProcAddress(hmodule, "EnumProcessModulesEx"); pfnGetModuleFileNameEx = (GetModuleFileNameExfunc)GetProcAddress(hmodule, "GetModuleFileNameExW"); #ifndef MS_WINCE pfnGetProcessMemoryInfo = (GetProcessMemoryInfofunc)GetProcAddress(hmodule, "GetProcessMemoryInfo"); @@ -1665,6 +1727,12 @@ #define NORMAL_PRIORITY_CLASS NORMAL_PRIORITY_CLASS // Indicates a normal process with no special scheduling needs. #define REALTIME_PRIORITY_CLASS REALTIME_PRIORITY_CLASS // Indicates a process that has the highest possible priority. The threads of a real-time priority class process preempt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a very brief interval can cause disk caches not to flush or cause the mouse to be unresponsive. +// Used with EnumProcessModulesEx +#define LIST_MODULES_32BIT LIST_MODULES_32BIT +#define LIST_MODULES_64BIT LIST_MODULES_64BIT +#define LIST_MODULES_ALL LIST_MODULES_ALL +#define LIST_MODULES_DEFAULT LIST_MODULES_DEFAULT + #define STARTF_FORCEONFEEDBACK STARTF_FORCEONFEEDBACK // Indicates that the cursor is in feedback mode for two seconds after CreateProcess is called. If during those two seconds the process makes the first GUI call, the system gives five more seconds to the process. If during those five seconds the process shows a window, the system gives five more seconds to the process to finish drawing the window. // The system turns the feedback cursor off after the first call to GetMessage, regardless of whether the process is drawing. |
From: <pyw...@li...> - 2013-03-24 14:37:46
|
changeset 4eb23404a352 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=4eb23404a352 summary: Release thread lock when calling OpenPrinter diffstat: win32/src/win32print/win32print.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diffs (16 lines): diff -r 554980ba3e5a -r 4eb23404a352 win32/src/win32print/win32print.cpp --- a/win32/src/win32print/win32print.cpp Sun Mar 24 10:10:32 2013 -0400 +++ b/win32/src/win32print/win32print.cpp Sun Mar 24 10:37:00 2013 -0400 @@ -126,7 +126,11 @@ pprinter_defaults=&printer_defaults; } if (PyWinObject_AsTCHAR(obprinter, &printer, TRUE)){ - if (OpenPrinter(printer, &handle, pprinter_defaults)) + BOOL bsuccess; + Py_BEGIN_ALLOW_THREADS + bsuccess = OpenPrinter(printer, &handle, pprinter_defaults); + Py_END_ALLOW_THREADS + if (bsuccess) ret=PyWinObject_FromPrinterHANDLE(handle); else PyWin_SetAPIError("OpenPrinter"); |
From: <pyw...@li...> - 2013-03-24 14:33:10
|
changeset e97376eb14b6 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=e97376eb14b6 summary: win32com: changeset 554980ba3e5a in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=554980ba3e5a summary: Added tag b218.3 for changeset e97376eb14b6 diffstat: .hgtags | 1 + com/win32com/src/PyComHelpers.cpp | 11 + com/win32com/src/PythonCOM.cpp | 343 ++++++-- com/win32com/src/Register.cpp | 21 +- com/win32com/src/extensions/PyICancelMethodCalls.cpp | 96 ++ com/win32com/src/extensions/PyIClientSecurity.cpp | 248 ++++++ com/win32com/src/extensions/PyIContext.cpp | 141 +++ com/win32com/src/extensions/PyIEnumContextProps.cpp | 159 ++++ com/win32com/src/extensions/PyIEnumSTATPROPSETSTG.cpp | 113 ++ com/win32com/src/extensions/PyIEnumSTATPROPSTG.cpp | 124 +++- com/win32com/src/extensions/PyIPropertySetStorage.cpp | 86 ++ com/win32com/src/extensions/PyIPropertyStorage.cpp | 364 ++++++++- com/win32com/src/extensions/PyIServerSecurity.cpp | 197 +++++ com/win32com/src/include/PyICancelMethodCalls.h | 41 + com/win32com/src/include/PyIClientSecurity.h | 60 + com/win32com/src/include/PyIContext.h | 23 + com/win32com/src/include/PyIEnumContextProps.h | 24 + com/win32com/src/include/PyIEnumSTATPROPSETSTG.h | 27 + com/win32com/src/include/PyIEnumSTATPROPSTG.h | 26 + com/win32com/src/include/PyIPropertySetStorage.h | 33 + com/win32com/src/include/PyIPropertyStorage.h | 64 + com/win32com/src/include/PyIServerSecurity.h | 55 + com/win32com/src/include/PythonCOM.h | 1 + com/win32com/src/include/stdafx.h | 5 +- com/win32comext/shell/demos/ITransferAdviseSink.py | 74 + com/win32comext/shell/shellcon.py | 84 ++ com/win32comext/shell/src/PyICurrentItem.cpp | 41 + com/win32comext/shell/src/PyICurrentItem.h | 36 + com/win32comext/shell/src/PyIDisplayItem.cpp | 42 + com/win32comext/shell/src/PyIDisplayItem.h | 36 + com/win32comext/shell/src/PyIEnumResources.cpp | 268 ++++++ com/win32comext/shell/src/PyIEnumResources.h | 49 + com/win32comext/shell/src/PyIIdentityName.cpp | 41 + com/win32comext/shell/src/PyIIdentityName.h | 36 + com/win32comext/shell/src/PyIRelatedItem.cpp | 108 ++ com/win32comext/shell/src/PyIRelatedItem.h | 41 + com/win32comext/shell/src/PyIShellItemResources.cpp | 433 +++++++++++ com/win32comext/shell/src/PyIShellItemResources.h | 82 ++ com/win32comext/shell/src/PyITransferAdviseSink.cpp | 427 ++++++++++ com/win32comext/shell/src/PyITransferAdviseSink.h | 76 + com/win32comext/shell/src/PyITransferDestination.cpp | 194 ++++ com/win32comext/shell/src/PyITransferDestination.h | 53 + com/win32comext/shell/src/PyITransferMediumItem.cpp | 41 + com/win32comext/shell/src/PyITransferMediumItem.h | 36 + com/win32comext/shell/src/PyITransferSource.cpp | 703 ++++++++++++++++++ com/win32comext/shell/src/PyITransferSource.h | 107 ++ com/win32comext/shell/src/shell.cpp | 56 +- com/win32comext/shell/src/shell_pch.h | 8 + setup.py | 17 +- 49 files changed, 5218 insertions(+), 134 deletions(-) diffs (truncated from 6068 to 300 lines): diff -r 4c7503da2658 -r 554980ba3e5a .hgtags --- a/.hgtags Wed Feb 06 09:37:53 2013 -0500 +++ b/.hgtags Sun Mar 24 10:10:32 2013 -0400 @@ -49,3 +49,4 @@ b7968cc5d12a148df3005979adb804ab79dd1d17 b218 b7968cc5d12a148df3005979adb804ab79dd1d17 b218 ed400a27739ff3ff7a850e69f574a1ad66de6c5e b218 +e97376eb14b6d95e79e01e1bf68ef8427bcbafdc b218.3 diff -r 4c7503da2658 -r 554980ba3e5a com/win32com/src/PyComHelpers.cpp --- a/com/win32com/src/PyComHelpers.cpp Wed Feb 06 09:37:53 2013 -0500 +++ b/com/win32com/src/PyComHelpers.cpp Sun Mar 24 10:10:32 2013 -0400 @@ -419,3 +419,14 @@ Py_XDECREF(obatime); return ret; } + +BOOL PyCom_PyObjectAsSTATPROPSETSTG(PyObject *obstat, STATPROPSETSTG *pstat) +{ + return PyArg_ParseTuple(obstat, "O&O&kO&O&O&:STATPROPSETSTG", + PyWinObject_AsIID, &pstat->fmtid, + PyWinObject_AsIID, &pstat->clsid, + &pstat->grfFlags, + PyWinObject_AsFILETIME, &pstat->mtime, + PyWinObject_AsFILETIME, &pstat->ctime, + PyWinObject_AsFILETIME, &pstat->atime); +} diff -r 4c7503da2658 -r 554980ba3e5a com/win32com/src/PythonCOM.cpp --- a/com/win32com/src/PythonCOM.cpp Wed Feb 06 09:37:53 2013 -0500 +++ b/com/win32com/src/PythonCOM.cpp Sun Mar 24 10:10:32 2013 -0400 @@ -11,12 +11,14 @@ #include "stdafx.h" #include <objbase.h> +#include <ComSvcs.h> #include "PythonCOM.h" #include "PythonCOMServer.h" #include "PyFactory.h" #include "PyRecord.h" #include "PyComTypeObjects.h" #include "OleAcc.h" // for ObjectFromLresult proto... +#include "IAccess.h" // for IAccessControl #include "pyerrors.h" // for PyErr_Warn in 2.5 and earlier... @@ -88,6 +90,11 @@ // Function pointers we load at runtime. #define CHECK_PFN(fname) if (pfn##fname==NULL) return PyCom_BuildPyException(E_NOTIMPL); +// Requires IE 5.5 or later +typedef HRESULT (STDAPICALLTYPE *CreateURLMonikerExfunc)(LPMONIKER,LPCWSTR,LPMONIKER *,DWORD); +static CreateURLMonikerExfunc pfnCreateURLMonikerEx = NULL; + +// Win2k or later typedef HRESULT (STDAPICALLTYPE *CoWaitForMultipleHandlesfunc)(DWORD dwFlags, DWORD dwTimeout, ULONG cHandles, @@ -95,13 +102,25 @@ LPDWORD lpdwindex ); static CoWaitForMultipleHandlesfunc pfnCoWaitForMultipleHandles = NULL; - -typedef HRESULT (STDAPICALLTYPE *CreateURLMonikerExfunc)(LPMONIKER,LPCWSTR,LPMONIKER *,DWORD); -static CreateURLMonikerExfunc pfnCreateURLMonikerEx = NULL; +typedef HRESULT (STDAPICALLTYPE *CoGetObjectContextfunc)(REFIID, void **); +static CoGetObjectContextfunc pfnCoGetObjectContext = NULL; +typedef HRESULT (STDAPICALLTYPE *CoGetCancelObjectfunc)(DWORD, REFIID, void **); +static CoGetCancelObjectfunc pfnCoGetCancelObject = NULL; +typedef HRESULT (STDAPICALLTYPE *CoSetCancelObjectfunc)(IUnknown *); +static CoSetCancelObjectfunc pfnCoSetCancelObject = NULL; // typedefs for the function pointers are in OleAcc.h +// WinXP or later LPFNOBJECTFROMLRESULT pfnObjectFromLresult = NULL; +// May not be available on Windows 95, although I'm not sure that's even a concern anymore +typedef HRESULT (STDAPICALLTYPE *CoCreateInstanceExfunc)(REFCLSID, IUnknown *, DWORD, COSERVERINFO *, ULONG, MULTI_QI *); +static CoCreateInstanceExfunc pfnCoCreateInstanceEx = NULL; +typedef HRESULT (STDAPICALLTYPE *CoInitializeSecurityfunc)(PSECURITY_DESCRIPTOR, LONG, SOLE_AUTHENTICATION_SERVICE*, + void *, DWORD, DWORD, void *, DWORD, void *); +static CoInitializeSecurityfunc pfnCoInitializeSecurity = NULL; + + BOOL PyCom_HasDCom() { #ifndef MS_WINCE @@ -139,7 +158,7 @@ if (!PyArg_ParseTuple(args, "OOiO:CoCreateInstance", &obCLSID, // @pyparm <o PyIID>|clsid||Class identifier (CLSID) of the object &obUnk, // @pyparm <o PyIUnknown>|unkOuter||The outer unknown, or None - &dwClsContext,// @pyparm int|context||The create context for the object + &dwClsContext,// @pyparm int|context||The create context for the object, combination of pythoncom.CLSCTX_* flags &obiid)) // @pyparm <o PyIID>|iid||The IID required from the object return NULL; if (!PyWinObject_AsIID(obCLSID, &clsid)) @@ -170,6 +189,7 @@ // @pymethod <o PyIUnknown>|pythoncom|CoCreateInstanceEx|Create a new instance of an OLE automation server possibly on a remote machine. static PyObject *pythoncom_CoCreateInstanceEx(PyObject *self, PyObject *args) { + CHECK_PFN(CoCreateInstanceEx); PyObject *obCLSID; PyObject *obUnk; PyObject *obCoServer; @@ -184,11 +204,10 @@ PyObject *result = NULL; ULONG numIIDs = 0; ULONG i; - Py_ssize_t py_numIIDs; if (!PyArg_ParseTuple(args, "OOiOO:CoCreateInstanceEx", &obCLSID, // @pyparm <o PyIID>|clsid||Class identifier (CLSID) of the object &obUnk, // @pyparm <o PyIUnknown>|unkOuter||The outer unknown, or None - &dwClsContext, // @pyparm int|context||The create context for the object + &dwClsContext, // @pyparm int|context||The create context for the object, combination of pythoncom.CLSCTX_* flags &obCoServer, // @pyparm (server, authino=None, reserved1=0,reserved2=0)|serverInfo||May be None, or describes the remote server to execute on. &obrgiids)) // @pyparm [<o PyIID>, ...]|iids||A list of IIDs required from the object return NULL; @@ -215,55 +234,30 @@ if (!PyCom_InterfaceFromPyInstanceOrObject(obUnk, IID_IUnknown, (void **)&punk, TRUE)) goto done; - if (!PySequence_Check(obrgiids)) { - PyErr_SetString(PyExc_TypeError, "IID's must be sequence of IID objects"); + if (!SeqToVector(obrgiids, &iids, &numIIDs, PyWinObject_AsIID)) goto done; - } - py_numIIDs = PySequence_Length(obrgiids); - if (py_numIIDs > ULONG_MAX){ - PyErr_Format(PyExc_ValueError, "%u is maximum number of IIDs", ULONG_MAX); - goto done; - } - numIIDs=(ULONG)py_numIIDs; - iids = new IID[numIIDs]; mqi = new MULTI_QI[numIIDs]; - if (iids==NULL || mqi==NULL) { + if (mqi==NULL) { PyErr_SetString(PyExc_MemoryError, "Allocating MULTIQI array"); goto done; } for (i=0;i<numIIDs;i++) { - PyObject *me = PySequence_GetItem(obrgiids, i); - if (me==NULL) goto done; - BOOL ok = PyWinObject_AsIID(me, iids+i); - Py_DECREF(me); - if (!ok) goto done; mqi[i].pIID = iids+i; mqi[i].pItf = NULL; mqi[i].hr = 0; } - // Jump hoops in case the platform doesnt have it. + { // scoping - HRESULT (STDAPICALLTYPE *mypfn)(REFCLSID, IUnknown *, DWORD, COSERVERINFO *, ULONG, MULTI_QI *); - HMODULE hMod = GetModuleHandle(_T("ole32.dll")); - if (hMod==0) { - PyCom_BuildInternalPyException("Can not load ole32.dll"); - goto done; - } - FARPROC fp = GetProcAddress(hMod, "CoCreateInstanceEx"); - if (fp==NULL) { - PyCom_BuildPyException(E_NOTIMPL); - goto done; - } - mypfn = (HRESULT (STDAPICALLTYPE *)(REFCLSID, IUnknown *, DWORD, COSERVERINFO *, ULONG, MULTI_QI *))fp; PY_INTERFACE_PRECALL; - HRESULT hr = (*mypfn)(clsid, punk, dwClsContext, pServerInfo, numIIDs, mqi); + HRESULT hr = (*pfnCoCreateInstanceEx)(clsid, punk, dwClsContext, pServerInfo, numIIDs, mqi); PY_INTERFACE_POSTCALL; if (FAILED(hr)) { PyCom_BuildPyException(hr); goto done; } - } // end scoping. + } // end scoping + result = PyTuple_New(numIIDs); if (result==NULL) goto done; for (i=0;i<numIIDs;i++) { @@ -289,7 +283,7 @@ PyWinObject_FreeWCHAR(serverInfo.pwszName); for (i=0;i<numIIDs;i++) PYCOM_RELEASE(mqi[i].pItf) - delete [] iids; + CoTaskMemFree(iids); delete [] mqi; return result; } @@ -300,29 +294,32 @@ // @pymethod |pythoncom|CoInitializeSecurity|Registers security and sets the default security values. static PyObject *pythoncom_CoInitializeSecurity(PyObject *self, PyObject *args) { + CHECK_PFN(CoInitializeSecurity); DWORD cAuthSvc; SOLE_AUTHENTICATION_SERVICE *pAS = NULL; DWORD dwAuthnLevel; DWORD dwImpLevel; DWORD dwCapabilities; - PSECURITY_DESCRIPTOR pSD, pSD_absolute=NULL; + PSECURITY_DESCRIPTOR pSD=NULL, pSD_absolute=NULL; + IID appid; + IAccessControl *pIAC = NULL; PyObject *obSD, *obAuthSvc, *obReserved1, *obReserved2, *obAuthInfo; if (!PyArg_ParseTuple(args, "OOOiiOiO:CoInitializeSecurity", - &obSD, // @pyparm <o PySECURITY_DESCRIPTOR>|sd||Security descriptor containing access permissions for process' objects, can be None - &obAuthSvc, // @pyparm object|authInfo||A value of None tells COM to choose which authentication services to use. An empty list means use no services. + &obSD, // @pyparm <o PySECURITY_DESCRIPTOR>|sd||Security descriptor containing access permissions for process' objects, can be None. + // <nl>If Capabilities contains EOAC_APPID, sd should be an AppId (guid), or None to use server executable. + // <nl>If Capabilities contains EOAC_ACCESS_CONTROL, sd parameter should be an IAccessControl interface. + &obAuthSvc, // @pyparm object|authSvc||A value of None tells COM to choose which authentication services to use. An empty list means use no services. &obReserved1,// @pyparm object|reserved1||Must be None &dwAuthnLevel, // @pyparm int|authnLevel||One of pythoncom.RPC_C_AUTHN_LEVEL_* values. The default authentication level for proxies. On the server side, COM will fail calls that arrive at a lower level. All calls to AddRef and Release are made at this level. &dwImpLevel, // @pyparm int|impLevel||One of pythoncom.RPC_C_IMP_LEVEL_* values. The default impersonation level for proxies. This value is not checked on the server side. AddRef and Release calls are made with this impersonation level so even security aware apps should set this carefully. Setting IUnknown security only affects calls to QueryInterface, not AddRef or Release. &obAuthInfo, // @pyparm object|authInfo||Must be None - &dwCapabilities, // @pyparm int|capabilities||Additional client and/or server-side capabilities. Any set of pythoncom.EOAC_* flags may be passed. Currently only EOAC_MUTUAL_AUTH, EOAC_SECURE_REFS, and EOAC_NONE are defined + &dwCapabilities, // @pyparm int|capabilities||Authentication capabilities, combination of pythoncom.EOAC_* flags. &obReserved2)) // @pyparm object|reserved2||Must be None return NULL; if (obReserved1 != Py_None || obReserved2 != Py_None || obAuthInfo != Py_None) { PyErr_SetString(PyExc_TypeError, "Not all of the 'None' arguments are None!"); return NULL; } - if (!PyWinObject_AsSECURITY_DESCRIPTOR(obSD, &pSD, /*BOOL bNoneOK = */TRUE)) - return NULL; if (obAuthSvc==Py_None) cAuthSvc = (DWORD)-1; @@ -332,22 +329,39 @@ PyErr_SetString(PyExc_TypeError, "obAuthSvc must be None or an empty sequence."); return NULL; } - HMODULE hMod = GetModuleHandle(_T("ole32.dll")); - if (hMod==0) return PyCom_BuildInternalPyException("Can not load ole32.dll"); - FARPROC fp = GetProcAddress(hMod, "CoInitializeSecurity"); - if (fp==NULL) return PyCom_BuildPyException(E_NOTIMPL); - typedef HRESULT (STDAPICALLTYPE *CoInitializeSecurityfunc) - (PSECURITY_DESCRIPTOR, LONG, SOLE_AUTHENTICATION_SERVICE*, void *, DWORD, DWORD, void *, DWORD, void *); - CoInitializeSecurityfunc mypfn=(CoInitializeSecurityfunc)fp; - // Security descriptor must be in absolute form - if (pSD!=NULL) - if (!_MakeAbsoluteSD(pSD, &pSD_absolute)) + // Depending on capabilities flags, first arg can be one of: + // AppId (or NULL to lookup server executable in APPID registry key) + // IAccessControl interface (cannot be NULL) + // Absolute security descriptor (or NULL to use a default SD) + if (dwCapabilities & EOAC_APPID){ + if (obSD != Py_None){ + if (!PyWinObject_AsIID(obSD, &appid)) + return NULL; + pSD = (PSECURITY_DESCRIPTOR)&appid; + } + } + else if (dwCapabilities & EOAC_ACCESS_CONTROL){ + if (!PyCom_InterfaceFromPyObject(obSD, IID_IAccessControl, (void **)&pIAC, FALSE)) return NULL; + pSD = (PSECURITY_DESCRIPTOR)pIAC; + } + else{ + if (!PyWinObject_AsSECURITY_DESCRIPTOR(obSD, &pSD, /*BOOL bNoneOK = */TRUE)) + return NULL; + // Security descriptor must be in absolute form + if (pSD){ + if (!_MakeAbsoluteSD(pSD, &pSD_absolute)) + return NULL; + pSD = pSD_absolute; + } + } PY_INTERFACE_PRECALL; - HRESULT hr = (*mypfn)(pSD_absolute, cAuthSvc, pAS, NULL, dwAuthnLevel, dwImpLevel, NULL, dwCapabilities, NULL); -// HRESULT hr = CoInitializeSecurity(pSD, cAuthSvc, pAS, NULL, dwAuthnLevel, dwImpLevel, NULL, dwCapabilities, NULL); + HRESULT hr = (*pfnCoInitializeSecurity)(pSD, cAuthSvc, pAS, NULL, dwAuthnLevel, + dwImpLevel, NULL, dwCapabilities, NULL); + if (pIAC) + pIAC->Release(); PY_INTERFACE_POSTCALL; if (pSD_absolute!=NULL) FreeAbsoluteSD(pSD_absolute); @@ -858,15 +872,14 @@ if ( !PyArg_ParseTuple(args, "O:CreateFileMoniker", &obName) ) return NULL; - BSTR bstrName; - if (!PyWinObject_AsBstr(obName, &bstrName)) + TmpWCHAR Name; + if (!PyWinObject_AsWCHAR(obName, &Name)) return NULL; IMoniker *pmk; PY_INTERFACE_PRECALL; - HRESULT hr = CreateFileMoniker(bstrName, &pmk); + HRESULT hr = CreateFileMoniker(Name, &pmk); PY_INTERFACE_POSTCALL; - PyWinObject_FreeBstr(bstrName); if ( FAILED(hr) ) return PyCom_BuildPyException(hr); @@ -884,25 +897,18 @@ if ( !PyArg_ParseTuple(args, "OO:CreateItemMoniker", &obDelim, &obItem) ) return NULL; |
From: <pyw...@li...> - 2013-02-06 14:39:13
|
changeset 4c7503da2658 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=4c7503da2658 summary: Fix size of CLIPFORMAT in FORMATETC parsing diffstat: com/win32com/src/extensions/PyIDataObject.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (21 lines): diff -r 860ef545eb60 -r 4c7503da2658 com/win32com/src/extensions/PyIDataObject.cpp --- a/com/win32com/src/extensions/PyIDataObject.cpp Thu Dec 27 16:37:57 2012 +1100 +++ b/com/win32com/src/extensions/PyIDataObject.cpp Wed Feb 06 09:37:53 2013 -0500 @@ -17,7 +17,7 @@ BOOL PyObject_AsFORMATETC(PyObject *ob, FORMATETC *petc) { PyObject *obtd; - if (!PyArg_ParseTuple(ob, "iOiii:FORMATETC", + if (!PyArg_ParseTuple(ob, "HOiii:FORMATETC", &petc->cfFormat, &obtd, &petc->dwAspect, @@ -34,7 +34,7 @@ PyObject *PyObject_FromFORMATETC(FORMATETC *petc) { - return Py_BuildValue("iziii", + return Py_BuildValue("Hziii", petc->cfFormat, NULL, petc->dwAspect, |
From: <pyw...@li...> - 2012-12-27 05:38:15
|
changeset 860ef545eb60 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=860ef545eb60 summary: Fix issue implementing COM objects from within a virtualenv (Kevin Smyth via issue #3597965) diffstat: CHANGES.txt | 3 +++ com/win32com/src/PythonCOMLoader.cpp | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diffs (64 lines): diff -r 1d7a40349e7c -r 860ef545eb60 CHANGES.txt --- a/CHANGES.txt Mon Dec 17 11:31:28 2012 -0500 +++ b/CHANGES.txt Thu Dec 27 16:37:57 2012 +1100 @@ -6,6 +6,9 @@ Since build 218: ---------------- +* Fix issue implementing COM objects from within a virtualenv (Kevin Smyth + via issue #3597965) + * win32com.shell Add interfaces IFileOperation and IFileOperationProgressSink diff -r 1d7a40349e7c -r 860ef545eb60 com/win32com/src/PythonCOMLoader.cpp --- a/com/win32com/src/PythonCOMLoader.cpp Mon Dec 17 11:31:28 2012 -0500 +++ b/com/win32com/src/PythonCOMLoader.cpp Thu Dec 27 16:37:57 2012 +1100 @@ -17,6 +17,7 @@ static PFN_DEACTIVATEACTCTX pfnDeactivateActCtx = NULL; static PFN_ADDREFACTCTX pfnAddRefActCtx = NULL; static PFN_RELEASEACTCTX pfnReleaseActCtx = NULL; +static HINSTANCE hinstThisModule = NULL; void _LoadActCtxPointers() { @@ -68,8 +69,21 @@ if (pfnDllGetClassObject==0) { // before loading pythoncom we must activate our context so // the CRT loads correctly. + HMODULE hpycom = NULL; ULONG_PTR cookie = _Py_ActivateActCtx(); - HMODULE hpycom = LoadLibraryEx(DLL_DELEGATE, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + TCHAR loader_path[MAX_PATH]; + if (GetModuleFileName(hinstThisModule, loader_path, MAX_PATH) != 0) { + TCHAR fullpath[MAX_PATH]; + TCHAR* filepart; + if (GetFullPathName(loader_path, MAX_PATH, fullpath, &filepart) != 0 && filepart != NULL) { + if (_tcslen(DLL_DELEGATE) + _tcslen(loader_path) < sizeof(fullpath) / sizeof(fullpath[0])) { + _tcscpy(filepart, DLL_DELEGATE); + hpycom = LoadLibraryEx(fullpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + } + } + } + if (hpycom == NULL) + hpycom = LoadLibrary(DLL_DELEGATE); _Py_DeactivateActCtx(cookie); if (hpycom) { pfnDllGetClassObject = (PFNDllGetClassObject)GetProcAddress(hpycom, _T("DllGetClassObject")); @@ -82,7 +96,7 @@ } -BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) +BOOL WINAPI DllMain (HINSTANCE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: @@ -92,6 +106,7 @@ if ((*pfnGetCurrentActCtx)(&PyWin_DLLhActivationContext)) if (!(*pfnAddRefActCtx)(PyWin_DLLhActivationContext)) OutputDebugString("pythoncomloader failed to load the default activation context\n"); + hinstThisModule = hInst; break; case DLL_PROCESS_DETACH: |
From: <pyw...@li...> - 2012-12-17 16:34:26
|
changeset 1d7a40349e7c in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=1d7a40349e7c summary: Revert previous change as it causes a crash elsewhere diffstat: com/win32com/src/include/PythonCOMServer.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 8b73631eeee0 -r 1d7a40349e7c com/win32com/src/include/PythonCOMServer.h --- a/com/win32com/src/include/PythonCOMServer.h Mon Nov 19 14:13:18 2012 -0500 +++ b/com/win32com/src/include/PythonCOMServer.h Mon Dec 17 11:31:28 2012 -0500 @@ -38,7 +38,7 @@ return *ppResult ? S_OK : E_OUTOFMEMORY; } \ protected: \ virtual IID GetIID(void) { return theIID; } \ - virtual void *ThisAsIID(IID iid) {if (this==NULL) return NULL;if (iid==theIID) return (IInterface *)(gatewaybaseclass *)this; else return gatewaybaseclass::ThisAsIID(iid);} \ + virtual void *ThisAsIID(IID iid) {if (this==NULL) return NULL;if (iid==theIID) return (IInterface *)this; else return gatewaybaseclass::ThisAsIID(iid);} \ STDMETHOD_(ULONG,AddRef)(void) {return gatewaybaseclass::AddRef();} \ STDMETHOD_(ULONG,Release)(void) {return gatewaybaseclass::Release();} \ STDMETHOD(QueryInterface)(REFIID iid, void ** obj) {return gatewaybaseclass::QueryInterface(iid, obj);}; |
From: <pyw...@li...> - 2012-11-19 19:14:13
|
changeset 8b73631eeee0 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=8b73631eeee0 summary: Fix ambiguous cast that could cause a Python COM server to crash diffstat: com/win32com/src/include/PythonCOMServer.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 6c135ed37ebb -r 8b73631eeee0 com/win32com/src/include/PythonCOMServer.h --- a/com/win32com/src/include/PythonCOMServer.h Sat Nov 10 13:30:25 2012 -0500 +++ b/com/win32com/src/include/PythonCOMServer.h Mon Nov 19 14:13:18 2012 -0500 @@ -38,7 +38,7 @@ return *ppResult ? S_OK : E_OUTOFMEMORY; } \ protected: \ virtual IID GetIID(void) { return theIID; } \ - virtual void *ThisAsIID(IID iid) {if (this==NULL) return NULL;if (iid==theIID) return (IInterface *)this; else return gatewaybaseclass::ThisAsIID(iid);} \ + virtual void *ThisAsIID(IID iid) {if (this==NULL) return NULL;if (iid==theIID) return (IInterface *)(gatewaybaseclass *)this; else return gatewaybaseclass::ThisAsIID(iid);} \ STDMETHOD_(ULONG,AddRef)(void) {return gatewaybaseclass::AddRef();} \ STDMETHOD_(ULONG,Release)(void) {return gatewaybaseclass::Release();} \ STDMETHOD(QueryInterface)(REFIID iid, void ** obj) {return gatewaybaseclass::QueryInterface(iid, obj);}; |
From: <pyw...@li...> - 2012-11-10 18:33:12
|
changeset 6c135ed37ebb in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=6c135ed37ebb summary: Add SHParseDisplayName (feature req #3585998) diffstat: com/win32comext/shell/src/shell.cpp | 42 +++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diffs (73 lines): diff -r 7ff3b8548772 -r 6c135ed37ebb com/win32comext/shell/src/shell.cpp --- a/com/win32comext/shell/src/shell.cpp Sat Nov 03 05:22:36 2012 -0400 +++ b/com/win32comext/shell/src/shell.cpp Sat Nov 10 13:30:25 2012 -0500 @@ -187,6 +187,10 @@ typedef HRESULT (WINAPI *PFNGetCurrentProcessExplicitAppUserModelID)(WCHAR **); static PFNGetCurrentProcessExplicitAppUserModelID pfnGetCurrentProcessExplicitAppUserModelID; +typedef HRESULT (WINAPI *PFNSHParseDisplayName)(LPCWSTR, IBindCtx *, PIDLIST_ABSOLUTE *, SFGAOF, SFGAOF *); +static PFNSHParseDisplayName pfnSHParseDisplayName; + + // Some magic hackery macros :-) #define _ILSkip(pidl, cb) ((LPITEMIDLIST)(((BYTE*)(pidl))+cb)) #define _ILNext(pidl) _ILSkip(pidl, (pidl)->mkid.cb) @@ -3439,6 +3443,42 @@ return ret; } +// @pymethod (<o PyIDL>, int)|shell|SHParseDisplayName|Translates a display name into a shell item identifier +// @rdesc Returns the item id list and any requested attribute flags +// @comm Accepts keyword args +// @comm Requires XP or later +static PyObject *PySHParseDisplayName(PyObject *self, PyObject *args, PyObject *kwargs) +{ + if (pfnSHParseDisplayName==NULL) + return PyCom_BuildPyException(E_NOTIMPL); + static char *keywords[] = {"Name", "Attributes", "BindCtx", NULL}; + TmpWCHAR Name; + IBindCtx *pBindCtx; + SFGAOF att_requested, att_returned; + PyObject *obName, *obBindCtx = Py_None; + PIDLIST_ABSOLUTE pidl; + // @pyparm str|Name||Display name of a shell item, such as a file path + // @pyparm int|Attributes||Bitmask of shell attributes to retrieve, combination of shellcon.SFGAO_* + // @pyparm <o PyIBindCtx>|BindCtx|None|Bind context, can be None + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Ok|O", keywords, + &obName, &att_requested, &obBindCtx)) + return NULL; + if (!PyWinObject_AsWCHAR(obName, &Name, FALSE)) + return NULL; + if (!PyCom_InterfaceFromPyObject(obBindCtx, IID_IBindCtx, (void **)&pBindCtx, TRUE)) + return NULL; + + HRESULT hr; + PY_INTERFACE_PRECALL; + hr = (*pfnSHParseDisplayName)(Name, pBindCtx, &pidl, att_requested, &att_returned); + if (pBindCtx) + pBindCtx->Release(); + PY_INTERFACE_POSTCALL; + if (FAILED(hr)) + return PyCom_BuildPyException(hr); + return Py_BuildValue("Nk", PyObject_FromPIDL(pidl, TRUE), att_returned); +} + /* List of module functions */ // @module shell|A module wrapping Windows Shell functions and interfaces @@ -3501,6 +3541,7 @@ { "SHCreateStreamOnFileEx", (PyCFunction)PySHCreateStreamOnFileEx, METH_VARARGS|METH_KEYWORDS}, // @pymeth SHCreateStreamOnFileEx|Creates a <o PyIStream> that reads and writes to a file { "SetCurrentProcessExplicitAppUserModelID", PySetCurrentProcessExplicitAppUserModelID, METH_VARARGS}, // @pymeth SetCurrentProcessExplicitAppUserModelID|Sets the taskbar identifier { "GetCurrentProcessExplicitAppUserModelID", PyGetCurrentProcessExplicitAppUserModelID, METH_NOARGS}, // @pymeth GetCurrentProcessExplicitAppUserModelID|Retrieves the current taskbar identifier + { "SHParseDisplayName", (PyCFunction)PySHParseDisplayName, METH_VARARGS|METH_KEYWORDS}, // @pymeth SHParseDisplayName|Translates a display name into a shell item identifier { NULL, NULL }, }; @@ -3664,6 +3705,7 @@ pfnSHOpenFolderAndSelectItems = (PFNSHOpenFolderAndSelectItems)GetProcAddress(shell32, "SHOpenFolderAndSelectItems"); pfnSetCurrentProcessExplicitAppUserModelID = (PFNSetCurrentProcessExplicitAppUserModelID)GetProcAddress(shell32, "SetCurrentProcessExplicitAppUserModelID"); pfnGetCurrentProcessExplicitAppUserModelID = (PFNGetCurrentProcessExplicitAppUserModelID)GetProcAddress(shell32, "GetCurrentProcessExplicitAppUserModelID"); + pfnSHParseDisplayName = (PFNSHParseDisplayName)GetProcAddress(shell32, "SHParseDisplayName"); } // SHGetFolderPath comes from shfolder.dll on older systems if (pfnSHGetFolderPath==NULL){ |
From: <pyw...@li...> - 2012-11-03 09:24:55
|
changeset 7ff3b8548772 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=7ff3b8548772 summary: Add IFileOperation, IFileOperationProgressSink, and related interfaces and functions diffstat: AutoDuck/pywin32.mak | 1 + CHANGES.txt | 9 + com/win32comext/propsys/pscon.py | 4 + com/win32comext/propsys/src/PyIObjectWithPropertyKey.cpp | 81 + com/win32comext/propsys/src/PyIObjectWithPropertyKey.h | 21 + com/win32comext/propsys/src/PyIPropertyChange.cpp | 65 + com/win32comext/propsys/src/PyIPropertyChange.h | 20 + com/win32comext/propsys/src/PyIPropertyChangeArray.cpp | 207 ++++ com/win32comext/propsys/src/PyIPropertyChangeArray.h | 26 + com/win32comext/propsys/src/propsys.cpp | 101 +- com/win32comext/shell/demos/IFileOperationProgressSink.py | 107 ++ com/win32comext/shell/shellcon.py | 40 + com/win32comext/shell/src/PyIFileOperation.cpp | 659 +++++++++++++ com/win32comext/shell/src/PyIFileOperation.h | 39 + com/win32comext/shell/src/PyIFileOperationProgressSink.cpp | 320 ++++++ com/win32comext/shell/src/PyIFileOperationProgressSink.h | 119 ++ com/win32comext/shell/src/shell.cpp | 8 +- setup.py | 5 + 18 files changed, 1828 insertions(+), 4 deletions(-) diffs (truncated from 2011 to 300 lines): diff -r e4fc118e3893 -r 7ff3b8548772 AutoDuck/pywin32.mak --- a/AutoDuck/pywin32.mak Mon Oct 29 14:40:40 2012 +1100 +++ b/AutoDuck/pywin32.mak Sat Nov 03 05:22:36 2012 -0400 @@ -55,6 +55,7 @@ $(WIN32COMEXT_DIR)\axdebug\src\*.cpp \ $(WIN32COMEXT_DIR)\axcontrol\src\*.cpp \ $(WIN32COMEXT_DIR)\shell\src\*.cpp \ + $(WIN32COMEXT_DIR)\shell\src\*.h \ $(WIN32COMEXT_DIR)\internet\src\*.cpp \ $(WIN32COMEXT_DIR)\taskscheduler\src\*.cpp \ $(WIN32COMEXT_DIR)\authorization\src\*.cpp \ diff -r e4fc118e3893 -r 7ff3b8548772 CHANGES.txt --- a/CHANGES.txt Mon Oct 29 14:40:40 2012 +1100 +++ b/CHANGES.txt Sat Nov 03 05:22:36 2012 -0400 @@ -4,6 +4,15 @@ hg log -rb2xx: > log.out However contributors are encouraged to add their own entries for their work. +Since build 218: +---------------- +* win32com.shell + Add interfaces IFileOperation and IFileOperationProgressSink + +* win32com.propsys + Add interfaces IPropertyChange, IPropertyChangeArray, and IObjectWithPropertyKey + Add functions PSCreateSimplePropertyChange, PSCreatePropertyChangeArray, and SHSetDefaultProperties + Since build 217: ---------------- * mapiutil.py GetPropTagName has been modified to return the fully qualified diff -r e4fc118e3893 -r 7ff3b8548772 com/win32comext/propsys/pscon.py --- a/com/win32comext/propsys/pscon.py Mon Oct 29 14:40:40 2012 +1100 +++ b/com/win32comext/propsys/pscon.py Sat Nov 03 05:22:36 2012 -0400 @@ -717,3 +717,7 @@ PKEY_AppUserModel_ExcludeFromShowInNewInstall = (IID('{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}'), 8) PKEY_AppUserModel_PreventPinning = (IID('{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}'), 9) +# PKA_FLAGS, used with IPropertyChange +PKA_SET = 0 +PKA_APPEND = 1 +PKA_DELETE = 2 diff -r e4fc118e3893 -r 7ff3b8548772 com/win32comext/propsys/src/PyIObjectWithPropertyKey.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com/win32comext/propsys/src/PyIObjectWithPropertyKey.cpp Sat Nov 03 05:22:36 2012 -0400 @@ -0,0 +1,81 @@ +// This file implements the IObjectWithPropertyKey Interface and Gateway for Python. +// Generated by makegw.py + +#include "PythonCOM.h" +#include "PythonCOMServer.h" +#include "propsys.h" +#include "PyIObjectWithPropertyKey.h" +#include "PyPROPVARIANT.h" + +// @doc - This file contains autoduck documentation +// --------------------------------------------------- +// +// Interface Implementation + +PyIObjectWithPropertyKey::PyIObjectWithPropertyKey(IUnknown *pdisp): + PyIUnknown(pdisp) +{ + ob_type = &type; +} + +PyIObjectWithPropertyKey::~PyIObjectWithPropertyKey() +{ +} + +/* static */ IObjectWithPropertyKey *PyIObjectWithPropertyKey::GetI(PyObject *self) +{ + return (IObjectWithPropertyKey *)PyIUnknown::GetI(self); +} + +// @pymethod |PyIObjectWithPropertyKey|SetPropertyKey|Sets the property id +PyObject *PyIObjectWithPropertyKey::SetPropertyKey(PyObject *self, PyObject *args) +{ + IObjectWithPropertyKey *pIOWPK = GetI(self); + if ( pIOWPK == NULL ) + return NULL; + PROPERTYKEY key; + // @pyparm <o PyPROPERTYKEY>|key||The identifier of the property + if ( !PyArg_ParseTuple(args, "O&:SetPropertyKey", + PyWinObject_AsPROPERTYKEY, &key)) + return NULL; + HRESULT hr; + PY_INTERFACE_PRECALL; + hr = pIOWPK->SetPropertyKey(key); + PY_INTERFACE_POSTCALL; + + if ( FAILED(hr) ) + return PyCom_BuildPyException(hr, pIOWPK, IID_IObjectWithPropertyKey ); + Py_INCREF(Py_None); + return Py_None; +} + +// @pymethod <o PyPROPERTYKEY>|PyIObjectWithPropertyKey|GetPropertyKey|Returns the property id +PyObject *PyIObjectWithPropertyKey::GetPropertyKey(PyObject *self, PyObject *args) +{ + IObjectWithPropertyKey *pIOWPK = GetI(self); + if ( pIOWPK == NULL ) + return NULL; + PROPERTYKEY key; + HRESULT hr; + PY_INTERFACE_PRECALL; + hr = pIOWPK->GetPropertyKey(&key); + PY_INTERFACE_POSTCALL; + + if ( FAILED(hr) ) + return PyCom_BuildPyException(hr, pIOWPK, IID_IObjectWithPropertyKey ); + return PyWinObject_FromPROPERTYKEY(key); +} + +// @object PyIObjectWithPropertyKey|Interface implemented by objects that have an associated property id +static struct PyMethodDef PyIObjectWithPropertyKey_methods[] = +{ + { "SetPropertyKey", PyIObjectWithPropertyKey::SetPropertyKey, 1 }, // @pymeth SetPropertyKey|Sets the property id + { "GetPropertyKey", PyIObjectWithPropertyKey::GetPropertyKey, METH_NOARGS }, // @pymeth GetPropertyKey|Returns the property id + { NULL } +}; + +PyComTypeObject PyIObjectWithPropertyKey::type("PyIObjectWithPropertyKey", + &PyIUnknown::type, + sizeof(PyIObjectWithPropertyKey), + PyIObjectWithPropertyKey_methods, + GET_PYCOM_CTOR(PyIObjectWithPropertyKey)); diff -r e4fc118e3893 -r 7ff3b8548772 com/win32comext/propsys/src/PyIObjectWithPropertyKey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com/win32comext/propsys/src/PyIObjectWithPropertyKey.h Sat Nov 03 05:22:36 2012 -0400 @@ -0,0 +1,21 @@ +// This file declares the IObjectWithPropertyKey Interface and Gateway for Python. +// Generated by makegw.py +// --------------------------------------------------- +// +// Interface Declaration + +class PyIObjectWithPropertyKey : public PyIUnknown +{ +public: + MAKE_PYCOM_CTOR(PyIObjectWithPropertyKey); + static IObjectWithPropertyKey *GetI(PyObject *self); + static PyComTypeObject type; + + // The Python methods + static PyObject *SetPropertyKey(PyObject *self, PyObject *args); + static PyObject *GetPropertyKey(PyObject *self, PyObject *args); + +protected: + PyIObjectWithPropertyKey(IUnknown *pdisp); + ~PyIObjectWithPropertyKey(); +}; diff -r e4fc118e3893 -r 7ff3b8548772 com/win32comext/propsys/src/PyIPropertyChange.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com/win32comext/propsys/src/PyIPropertyChange.cpp Sat Nov 03 05:22:36 2012 -0400 @@ -0,0 +1,65 @@ +// This file implements the IPropertyChange Interface and Gateway for Python. +// Generated by makegw.py + +#include "PythonCOM.h" +#include "PythonCOMServer.h" +#include "propsys.h" +#include "PyIObjectWithPropertyKey.h" +#include "PyIPropertyChange.h" +#include "PyPROPVARIANT.h" + +// @doc - This file contains autoduck documentation +// --------------------------------------------------- +// +// Interface Implementation + +PyIPropertyChange::PyIPropertyChange(IUnknown *pdisp): + PyIObjectWithPropertyKey(pdisp) +{ + ob_type = &type; +} + +PyIPropertyChange::~PyIPropertyChange() +{ +} + +/* static */ IPropertyChange *PyIPropertyChange::GetI(PyObject *self) +{ + return (IPropertyChange *)PyIObjectWithPropertyKey::GetI(self); +} + +// @pymethod <o PyPROPVARIANT>|PyIPropertyChange|ApplyToPropVariant|Applies the change to a variant value +PyObject *PyIPropertyChange::ApplyToPropVariant(PyObject *self, PyObject *args) +{ + IPropertyChange *pIPC = GetI(self); + if ( pIPC == NULL ) + return NULL; + PROPVARIANT *origval; + PROPVARIANT changedval; + // @pyparm <o PyPROPVARIANT>|OrigVal||The value to be modified + if (!PyArg_ParseTuple(args, "O&:ApplyToPropVariant", + PyWinObject_AsPROPVARIANT, &origval)) + return NULL; + + HRESULT hr; + PY_INTERFACE_PRECALL; + hr = pIPC->ApplyToPropVariant(*origval, &changedval); + PY_INTERFACE_POSTCALL; + + if ( FAILED(hr) ) + return PyCom_BuildPyException(hr, pIPC, IID_IPropertyChange ); + return PyWinObject_FromPROPVARIANT(changedval); +} + +// @object PyIPropertyChange|Interface used to specify a change to a property +static struct PyMethodDef PyIPropertyChange_methods[] = +{ + { "ApplyToPropVariant", PyIPropertyChange::ApplyToPropVariant, 1 }, // @pymeth ApplyToPropVariant|Applies the change to a variant value + { NULL } +}; + +PyComTypeObject PyIPropertyChange::type("PyIPropertyChange", + &PyIObjectWithPropertyKey::type, // @base PyIPropertyChange|PyIObjectWithPropertyKey + sizeof(PyIPropertyChange), + PyIPropertyChange_methods, + GET_PYCOM_CTOR(PyIPropertyChange)); diff -r e4fc118e3893 -r 7ff3b8548772 com/win32comext/propsys/src/PyIPropertyChange.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com/win32comext/propsys/src/PyIPropertyChange.h Sat Nov 03 05:22:36 2012 -0400 @@ -0,0 +1,20 @@ +// This file declares the IPropertyChange Interface and Gateway for Python. +// Generated by makegw.py +// --------------------------------------------------- +// +// Interface Declaration + +class PyIPropertyChange : public PyIObjectWithPropertyKey +{ +public: + MAKE_PYCOM_CTOR(PyIPropertyChange); + static IPropertyChange *GetI(PyObject *self); + static PyComTypeObject type; + + // The Python methods + static PyObject *ApplyToPropVariant(PyObject *self, PyObject *args); + +protected: + PyIPropertyChange(IUnknown *pdisp); + ~PyIPropertyChange(); +}; diff -r e4fc118e3893 -r 7ff3b8548772 com/win32comext/propsys/src/PyIPropertyChangeArray.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/com/win32comext/propsys/src/PyIPropertyChangeArray.cpp Sat Nov 03 05:22:36 2012 -0400 @@ -0,0 +1,207 @@ +// This file implements the IPropertyChangeArray Interface and Gateway for Python. +// Generated by makegw.py + +#include "PythonCOM.h" +#include "PythonCOMServer.h" +#include "propsys.h" +#include "PyIPropertyChangeArray.h" +#include "PyPROPVARIANT.h" + +// @doc - This file contains autoduck documentation +// --------------------------------------------------- +// +// Interface Implementation + +PyIPropertyChangeArray::PyIPropertyChangeArray(IUnknown *pdisp): + PyIUnknown(pdisp) +{ + ob_type = &type; +} + +PyIPropertyChangeArray::~PyIPropertyChangeArray() +{ +} + +/* static */ IPropertyChangeArray *PyIPropertyChangeArray::GetI(PyObject *self) +{ + return (IPropertyChangeArray *)PyIUnknown::GetI(self); +} + +// @pymethod int|PyIPropertyChangeArray|GetCount|Returns the number of changes in the array +PyObject *PyIPropertyChangeArray::GetCount(PyObject *self, PyObject *args) +{ + IPropertyChangeArray *pIPCA = GetI(self); + if ( pIPCA == NULL ) + return NULL; + UINT cOperations; + HRESULT hr; + PY_INTERFACE_PRECALL; + hr = pIPCA->GetCount(&cOperations); + PY_INTERFACE_POSTCALL; + + if ( FAILED(hr) ) + return PyCom_BuildPyException(hr, pIPCA, IID_IPropertyChangeArray ); + return PyLong_FromUnsignedLong(cOperations); +} + +// @pymethod <o PyIPropertyChange>|PyIPropertyChangeArray|GetAt|Retrieves a change by zero-based index +PyObject *PyIPropertyChangeArray::GetAt(PyObject *self, PyObject *args) +{ + IPropertyChangeArray *pIPCA = GetI(self); + if ( pIPCA == NULL ) + return NULL; |
From: <pyw...@li...> - 2012-10-29 03:41:11
|
changeset ed400a27739f in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=ed400a27739f summary: build 218 changeset e4fc118e3893 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=e4fc118e3893 summary: Added tag b218 for changeset ed400a27739f diffstat: .hgtags | 2 ++ setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diffs (18 lines): diff -r 2f9863f48123 -r e4fc118e3893 .hgtags --- a/.hgtags Mon Oct 29 14:39:04 2012 +1100 +++ b/.hgtags Mon Oct 29 14:40:40 2012 +1100 @@ -47,3 +47,5 @@ 6ccccc93a646531a4fb0d904b83e18d324c59d01 cvs2hg 5c3a57938569a9a0321b59037bddf99721f61f95 b217 b7968cc5d12a148df3005979adb804ab79dd1d17 b218 +b7968cc5d12a148df3005979adb804ab79dd1d17 b218 +ed400a27739ff3ff7a850e69f574a1ad66de6c5e b218 diff -r 2f9863f48123 -r e4fc118e3893 setup.py --- a/setup.py Mon Oct 29 14:39:04 2012 +1100 +++ b/setup.py Mon Oct 29 14:40:40 2012 +1100 @@ -1,4 +1,4 @@ -build_id="217.1" # may optionally include a ".{patchno}" suffix. +build_id="218" # may optionally include a ".{patchno}" suffix. # Putting buildno at the top prevents automatic __doc__ assignment, and # I *want* the build number at the top :) __doc__="""This is a distutils setup-script for the pywin32 extensions |
From: <pyw...@li...> - 2012-10-29 03:39:56
|
changeset 2f9863f48123 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=2f9863f48123 summary: Added tag b218 for changeset b7968cc5d12a diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r b7968cc5d12a -r 2f9863f48123 .hgtags --- a/.hgtags Sat Oct 27 10:58:07 2012 +1100 +++ b/.hgtags Mon Oct 29 14:39:04 2012 +1100 @@ -46,3 +46,4 @@ c3eb7ad6c64194e120ad9037fa6299b7c6a6ef1e b204 6ccccc93a646531a4fb0d904b83e18d324c59d01 cvs2hg 5c3a57938569a9a0321b59037bddf99721f61f95 b217 +b7968cc5d12a148df3005979adb804ab79dd1d17 b218 |