pywin32-checkins Mailing List for Python for Windows Extensions (Page 130)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
| 2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
| 2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
| 2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
| 2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
| 2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
| 2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
| 2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
| 2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
| 2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: Mark H. <mha...@us...> - 2004-07-13 07:46:29
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16158 Modified Files: afxres.py Log Message: [ 977391 ] New constants in afxres Index: afxres.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/afxres.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** afxres.py 2 Sep 1999 00:19:28 -0000 1.1 --- afxres.py 13 Jul 2004 07:46:20 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- CBRS_SIZE_FIXED = 0x0002 CBRS_FLOATING = 0x0001 + CBRS_GRIPPER = 0x00400000 CBRS_ORIENT_HORZ = (CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM) CBRS_ORIENT_VERT = (CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT) *************** *** 28,31 **** --- 29,38 ---- CBRS_RIGHT = (CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT) CBRS_BOTTOM = (CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP) + SBPS_NORMAL = 0x0000 + SBPS_NOBORDERS = 0x0100 + SBPS_POPOUT = 0x0200 + SBPS_OWNERDRAW = 0x1000 + SBPS_DISABLED = 0x04000000 + SBPS_STRETCH = 0x08000000 ID_INDICATOR_EXT = 0xE700 ID_INDICATOR_CAPS = 0xE701 |
|
From: Mark H. <mha...@us...> - 2004-07-13 07:44:29
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15811 Modified Files: commctrl.py Log Message: [ 977388 ] New constants in commctrl Index: commctrl.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/commctrl.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** commctrl.py 26 May 2004 08:53:08 -0000 1.3 --- commctrl.py 13 Jul 2004 07:44:13 -0000 1.4 *************** *** 617,620 **** --- 617,621 ---- TTN_NEEDTEXTW = TTN_GETDISPINFOW SBARS_SIZEGRIP = 256 + SBARS_TOOLTIPS = 2048 STATUSCLASSNAMEA = "msctls_statusbar32" STATUSCLASSNAME = STATUSCLASSNAMEA *************** *** 649,652 **** --- 650,654 ---- SBT_POPOUT = 512 SBT_RTLREADING = 1024 + SBT_NOTABPARSING = 2048 SBT_TOOLTIPS = 2048 SB_SETBKCOLOR = CCM_SETBKCOLOR # lParam = bkColor |
|
From: Mark H. <mha...@us...> - 2004-07-13 07:30:35
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13502 Modified Files: oleargs.cpp Log Message: Add CVS file ID, to better track things when I get the complete file instead of a patch. Index: oleargs.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** oleargs.cpp 1 May 2004 00:30:51 -0000 1.27 --- oleargs.cpp 13 Jul 2004 07:30:26 -0000 1.28 *************** *** 1,4 **** --- 1,5 ---- // oleargs.cpp : ole args <--> python object implementation file // + // $Id$ #include "stdafx.h" |
|
From: Mark H. <mha...@us...> - 2004-07-13 07:17:11
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11207 Modified Files: odbc.cpp Log Message: Remove obvious /* Sentinel */ comments which came through into autoduck. Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** odbc.cpp 13 Jul 2004 05:01:21 -0000 1.12 --- odbc.cpp 13 Jul 2004 07:17:02 -0000 1.13 *************** *** 1594,1598 **** { "setinputsizes", odbcCurSetInputSizes, 1} , /* @pymeth setinputsizes| */ { "setoutputsize", odbcCurSetOutputSize, 1} ,/* @pymeth setoutputsize| */ ! {0, 0} /* Sentinel */ }; --- 1594,1598 ---- { "setinputsizes", odbcCurSetInputSizes, 1} , /* @pymeth setinputsizes| */ { "setoutputsize", odbcCurSetOutputSize, 1} ,/* @pymeth setoutputsize| */ ! {0, 0} }; *************** *** 1733,1737 **** static PyMethodDef globalMethods[] = { { "odbc", odbcLogon, 1} , /* @pymeth odbc|Creates an <o connection> object. */ ! {0, 0} /* Sentinel */ }; --- 1733,1737 ---- static PyMethodDef globalMethods[] = { { "odbc", odbcLogon, 1} , /* @pymeth odbc|Creates an <o connection> object. */ ! {0, 0} }; |
|
From: Mark H. <mha...@us...> - 2004-07-13 07:12:55
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10159/test Modified Files: test_win32api.py Log Message: [ 945636 ] GetLongPathNameW without MAX_PATH limitation (but with the addition of tests, and avoiding double-handling the large Unicode buffer) Index: test_win32api.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_win32api.py 8 Nov 2003 12:37:16 -0000 1.6 --- test_win32api.py 13 Jul 2004 07:12:46 -0000 1.7 *************** *** 3,7 **** import unittest ! import win32api, win32con, win32event import sys, os --- 3,7 ---- import unittest ! import win32api, win32con, win32event, winerror import sys, os *************** *** 75,78 **** --- 75,79 ---- self.failUnless(long_name==fname, \ "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) + self.failUnlessEqual(long_name, win32api.GetLongPathNameW(short_name)) long_name = win32api.GetLongPathNameW(short_name) self.failUnless(type(long_name)==unicode, "GetLongPathNameW returned type '%s'" % (type(long_name),)) *************** *** 80,83 **** --- 81,101 ---- "Expected long name ('%s') to be original name ('%s')" % (long_name, fname)) + def testLongLongPathNames(self): + # We need filename where the FQN is > 256 - simplest way is to create a + # 250 character directory in the cwd. + import win32file + basename = "a" * 250 + fname = "\\\\?\\" + os.path.join(os.getcwd(), basename) + try: + win32file.CreateDirectoryW(fname, None) + except win32api.error, details: + if details[0]!=winerror.ERROR_ALREADY_EXISTS: + raise + try: + long_name = win32api.GetLongPathNameW(fname) + self.failUnlessEqual(long_name, fname) + finally: + win32file.RemoveDirectory(fname) + class FormatMessage(unittest.TestCase): def test_FromString(self): |
|
From: Mark H. <mha...@us...> - 2004-07-13 07:12:54
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10159/src Modified Files: win32apimodule.cpp Log Message: [ 945636 ] GetLongPathNameW without MAX_PATH limitation (but with the addition of tests, and avoiding double-handling the large Unicode buffer) Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** win32apimodule.cpp 12 Jun 2004 07:45:54 -0000 1.37 --- win32apimodule.cpp 13 Jul 2004 07:12:45 -0000 1.38 *************** *** 1605,1608 **** --- 1605,1609 ---- WCHAR pathBuf[MAX_PATH]; WCHAR *fileName; + PyObject *obLongPathNameW = NULL; if (!myGetLongPathNameW) PyErr_SetString(PyExc_NotImplementedError, "GetLongPathNameW does not exist in this version of Windows"); *************** *** 1614,1628 **** return NULL; PyW32_BEGIN_ALLOW_THREADS ! BOOL ok = (*myGetLongPathNameW)(fileName, pathBuf, sizeof(pathBuf)/sizeof(pathBuf[0])); PyW32_END_ALLOW_THREADS PyWinObject_FreeWCHAR(fileName); ! if (!ok) ! return ReturnAPIError("GetLongPathName"); ! return PyWinObject_FromWCHAR(pathBuf); // @comm This function may raise a NotImplementedError exception if the version // of Windows does not support this function. } - // @pymethod string|win32api|GetTickCount|Returns the number of milliseconds since windows started. static PyObject * --- 1615,1657 ---- return NULL; PyW32_BEGIN_ALLOW_THREADS ! DWORD length = (*myGetLongPathNameW)(fileName, pathBuf, sizeof(pathBuf)/sizeof(pathBuf[0])); PyW32_END_ALLOW_THREADS + if (length) + { + if (length < sizeof(pathBuf)/sizeof(pathBuf[0])) + obLongPathNameW = PyWinObject_FromWCHAR(pathBuf); + else + { + // retry with a buffer that is big enough. Now we know the + // size and that it is big, avoid double-handling. + Py_UNICODE *buf; + // The length is the buffer needed, which includes the NULL. + // PyUnicode_FromUnicode adds one. + obLongPathNameW = PyUnicode_FromUnicode(NULL, length-1); + if (!obLongPathNameW) { + PyWinObject_FreeWCHAR(fileName); + return NULL; + } + buf = PyUnicode_AS_UNICODE(obLongPathNameW); + PyW32_BEGIN_ALLOW_THREADS + DWORD length2 = (*myGetLongPathNameW)(fileName, buf, length); + PyW32_END_ALLOW_THREADS + if (length2==0) { + Py_DECREF(obLongPathNameW); + obLongPathNameW = NULL; + } + // On success, it is the number of chars copied *not* including + // the NULL. Check this is true. + assert(length2+1==length); + } + } PyWinObject_FreeWCHAR(fileName); ! if(!obLongPathNameW) ! return ReturnAPIError("GetLongPathNameW"); ! return obLongPathNameW; // @comm This function may raise a NotImplementedError exception if the version // of Windows does not support this function. } // @pymethod string|win32api|GetTickCount|Returns the number of milliseconds since windows started. static PyObject * |
|
From: Mark H. <mha...@us...> - 2004-07-13 05:30:02
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29490 Modified Files: browseProjects.py Log Message: Fix [ 817035 ] Exception in browsing libraries (Tools->Browse PythonPath Index: browseProjects.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browseProjects.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** browseProjects.py 1 Sep 1999 23:33:57 -0000 1.1 --- browseProjects.py 13 Jul 2004 05:29:53 -0000 1.2 *************** *** 17,21 **** class HLICLBRItem(hierlist.HierListItem): def __init__(self, name, file, lineno, suffix = ""): ! self.name = name self.file = file self.lineno = lineno --- 17,24 ---- class HLICLBRItem(hierlist.HierListItem): def __init__(self, name, file, lineno, suffix = ""): ! # If the 'name' object itself has a .name, use it. Not sure ! # how this happens, but seems pyclbr related. ! # See PyWin32 bug 817035 ! self.name = getattr(name, "name", name) self.file = file self.lineno = lineno |
|
From: Mark H. <mha...@us...> - 2004-07-13 05:15:08
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27737 Modified Files: dbi.h Log Message: Recent platform changes failed to build on Windows - try this :) Index: dbi.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dbi.h 13 Jul 2004 05:03:30 -0000 1.3 --- dbi.h 13 Jul 2004 05:15:00 -0000 1.4 *************** *** 12,37 **** #define DBI_H ! PyAPI_FUNC(int) dbiIsDate(const PyObject *o); ! PyAPI_FUNC(int) dbiIsRaw(const PyObject *o); ! PyAPI_FUNC(int) dbiIsRowId(const PyObject *o); /* These do not INCREF */ ! PyAPI_FUNC(PyObject) *dbiValue(PyObject *o); ! PyAPI_FUNC(PyObject) *dbiMakeDate(PyObject *contents); ! PyAPI_FUNC(PyObject) *dbiMakeRaw(PyObject *contents); ! PyAPI_FUNC(PyObject) *dbiMakeRowId(PyObject *contents); ! PyAPI_FUNC(PyObject)*DbiString; ! PyAPI_FUNC(PyObject)*DbiRaw; ! PyAPI_FUNC(PyObject)*DbiRowId; ! PyAPI_FUNC(PyObject)*DbiNumber; ! PyAPI_FUNC(PyObject)*DbiDate; ! PyAPI_FUNC(PyObject)*DbiNoError; ! PyAPI_FUNC(PyObject)*DbiOpError; ! PyAPI_FUNC(PyObject)*DbiProgError; ! PyAPI_FUNC(PyObject)*DbiIntegrityError; ! PyAPI_FUNC(PyObject)*DbiDataError; ! PyAPI_FUNC(PyObject)*DbiInternalError; --- 12,47 ---- #define DBI_H ! #ifdef MS_WIN32 ! #ifdef DBI_EXPORT ! #define DBI_FUNC(x) __declspec(dllexport) x ! #else ! #define DBI_FUNC(x) __declspec(dllimport) x ! #endif /* DBI_EXPORT */ ! #else /* MS_WIN32 */ ! #define DBI_FUNC(x) x ! #endif ! ! DBI_FUNC(int) dbiIsDate(const PyObject *o); ! DBI_FUNC(int) dbiIsRaw(const PyObject *o); ! DBI_FUNC(int) dbiIsRowId(const PyObject *o); /* These do not INCREF */ ! DBI_FUNC(PyObject) *dbiValue(PyObject *o); ! DBI_FUNC(PyObject) *dbiMakeDate(PyObject *contents); ! DBI_FUNC(PyObject) *dbiMakeRaw(PyObject *contents); ! DBI_FUNC(PyObject) *dbiMakeRowId(PyObject *contents); ! DBI_FUNC(PyObject)*DbiString; ! DBI_FUNC(PyObject)*DbiRaw; ! DBI_FUNC(PyObject)*DbiRowId; ! DBI_FUNC(PyObject)*DbiNumber; ! DBI_FUNC(PyObject)*DbiDate; ! DBI_FUNC(PyObject)*DbiNoError; ! DBI_FUNC(PyObject)*DbiOpError; ! DBI_FUNC(PyObject)*DbiProgError; ! DBI_FUNC(PyObject)*DbiIntegrityError; ! DBI_FUNC(PyObject)*DbiDataError; ! DBI_FUNC(PyObject)*DbiInternalError; |
|
From: Mark H. <mha...@us...> - 2004-07-13 05:05:36
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26717 Modified Files: dbi.cpp Log Message: [ 956247 ] convert C++ comments to C in dbi.cpp Index: dbi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dbi.cpp 18 Apr 2002 02:12:36 -0000 1.5 --- dbi.cpp 13 Jul 2004 05:05:27 -0000 1.6 *************** *** 15,21 **** #include "intobject.h" ! // Python 1.5.2 doesn't have PyObject_New ! // PyObject_NEW is not *quite* as safe, but seem to work fine ! // (as all win32all for 1.5.2 used it! #ifndef PyObject_New #define PyObject_New PyObject_NEW --- 15,21 ---- #include "intobject.h" ! /* Python 1.5.2 doesn't have PyObject_New ! PyObject_NEW is not *quite* as safe, but seem to work fine ! (as all win32all for 1.5.2 used it! */ #ifndef PyObject_New #define PyObject_New PyObject_NEW *************** *** 55,59 **** { Py_DECREF(((DbiContainer *) self)->objectOf); ! #ifdef PyObject_Del // see top of file for 1.5.2 comments PyObject_Del(self); #else --- 55,59 ---- { Py_DECREF(((DbiContainer *) self)->objectOf); ! #ifdef PyObject_Del /* see top of file for 1.5.2 comments */ PyObject_Del(self); #else *************** *** 64,68 **** static PyMethodDef noMethods[] = { ! 0, 0 }; --- 64,68 ---- static PyMethodDef noMethods[] = { ! {0, 0} }; *************** *** 85,89 **** { long l = PyInt_AsLong(dbiValue(o)); ! return PyString_FromStringAndSize(ctime(&l), 24); // less \n } --- 85,89 ---- { long l = PyInt_AsLong(dbiValue(o)); ! return PyString_FromStringAndSize(ctime(&l), 24); /* less \n */ } *************** *** 266,275 **** }; ! void initdbi() { PyObject *m = Py_InitModule("dbi", globalMethods); if (!m) /* Eeek - some serious error! */ return; ! PyObject *d = PyModule_GetDict(m); if (!d) return; /* Another serious error!*/ PyDict_SetItemString(d, "STRING", --- 266,277 ---- }; ! PyMODINIT_FUNC ! initdbi() { PyObject *m = Py_InitModule("dbi", globalMethods); + PyObject *d; if (!m) /* Eeek - some serious error! */ return; ! d = PyModule_GetDict(m); if (!d) return; /* Another serious error!*/ PyDict_SetItemString(d, "STRING", |
|
From: Mark H. <mha...@us...> - 2004-07-13 05:03:42
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26525 Modified Files: dbi.h Log Message: [ 956244 ] platform portability patch for dbi.h Index: dbi.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dbi.h 18 Jun 2001 06:57:21 -0000 1.2 --- dbi.h 13 Jul 2004 05:03:30 -0000 1.3 *************** *** 12,43 **** #define DBI_H ! #ifdef DBI_EXPORT ! #define CALLCONV(RTYPE) __declspec(dllexport) RTYPE ! #else ! #define CALLCONV(RTYPE) __declspec(dllimport) RTYPE ! #endif ! ! CALLCONV(int) dbiIsDate(const PyObject *o); ! CALLCONV(int) dbiIsRaw(const PyObject *o); ! CALLCONV(int) dbiIsRowId(const PyObject *o); /* These do not INCREF */ ! CALLCONV(PyObject) *dbiValue(PyObject *o); ! CALLCONV(PyObject) *dbiMakeDate(PyObject *contents); ! CALLCONV(PyObject) *dbiMakeRaw(PyObject *contents); ! CALLCONV(PyObject) *dbiMakeRowId(PyObject *contents); ! CALLCONV(PyObject)*DbiString; ! CALLCONV(PyObject)*DbiRaw; ! CALLCONV(PyObject)*DbiRowId; ! CALLCONV(PyObject)*DbiNumber; ! CALLCONV(PyObject)*DbiDate; ! CALLCONV(PyObject)*DbiNoError; ! CALLCONV(PyObject)*DbiOpError; ! CALLCONV(PyObject)*DbiProgError; ! CALLCONV(PyObject)*DbiIntegrityError; ! CALLCONV(PyObject)*DbiDataError; ! CALLCONV(PyObject)*DbiInternalError; --- 12,37 ---- #define DBI_H ! PyAPI_FUNC(int) dbiIsDate(const PyObject *o); ! PyAPI_FUNC(int) dbiIsRaw(const PyObject *o); ! PyAPI_FUNC(int) dbiIsRowId(const PyObject *o); /* These do not INCREF */ ! PyAPI_FUNC(PyObject) *dbiValue(PyObject *o); ! PyAPI_FUNC(PyObject) *dbiMakeDate(PyObject *contents); ! PyAPI_FUNC(PyObject) *dbiMakeRaw(PyObject *contents); ! PyAPI_FUNC(PyObject) *dbiMakeRowId(PyObject *contents); ! PyAPI_FUNC(PyObject)*DbiString; ! PyAPI_FUNC(PyObject)*DbiRaw; ! PyAPI_FUNC(PyObject)*DbiRowId; ! PyAPI_FUNC(PyObject)*DbiNumber; ! PyAPI_FUNC(PyObject)*DbiDate; ! PyAPI_FUNC(PyObject)*DbiNoError; ! PyAPI_FUNC(PyObject)*DbiOpError; ! PyAPI_FUNC(PyObject)*DbiProgError; ! PyAPI_FUNC(PyObject)*DbiIntegrityError; ! PyAPI_FUNC(PyObject)*DbiDataError; ! PyAPI_FUNC(PyObject)*DbiInternalError; |
|
From: Mark H. <mha...@us...> - 2004-07-13 05:01:29
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26221 Modified Files: odbc.cpp Log Message: [ 956093 ] minimal C portability patch for odbc.cpp Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** odbc.cpp 13 Jul 2004 04:56:22 -0000 1.11 --- odbc.cpp 13 Jul 2004 05:01:21 -0000 1.12 *************** *** 1,7 **** /* ! odbcmodule.c Donated to the Python community by EShop, who can not support it! */ --- 1,11 ---- /* ! odbc.cpp ! $Id$ Donated to the Python community by EShop, who can not support it! + + Note that this can be built on non-Windows systems by a C (not C++) + compiler, so should avoid C++ constructs and comments. */ *************** *** 20,23 **** --- 24,33 ---- #include <time.h> + #ifndef _cplusplus + #define bool int + #define true 1 + #define false 0 + #endif + /* Python 1.5.2 doesn't have PyObject_New PyObject_NEW is not *quite* as safe, but seem to work fine *************** *** 1263,1268 **** if (rows) { /* handle insert cases... */ ! for(int i = 0; i < PySequence_Length(rows); i++) { inputvars = PySequence_GetItem(rows, i); --- 1273,1279 ---- if (rows) { + int i; /* handle insert cases... */ ! for(i = 0; i < PySequence_Length(rows); i++) { inputvars = PySequence_GetItem(rows, i); |
|
From: Mark H. <mha...@us...> - 2004-07-13 04:56:32
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25381 Modified Files: odbc.cpp Log Message: [ 956094 ] convert C++ comments to C in odbc.cpp Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** odbc.cpp 25 Apr 2004 04:31:41 -0000 1.10 --- odbc.cpp 13 Jul 2004 04:56:22 -0000 1.11 *************** *** 6,10 **** */ ! // @doc - this file contains autoduck documentation in the comments. #include <math.h> #include <limits.h> --- 6,10 ---- */ ! /* @doc - this file contains autoduck documentation in the comments. */ #include <math.h> #include <limits.h> *************** *** 20,26 **** #include <time.h> ! // Python 1.5.2 doesn't have PyObject_New ! // PyObject_NEW is not *quite* as safe, but seem to work fine ! // (as all win32all for 1.5.2 used it! #ifndef PyObject_New #define PyObject_New PyObject_NEW --- 20,26 ---- #include <time.h> ! /* Python 1.5.2 doesn't have PyObject_New ! PyObject_NEW is not *quite* as safe, but seem to work fine ! (as all win32all for 1.5.2 used it! */ #ifndef PyObject_New #define PyObject_New PyObject_NEW *************** *** 30,34 **** #endif ! #include "dbi.h" //$ This is a hack static PyObject *odbcError; --- 30,34 ---- #endif ! #include "dbi.h" /*$ This is a hack */ static PyObject *odbcError; *************** *** 145,149 **** static odbcErrorDesc *lookupError(const char *sqlState); ! static PyObject *dbiErrors[6]; // 'cause I know about six DBI errors static void odbcPrintError --- 145,149 ---- static odbcErrorDesc *lookupError(const char *sqlState); ! static PyObject *dbiErrors[6]; /* 'cause I know about six DBI errors */ static void odbcPrintError *************** *** 187,191 **** } ! // internal is the default int errn = errorType ? errorType->index : 5 ; error = dbiErrors[errn]; --- 187,191 ---- } ! /* internal is the default */ int errn = errorType ? errorType->index : 5 ; error = dbiErrors[errn]; *************** *** 226,230 **** } conn->connected = 1; ! conn->connect_id++; // perturb it so cursors know to reconnect return 0; --- 226,230 ---- } conn->connected = 1; ! conn->connect_id++; /* perturb it so cursors know to reconnect */ return 0; *************** *** 236,240 **** (cur->my_conx->connected == 0)) { ! // ie the cursor was made on an old connection printf("Attempting reconnect\n"); --- 236,240 ---- (cur->my_conx->connected == 0)) { ! /* ie the cursor was made on an old connection */ printf("Attempting reconnect\n"); *************** *** 243,247 **** if (cur->my_conx->connected == 0) { ! // ie the db has not been reconnected if (doConnect(cur->my_conx)) { --- 243,247 ---- if (cur->my_conx->connected == 0) { ! /* ie the db has not been reconnected */ if (doConnect(cur->my_conx)) { *************** *** 261,270 **** } ! // @pymethod |connection|setautocommit|Sets the autocommit mode. static PyObject *odbcSetAutoCommit(PyObject *self, PyObject *args) { int c; connectionObject *conn; ! // @pyparm int|c||The boolean autocommit mode. if (!PyArg_ParseTuple(args, "i",&c)) return NULL; --- 261,270 ---- } ! /* @pymethod |connection|setautocommit|Sets the autocommit mode. */ static PyObject *odbcSetAutoCommit(PyObject *self, PyObject *args) { int c; connectionObject *conn; ! /* @pyparm int|c||The boolean autocommit mode. */ if (!PyArg_ParseTuple(args, "i",&c)) return NULL; *************** *** 298,302 **** ! // @pymethod |connection|commit|Commits a transaction. static PyObject *odbcCommit(PyObject *self, PyObject *args) { --- 298,302 ---- ! /* @pymethod |connection|commit|Commits a transaction. */ static PyObject *odbcCommit(PyObject *self, PyObject *args) { *************** *** 320,324 **** } ! // @pymethod |connection|rollback|Rollsback a transaction. static PyObject *odbcRollback(PyObject *self, PyObject *args) { --- 320,324 ---- } ! /* @pymethod |connection|rollback|Rollsback a transaction. */ static PyObject *odbcRollback(PyObject *self, PyObject *args) { *************** *** 341,345 **** } ! // @pymethod |connection|cursor|Creates a <o cursor> object static PyObject *odbcCursor(PyObject *self, PyObject *args) { --- 341,345 ---- } ! /* @pymethod |connection|cursor|Creates a <o cursor> object */ static PyObject *odbcCursor(PyObject *self, PyObject *args) { *************** *** 375,379 **** } ! // @pymethod |connection|close|Closes the connection. static PyObject *odbcClose(PyObject *self, PyObject *args) { --- 375,379 ---- } ! /* @pymethod |connection|close|Closes the connection. */ static PyObject *odbcClose(PyObject *self, PyObject *args) { *************** *** 382,392 **** } ! // @object connection|An object representing an ODBC connection static PyMethodDef connectionMethods[] = { ! { "setautocommit", odbcSetAutoCommit, 1 }, // @pymeth setautocommit|Sets the autocommit mode. ! { "commit", odbcCommit, 1 } , // @pymeth commit|Commits a transaction. ! { "rollback", odbcRollback, 1 } , // @pymeth rollback|Rollsback a transaction. ! { "cursor", odbcCursor, 1 } , // @pymeth cursor|Creates a <o cursor> object ! { "close", odbcClose, 1 } , // @pymeth close|Closes the connection. {0, 0} }; --- 382,392 ---- } ! /* @object connection|An object representing an ODBC connection */ static PyMethodDef connectionMethods[] = { ! { "setautocommit", odbcSetAutoCommit, 1 }, /* @pymeth setautocommit|Sets the autocommit mode. */ ! { "commit", odbcCommit, 1 } , /* @pymeth commit|Commits a transaction. */ ! { "rollback", odbcRollback, 1 } , /* @pymeth rollback|Rollsback a transaction. */ ! { "cursor", odbcCursor, 1 } , /* @pymeth cursor|Creates a <o cursor> object */ ! { "close", odbcClose, 1 } , /* @pymeth close|Closes the connection. */ {0, 0} }; *************** *** 434,438 **** { InputBinding *next = ib->next; ! //$ free(ib->bind_area); free(ib); ib = next; --- 434,438 ---- { InputBinding *next = ib->next; ! /*$ free(ib->bind_area); */ free(ib); ib = next; *************** *** 467,474 **** ! // @pymethod |cursor|close|Closes the cursor static PyObject *odbcCurClose(PyObject *self, PyObject *args) { ! // @comm This method does nothing!! I presume it should!?!?! Py_INCREF(Py_None); return Py_None; --- 467,474 ---- ! /* @pymethod |cursor|close|Closes the cursor */ static PyObject *odbcCurClose(PyObject *self, PyObject *args) { ! /* @comm This method does nothing!! I presume it should!?!?! */ Py_INCREF(Py_None); return Py_None; *************** *** 493,500 **** ob->vsize = vsize; ! // Stick the new column on the end of the linked list. ! // We do this because we call SQLGetData() while walking the linked list. ! // Some ODBC drivers require all BLOB columns to be at the end of the column list. ! // So preserve the order our consumer called us with. ob->next = NULL; if (cur->outputVars == NULL) --- 493,500 ---- ob->vsize = vsize; ! /* Stick the new column on the end of the linked list. ! We do this because we call SQLGetData() while walking the linked list. ! Some ODBC drivers require all BLOB columns to be at the end of the column list. ! So preserve the order our consumer called us with. */ ob->next = NULL; if (cur->outputVars == NULL) *************** *** 1124,1130 **** ! // This lame function is here for backward compatibility with some ! // very old ODBC drivers that got naively ported from Windows 3.1. ! // So says: Chris Ingram [chr...@sy...] static RETCODE sendSQLInputData ( --- 1124,1130 ---- ! /* This lame function is here for backward compatibility with some ! very old ODBC drivers that got naively ported from Windows 3.1. ! So says: Chris Ingram [chr...@sy...] */ static RETCODE sendSQLInputData ( *************** *** 1141,1145 **** InputBinding* pInputBinding = cur->inputVars; ! // find the input to put while (pInputBinding) { --- 1141,1145 ---- InputBinding* pInputBinding = cur->inputVars; ! /* find the input to put */ while (pInputBinding) { *************** *** 1175,1179 **** } ! // see if additional data is needed. rc = SQLParamData(cur->hstmt, (void **)&pIndx); } --- 1175,1179 ---- } ! /* see if additional data is needed. */ rc = SQLParamData(cur->hstmt, (void **)&pIndx); } *************** *** 1183,1187 **** } ! // @pymethod int|cursor|execute|Execute some SQL static PyObject *odbcCurExec(PyObject *self, PyObject *args) { --- 1183,1187 ---- } ! /* @pymethod int|cursor|execute|Execute some SQL */ static PyObject *odbcCurExec(PyObject *self, PyObject *args) { *************** *** 1202,1207 **** } ! // @pyparm string|sql||The SQL to execute ! // @pyparm sequence|[var, ...]|[]|Input variables. if (!PyArg_ParseTuple(args, "s|O", &sql, &inputvars)) { --- 1202,1207 ---- } ! /* @pyparm string|sql||The SQL to execute */ ! /* @pyparm sequence|[var, ...]|[]|Input variables. */ if (!PyArg_ParseTuple(args, "s|O", &sql, &inputvars)) { *************** *** 1217,1221 **** { temp = PySequence_GetItem(inputvars, 0); ! // Strings don't count as a list in this case. if (PySequence_Check(temp) && !PyString_Check(temp)) { --- 1217,1221 ---- { temp = PySequence_GetItem(inputvars, 0); ! /* Strings don't count as a list in this case. */ if (PySequence_Check(temp) && !PyString_Check(temp)) { *************** *** 1263,1267 **** if (rows) { ! // handle insert cases... for(int i = 0; i < PySequence_Length(rows); i++) { --- 1263,1267 ---- if (rows) { ! /* handle insert cases... */ for(int i = 0; i < PySequence_Length(rows); i++) { *************** *** 1285,1289 **** SQL_NTS); Py_END_ALLOW_THREADS ! // move data here. if (rc == SQL_NEED_DATA) { --- 1285,1289 ---- SQL_NTS); Py_END_ALLOW_THREADS ! /* move data here. */ if (rc == SQL_NEED_DATA) { *************** *** 1366,1393 **** RETCODE rc; long cbRead = 0; ! // Use SQLGetData to retrieve data for blob (or long varchar) type columns. if (ob->bGetData) { ! // Initialize memory (offsets, etc.) ! // (use bind_area for buffer, and dynamically allocate in the loop below) cbRequired = ob->vsize; ob->rcode = 0; ! cbRead = 0; // Count of bytes read (running total and offset into buffer). ! // Loop until SQLGetData tells us that there are no more chunks ! // of the blob to retrieve. do { ! // Check to see if bind_area is big enough ! // if cbRequired > vsize ! // re-allocate bind_area to cbRequired ! // set ob->vsize = cbRequired if (cbRequired > ob->vsize) { void *pTemp; ! // ! // Some BLOBs can be huge, be paranoid about allowing ! // other threads to run. ! // Py_BEGIN_ALLOW_THREADS pTemp = malloc (cbRequired); --- 1366,1391 ---- RETCODE rc; long cbRead = 0; ! /* Use SQLGetData to retrieve data for blob (or long varchar) type columns. */ if (ob->bGetData) { ! /* Initialize memory (offsets, etc.) ! (use bind_area for buffer, and dynamically allocate in the loop below) */ cbRequired = ob->vsize; ob->rcode = 0; ! cbRead = 0; /* Count of bytes read (running total and offset into buffer). */ ! /* Loop until SQLGetData tells us that there are no more chunks ! of the blob to retrieve. */ do { ! /* Check to see if bind_area is big enough ! if cbRequired > vsize ! re-allocate bind_area to cbRequired ! set ob->vsize = cbRequired */ if (cbRequired > ob->vsize) { void *pTemp; ! /* Some BLOBs can be huge, be paranoid about allowing ! other threads to run. */ Py_BEGIN_ALLOW_THREADS pTemp = malloc (cbRequired); *************** *** 1399,1403 **** } ! // rc = GetData( ... , bind_area + offset, vsize - offset, &rcode ) Py_BEGIN_ALLOW_THREADS rc = SQLGetData(cur->hstmt, --- 1397,1401 ---- } ! /* rc = GetData( ... , bind_area + offset, vsize - offset, &rcode ) */ Py_BEGIN_ALLOW_THREADS rc = SQLGetData(cur->hstmt, *************** *** 1417,1438 **** if ((ob->rcode != SQL_NO_TOTAL) && (ob->rcode <= ob->vsize - cbRead)) { ! // If we get here, then this should be the last iteration ! // through the loop. cbRead += ob->rcode; } else { ! // Grow buffer by (32k minus 1 byte) each for each chunk. ! // If not for the SQL Anywhere 5.0 problem (driver version ! // 5.05.041867), we could probably grow by 50% each time ! // or the remaining size (as determined by ob->rcode). ! //cbRequired += ob->rcode - ob->vsize; ! cbRequired += 32767; // Fix that works for SQL Anywhere 5.0 driver. if (ob->vtype == SQL_C_CHAR) { ! // We want to ignore the intermediate ! // NULL characters SQLGetData() gives us. ! // (silly, silly) cbRead = ob->vsize - 1; } --- 1415,1436 ---- if ((ob->rcode != SQL_NO_TOTAL) && (ob->rcode <= ob->vsize - cbRead)) { ! /* If we get here, then this should be the last iteration ! through the loop. */ cbRead += ob->rcode; } else { ! /* Grow buffer by (32k minus 1 byte) each for each chunk. ! If not for the SQL Anywhere 5.0 problem (driver version ! 5.05.041867), we could probably grow by 50% each time ! or the remaining size (as determined by ob->rcode). */ ! /*cbRequired += ob->rcode - ob->vsize; */ ! cbRequired += 32767; /* Fix that works for SQL Anywhere 5.0 driver. */ if (ob->vtype == SQL_C_CHAR) { ! /* We want to ignore the intermediate ! NULL characters SQLGetData() gives us. ! (silly, silly) */ cbRead = ob->vsize - 1; } *************** *** 1524,1528 **** else { ! Py_DECREF(list); // thwow it away return NULL; } --- 1522,1526 ---- else { ! Py_DECREF(list); /* throw it away */ return NULL; } *************** *** 1532,1536 **** ! // @pymethod data|cursor|fetchone|Fetch one row of data static PyObject *odbcCurFetchOne(PyObject *self, PyObject *args) { --- 1530,1534 ---- ! /* @pymethod data|cursor|fetchone|Fetch one row of data */ static PyObject *odbcCurFetchOne(PyObject *self, PyObject *args) { *************** *** 1539,1543 **** ! // @pymethod [data, ...]|cursor|fetchmany|Fetch many rows of data static PyObject *odbcCurFetchMany(PyObject *self, PyObject *args) { --- 1537,1541 ---- ! /* @pymethod [data, ...]|cursor|fetchmany|Fetch many rows of data */ static PyObject *odbcCurFetchMany(PyObject *self, PyObject *args) { *************** *** 1552,1556 **** } ! // @pymethod [data, ...]|cursor|fetchall|Fetch all rows of data static PyObject *odbcCurFetchAll(PyObject *self, PyObject *args) { --- 1550,1554 ---- } ! /* @pymethod [data, ...]|cursor|fetchall|Fetch all rows of data */ static PyObject *odbcCurFetchAll(PyObject *self, PyObject *args) { *************** *** 1558,1562 **** } ! // @pymethod |cursor|setinputsizes| static PyObject *odbcCurSetInputSizes(PyObject *self, PyObject *args) { --- 1556,1560 ---- } ! /* @pymethod |cursor|setinputsizes| */ static PyObject *odbcCurSetInputSizes(PyObject *self, PyObject *args) { *************** *** 1564,1568 **** return Py_None; } ! // @pymethod |cursor|setoutputsize| static PyObject *odbcCurSetOutputSize(PyObject *self, PyObject *args) { --- 1562,1566 ---- return Py_None; } ! /* @pymethod |cursor|setoutputsize| */ static PyObject *odbcCurSetOutputSize(PyObject *self, PyObject *args) { *************** *** 1576,1588 **** } ! // @object cursor|An object representing an ODBC cursor. static PyMethodDef cursorMethods[] = { ! { "close", odbcCurClose, 1} , // @pymeth close|Closes the cursor ! { "execute", odbcCurExec, 1} , // @pymeth execute|Execute some SQL ! { "fetchone", odbcCurFetchOne, 1} , // @pymeth fetchone|Fetch one row of data ! { "fetchmany", odbcCurFetchMany, 1} , // @pymeth fetchmany|Fetch many rows of data ! { "fetchall", odbcCurFetchAll, 1} , // @pymeth fetchall|Fetch all the rows of data ! { "setinputsizes", odbcCurSetInputSizes, 1} , // @pymeth setinputsizes| ! { "setoutputsize", odbcCurSetOutputSize, 1} ,// @pymeth setoutputsize| {0, 0} /* Sentinel */ }; --- 1574,1586 ---- } ! /* @object cursor|An object representing an ODBC cursor. */ static PyMethodDef cursorMethods[] = { ! { "close", odbcCurClose, 1} , /* @pymeth close|Closes the cursor */ ! { "execute", odbcCurExec, 1} , /* @pymeth execute|Execute some SQL */ ! { "fetchone", odbcCurFetchOne, 1} , /* @pymeth fetchone|Fetch one row of data */ ! { "fetchmany", odbcCurFetchMany, 1} , /* @pymeth fetchmany|Fetch many rows of data */ ! { "fetchall", odbcCurFetchAll, 1} , /* @pymeth fetchall|Fetch all the rows of data */ ! { "setinputsizes", odbcCurSetInputSizes, 1} , /* @pymeth setinputsizes| */ ! { "setoutputsize", odbcCurSetOutputSize, 1} ,/* @pymeth setoutputsize| */ {0, 0} /* Sentinel */ }; *************** *** 1656,1660 **** } ! connectionStringLength = strlen(dsn) + strlen(uid) + strlen(pwd) + 15; // add room for DSN=;UID=;PWD=\0 conn->connectionString = (char *) malloc(connectionStringLength); strcpy(conn->connectionString, "DSN="); --- 1654,1658 ---- } ! connectionStringLength = strlen(dsn) + strlen(uid) + strlen(pwd) + 15; /* add room for DSN=;UID=;PWD=\0 */ conn->connectionString = (char *) malloc(connectionStringLength); strcpy(conn->connectionString, "DSN="); *************** *** 1678,1682 **** } ! // @pymethod <o connection>|odbc|odbc|Creates an ODBC connection static PyObject *odbcLogon(PyObject *self, PyObject *args) { --- 1676,1680 ---- } ! /* @pymethod <o connection>|odbc|odbc|Creates an ODBC connection */ static PyObject *odbcLogon(PyObject *self, PyObject *args) { *************** *** 1684,1692 **** connectionObject *conn; ! // @pyparm string|connectionString||An ODBC connection string. ! // For backwards-compatibility, this parameter can be of the form ! // DSN[/username[/password]] (e.g. "myDSN/myUserName/myPassword"). ! // Alternatively, a full ODBC connection string can be used (e.g., ! // "Driver={SQL Server};Server=(local);Database=myDatabase"). if (!PyArg_ParseTuple(args, "s", &connectionString)) { --- 1682,1690 ---- connectionObject *conn; ! /* @pyparm string|connectionString||An ODBC connection string. ! For backwards-compatibility, this parameter can be of the form ! DSN[/username[/password]] (e.g. "myDSN/myUserName/myPassword"). ! Alternatively, a full ODBC connection string can be used (e.g., ! "Driver={SQL Server};Server=(local);Database=myDatabase"). */ if (!PyArg_ParseTuple(args, "s", &connectionString)) { *************** *** 1700,1704 **** } ! conn->connect_id = 0; // initialize it to anything conn->hdbc = SQL_NULL_HDBC; conn->connectionString = NULL; --- 1698,1702 ---- } ! conn->connect_id = 0; /* initialize it to anything */ conn->hdbc = SQL_NULL_HDBC; conn->connectionString = NULL; *************** *** 1721,1727 **** } ! // @module odbc|A Python wrapper around the ODBC API. static PyMethodDef globalMethods[] = { ! { "odbc", odbcLogon, 1} , // @pymeth odbc|Creates an <o connection> object. {0, 0} /* Sentinel */ }; --- 1719,1725 ---- } ! /* @module odbc|A Python wrapper around the ODBC API. */ static PyMethodDef globalMethods[] = { ! { "odbc", odbcLogon, 1} , /* @pymeth odbc|Creates an <o connection> object. */ {0, 0} /* Sentinel */ }; *************** *** 1761,1855 **** static odbcErrorDesc errorTable[] = { ! { "01000", 5, 0 } , // General warning ! { "01002", 1, 1 } , // Disconnect error ! { "01004", 0, 1 } , // Data truncated ! { "01006", 5, 1 } , // Privilege not revoked ! { "01S00", 2, 1 } , // Invalid connection string attribute ! { "01S01", 5, 1 } , // Error in row ! { "01S02", 5, 1 } , // Option value changed ! { "01S03", 0, 1 } , // No rows updated or deleted ! { "01S04", 0, 1 } , // More than one row updated or deleted ! { "01S05", 0, 1 } , // Cancel treated as SQLFreeStmt with the SQL_CLOSE ! { "01S06", 2, 1 } , // Attempt to fetch before the result set returned ! { "07001", 2, 1 } , // Wrong number of parameters ! { "07006", 2, 1 } , // Restricted data type attribute violation ! { "07S01", 2, 1 } , // Invalid use of default parameter ! { "08001", 1, 1 } , // Unable to connect to data source ! { "08002", 1, 1 } , // Connection in use ! { "08003", 1, 1 } , // Connection not open ! { "08004", 1, 1 } , // Data source rejected establishment of connection ! { "08007", 1, 1 } , // Connection failure during transaction ! { "08S01", 1, 0 } , // Communication link failure ! { "21S01", 2, 1 } , // Insert value list does not match column list ! { "21S02", 2, 1 } , // Degree of derived table does not match column list ! { "22001", 0, 1 } , // String data right truncation ! { "22002", 5, 1 } , // Indicator variable required but not supplied ! { "22003", 4, 1 } , // Numeric value out of range ! { "22005", 4, 1 } , // Error in assignment ! { "22008", 4, 1 } , // Datetime field overflow ! { "22012", 4, 1 } , // Division by zero ! { "22026", 4, 1 } , // String data, length mismatch ! { "23000", 3, 1 } , // Integrity constraint violation ! { "24000", 5, 1 } , // Invalid cursor state ! { "25000", 5, 1 } , // Invalid transaction state ! { "28000", 1, 1 } , // Invalid authorization specification ! { "34000", 5, 1 } , // Invalid cursor name ! { "37000", 2, 1 } , // Syntax error or access violation ! { "3C000", 5, 1 } , // Duplicate cursor name ! { "40001", 5, 1 } , // Serialization failure ! { "42000", 2, 1 } , // Syntax error or access violation ! { "70100", 1, 1 } , // Operation aborted ! { "IM001", 1, 1 } , // Driver does not support this function ! { "IM002", 1, 1 } , // Data source name not found and no default driver ! { "IM003", 1, 1 } , // Specified driver could not be loaded ! { "IM004", 1, 1 } , // Driver's SQLAllocEnv failed ! { "IM005", 1, 1 } , // Driver's SQLAllocConnect failed ! { "IM006", 1, 1 } , // Driver's SQLSetConnect-Option failed ! { "IM007", 1, 1 } , // No data source or driver specified; dialog prohibited ! { "IM008", 1, 1 } , // Dialog failed ! { "IM009", 1, 1 } , // Unable to load translation DLL ! { "IM010", 1, 1 } , // Data source name too long ! { "IM011", 1, 1 } , // Driver name too long ! { "IM012", 1, 1 } , // DRIVER keyword syntax error ! { "IM013", 1, 1 } , // Trace file error ! { "S0001", 2, 1 } , // Base table or view already exists ! { "S0002", 2, 1 } , // Base table not found ! { "S0011", 2, 1 } , // Index already exists ! { "S0012", 2, 1 } , // Index not found ! { "S0021", 2, 1 } , // Column already exists ! { "S0022", 2, 1 } , // Column not found ! { "S0023", 2, 1 } , // No default for column ! { "S1000", 1, 1 } , // General error ! { "S1001", 1, 1 } , // Memory allocation failure ! { "S1002", 5, 1 } , // Invalid column number ! { "S1003", 5, 1 } , // Program type out of range ! { "S1004", 5, 1 } , // SQL data type out of range ! { "S1008", 1, 1 } , // Operation canceled ! { "S1009", 5, 1 } , // Invalid argument value ! { "S1010", 5, 1 } , // Function sequence error ! { "S1011", 5, 1 } , // Operation invalid at this time ! { "S1012", 5, 1 } , // Invalid transaction operation code specified ! { "S1015", 5, 1 } , // No cursor name available ! { "S1090", 5, 1 } , // Invalid string or buffer length ! { "S1091", 5, 1 } , // Descriptor type out of range ! { "S1092", 5, 1 } , // Option type out of range ! { "S1093", 5, 1 } , // Invalid parameter number ! { "S1095", 5, 1 } , // Function type out of range ! { "S1096", 5, 1 } , // Information type out of range ! { "S1097", 5, 1 } , // Column type out of range ! { "S1098", 5, 1 } , // Scope type out of range ! { "S1099", 5, 1 } , // Nullable type out of range ! { "S1100", 5, 1 } , // Uniqueness option type out of range ! { "S1101", 5, 1 } , // Accuracy option type out of range ! { "S1103", 5, 1 } , // Direction option out of range ! { "S1105", 5, 1 } , // Invalid parameter type ! { "S1106", 5, 1 } , // Fetch type out of range ! { "S1107", 5, 1 } , // Row value out of range ! { "S1108", 5, 1 } , // Concurrency option out of range ! { "S1109", 5, 1 } , // Invalid cursor position ! { "S1110", 5, 1 } , // Invalid driver completion ! { "S1111", 5, 1 } , // Invalid bookmark value ! { "S1C00", 1, 1 } , // Driver not capable ! { "S1T00", 1, 1 } // Timeout expired }; --- 1759,1853 ---- static odbcErrorDesc errorTable[] = { ! { "01000", 5, 0 }, /* General warning */ ! { "01002", 1, 1 }, /* Disconnect error */ ! { "01004", 0, 1 }, /* Data truncated */ ! { "01006", 5, 1 }, /* Privilege not revoked */ ! { "01S00", 2, 1 }, /* Invalid connection string attribute */ ! { "01S01", 5, 1 }, /* Error in row */ ! { "01S02", 5, 1 }, /* Option value changed */ ! { "01S03", 0, 1 }, /* No rows updated or deleted */ ! { "01S04", 0, 1 }, /* More than one row updated or deleted */ ! { "01S05", 0, 1 }, /* Cancel treated as SQLFreeStmt with the SQL_CLOSE */ ! { "01S06", 2, 1 }, /* Attempt to fetch before the result set returned */ ! { "07001", 2, 1 }, /* Wrong number of parameters */ ! { "07006", 2, 1 }, /* Restricted data type attribute violation */ ! { "07S01", 2, 1 }, /* Invalid use of default parameter */ ! { "08001", 1, 1 }, /* Unable to connect to data source */ ! { "08002", 1, 1 }, /* Connection in use */ ! { "08003", 1, 1 }, /* Connection not open */ ! { "08004", 1, 1 }, /* Data source rejected establishment of connection */ ! { "08007", 1, 1 }, /* Connection failure during transaction */ ! { "08S01", 1, 0 }, /* Communication link failure */ ! { "21S01", 2, 1 }, /* Insert value list does not match column list */ ! { "21S02", 2, 1 }, /* Degree of derived table does not match column list */ ! { "22001", 0, 1 }, /* String data right truncation */ ! { "22002", 5, 1 }, /* Indicator variable required but not supplied */ ! { "22003", 4, 1 }, /* Numeric value out of range */ ! { "22005", 4, 1 }, /* Error in assignment */ ! { "22008", 4, 1 }, /* Datetime field overflow */ ! { "22012", 4, 1 }, /* Division by zero */ ! { "22026", 4, 1 }, /* String data, length mismatch */ ! { "23000", 3, 1 }, /* Integrity constraint violation */ ! { "24000", 5, 1 }, /* Invalid cursor state */ ! { "25000", 5, 1 }, /* Invalid transaction state */ ! { "28000", 1, 1 }, /* Invalid authorization specification */ ! { "34000", 5, 1 }, /* Invalid cursor name */ ! { "37000", 2, 1 }, /* Syntax error or access violation */ ! { "3C000", 5, 1 }, /* Duplicate cursor name */ ! { "40001", 5, 1 }, /* Serialization failure */ ! { "42000", 2, 1 }, /* Syntax error or access violation */ ! { "70100", 1, 1 }, /* Operation aborted */ ! { "IM001", 1, 1 }, /* Driver does not support this function */ ! { "IM002", 1, 1 }, /* Data source name not found and no default driver */ ! { "IM003", 1, 1 }, /* Specified driver could not be loaded */ ! { "IM004", 1, 1 }, /* Driver's SQLAllocEnv failed */ ! { "IM005", 1, 1 }, /* Driver's SQLAllocConnect failed */ ! { "IM006", 1, 1 }, /* Driver's SQLSetConnect-Option failed */ ! { "IM007", 1, 1 }, /* No data source or driver specified; dialog prohibited */ ! { "IM008", 1, 1 }, /* Dialog failed */ ! { "IM009", 1, 1 }, /* Unable to load translation DLL */ ! { "IM010", 1, 1 }, /* Data source name too long */ ! { "IM011", 1, 1 }, /* Driver name too long */ ! { "IM012", 1, 1 }, /* DRIVER keyword syntax error */ ! { "IM013", 1, 1 }, /* Trace file error */ ! { "S0001", 2, 1 }, /* Base table or view already exists */ ! { "S0002", 2, 1 }, /* Base table not found */ ! { "S0011", 2, 1 }, /* Index already exists */ ! { "S0012", 2, 1 }, /* Index not found */ ! { "S0021", 2, 1 }, /* Column already exists */ ! { "S0022", 2, 1 }, /* Column not found */ ! { "S0023", 2, 1 }, /* No default for column */ ! { "S1000", 1, 1 }, /* General error */ ! { "S1001", 1, 1 }, /* Memory allocation failure */ ! { "S1002", 5, 1 }, /* Invalid column number */ ! { "S1003", 5, 1 }, /* Program type out of range */ ! { "S1004", 5, 1 }, /* SQL data type out of range */ ! { "S1008", 1, 1 }, /* Operation canceled */ ! { "S1009", 5, 1 }, /* Invalid argument value */ ! { "S1010", 5, 1 }, /* Function sequence error */ ! { "S1011", 5, 1 }, /* Operation invalid at this time */ ! { "S1012", 5, 1 }, /* Invalid transaction operation code specified */ ! { "S1015", 5, 1 }, /* No cursor name available */ ! { "S1090", 5, 1 }, /* Invalid string or buffer length */ ! { "S1091", 5, 1 }, /* Descriptor type out of range */ ! { "S1092", 5, 1 }, /* Option type out of range */ ! { "S1093", 5, 1 }, /* Invalid parameter number */ ! { "S1095", 5, 1 }, /* Function type out of range */ ! { "S1096", 5, 1 }, /* Information type out of range */ ! { "S1097", 5, 1 }, /* Column type out of range */ ! { "S1098", 5, 1 }, /* Scope type out of range */ ! { "S1099", 5, 1 }, /* Nullable type out of range */ ! { "S1100", 5, 1 }, /* Uniqueness option type out of range */ ! { "S1101", 5, 1 }, /* Accuracy option type out of range */ ! { "S1103", 5, 1 }, /* Direction option out of range */ ! { "S1105", 5, 1 }, /* Invalid parameter type */ ! { "S1106", 5, 1 }, /* Fetch type out of range */ ! { "S1107", 5, 1 }, /* Row value out of range */ ! { "S1108", 5, 1 }, /* Concurrency option out of range */ ! { "S1109", 5, 1 }, /* Invalid cursor position */ ! { "S1110", 5, 1 }, /* Invalid driver completion */ ! { "S1111", 5, 1 }, /* Invalid bookmark value */ ! { "S1C00", 1, 1 }, /* Driver not capable */ ! { "S1T00", 1, 1 } /* Timeout expired */ }; *************** *** 1871,1875 **** &key, errorTable, ! sizeof(errorTable)/ sizeof(odbcErrorDesc), // number of elems sizeof(odbcErrorDesc), odbcCompare); --- 1869,1873 ---- &key, errorTable, ! sizeof(errorTable)/ sizeof(odbcErrorDesc), /* number of elems */ sizeof(odbcErrorDesc), odbcCompare); |
|
From: Mark H. <mha...@us...> - 2004-07-13 04:47:24
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24290/com/win32com/src/extensions Added Files: PyICreateTypeLib2.cpp Log Message: Implement patch [ 982914 ] Support for CreateTypeLib2, contributed by Phil Rittenhouse. --- NEW FILE: PyICreateTypeLib2.cpp --- // This file implements the ICreateTypeLib2 Interface and Gateway for Python. // Generated by makegw.py #include "stdafx.h" #include "PythonCOM.h" #include "PythonCOMServer.h" #include "PyICreateTypeLib.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyICreateTypeLib2::PyICreateTypeLib2(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyICreateTypeLib2::~PyICreateTypeLib2() { } /* static */ ICreateTypeLib2 *PyICreateTypeLib2::GetI(PyObject *self) { return (ICreateTypeLib2 *)PyIUnknown::GetI(self); } // @pymethod |PyICreateTypeLib2|CreateTypeInfo|Description of CreateTypeInfo. PyObject *PyICreateTypeLib2::CreateTypeInfo(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm <o unicode>|szName||Description for szName long tkind; PyObject *obszName; LPOLESTR szName; ICreateTypeInfo * ppCTInfo; if ( !PyArg_ParseTuple(args, "Ol:CreateTypeInfo", &obszName, &tkind) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsBstr(obszName, &szName)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->CreateTypeInfo( szName, (TYPEKIND)tkind, &ppCTInfo ); PY_INTERFACE_POSTCALL; SysFreeString(szName); if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); return PyCom_PyObjectFromIUnknown(ppCTInfo, IID_ICreateTypeInfo, FALSE); } // @pymethod |PyICreateTypeLib2|SetName|Description of SetName. PyObject *PyICreateTypeLib2::SetName(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm <o unicode>|szName||Description for szName PyObject *obszName; LPOLESTR szName; if ( !PyArg_ParseTuple(args, "O:SetName", &obszName) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsBstr(obszName, &szName)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetName( szName ); PY_INTERFACE_POSTCALL; SysFreeString(szName); if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SetVersion|Description of SetVersion. PyObject *PyICreateTypeLib2::SetVersion(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm int|wMajorVerNum||Description for wMajorVerNum // @pyparm int|wMinorVerNum||Description for wMinorVerNum WORD wMajorVerNum; WORD wMinorVerNum; if ( !PyArg_ParseTuple(args, "ii:SetVersion", &wMajorVerNum, &wMinorVerNum) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetVersion( wMajorVerNum, wMinorVerNum ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SetGuid|Description of SetGuid. PyObject *PyICreateTypeLib2::SetGuid(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm <o PyIID>|guid||Description for guid PyObject *obguid; IID guid; if ( !PyArg_ParseTuple(args, "O:SetGuid", &obguid) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsIID(obguid, &guid)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetGuid( guid ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SetDocString|Description of SetDocString. PyObject *PyICreateTypeLib2::SetDocString(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm <o unicode>|szDoc||Description for szDoc PyObject *obszDoc; LPOLESTR szDoc; if ( !PyArg_ParseTuple(args, "O:SetDocString", &obszDoc) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsBstr(obszDoc, &szDoc)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetDocString( szDoc ); PY_INTERFACE_POSTCALL; SysFreeString(szDoc); if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SetHelpFileName|Description of SetHelpFileName. PyObject *PyICreateTypeLib2::SetHelpFileName(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm <o unicode>|szHelpFileName||Description for szHelpFileName PyObject *obszHelpFileName; LPOLESTR szHelpFileName; if ( !PyArg_ParseTuple(args, "O:SetHelpFileName", &obszHelpFileName) ) return NULL; BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsBstr(obszHelpFileName, &szHelpFileName)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetHelpFileName( szHelpFileName ); PY_INTERFACE_POSTCALL; SysFreeString(szHelpFileName); if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SetHelpContext|Description of SetHelpContext. PyObject *PyICreateTypeLib2::SetHelpContext(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm int|dwHelpContext||Description for dwHelpContext DWORD dwHelpContext; if ( !PyArg_ParseTuple(args, "l:SetHelpContext", &dwHelpContext) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetHelpContext( dwHelpContext ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SetLcid|Description of SetLcid. PyObject *PyICreateTypeLib2::SetLcid(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; long lcid; if ( !PyArg_ParseTuple(args, "l:SetLcid", &lcid) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetLcid( lcid ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SetLibFlags|Description of SetLibFlags. PyObject *PyICreateTypeLib2::SetLibFlags(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; // @pyparm int|uLibFlags||Description for uLibFlags UINT uLibFlags; if ( !PyArg_ParseTuple(args, "i:SetLibFlags", &uLibFlags) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SetLibFlags( uLibFlags ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyICreateTypeLib2|SaveAllChanges|Description of SaveAllChanges. PyObject *PyICreateTypeLib2::SaveAllChanges(PyObject *self, PyObject *args) { ICreateTypeLib2 *pICTL = GetI(self); if ( pICTL == NULL ) return NULL; if ( !PyArg_ParseTuple(args, ":SaveAllChanges") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICTL->SaveAllChanges( ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pICTL, IID_ICreateTypeLib2); Py_INCREF(Py_None); return Py_None; } // @object PyICreateTypeLib2|Description of the interface static struct PyMethodDef PyICreateTypeLib2_methods[] = { { "CreateTypeInfo", PyICreateTypeLib2::CreateTypeInfo, 1 }, // @pymeth CreateTypeInfo|Description of CreateTypeInfo { "SetName", PyICreateTypeLib2::SetName, 1 }, // @pymeth SetName|Description of SetName { "SetVersion", PyICreateTypeLib2::SetVersion, 1 }, // @pymeth SetVersion|Description of SetVersion { "SetGuid", PyICreateTypeLib2::SetGuid, 1 }, // @pymeth SetGuid|Description of SetGuid { "SetDocString", PyICreateTypeLib2::SetDocString, 1 }, // @pymeth SetDocString|Description of SetDocString { "SetHelpFileName", PyICreateTypeLib2::SetHelpFileName, 1 }, // @pymeth SetHelpFileName|Description of SetHelpFileName { "SetHelpContext", PyICreateTypeLib2::SetHelpContext, 1 }, // @pymeth SetHelpContext|Description of SetHelpContext { "SetLcid", PyICreateTypeLib2::SetLcid, 1 }, // @pymeth SetLcid|Description of SetLcid { "SetLibFlags", PyICreateTypeLib2::SetLibFlags, 1 }, // @pymeth SetLibFlags|Description of SetLibFlags { "SaveAllChanges", PyICreateTypeLib2::SaveAllChanges, 1 }, // @pymeth SaveAllChanges|Description of SaveAllChanges { NULL } }; PyComTypeObject PyICreateTypeLib2::type("PyICreateTypeLib2", &PyIUnknown::type, sizeof(PyICreateTypeLib2), PyICreateTypeLib2_methods, GET_PYCOM_CTOR(PyICreateTypeLib2)); |
|
From: Mark H. <mha...@us...> - 2004-07-13 04:47:24
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24290/com/win32com/src Modified Files: PythonCOM.cpp Register.cpp Log Message: Implement patch [ 982914 ] Support for CreateTypeLib2, contributed by Phil Rittenhouse. Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** PythonCOM.cpp 25 Apr 2004 04:07:47 -0000 1.30 --- PythonCOM.cpp 13 Jul 2004 04:47:15 -0000 1.31 *************** *** 1222,1225 **** --- 1222,1247 ---- } + + // @pymethod <o ICreateTypeLib2>|pythoncom|CreateTypeLib2|Provides access to a new object instance that supports the ICreateTypeLib2 interface. + static PyObject *pythoncom_CreateTypeLib2(PyObject *self, PyObject *args) + { + long syskind; + PyObject *obfname; + if (!PyArg_ParseTuple(args, "lO", &syskind, &obfname)) + return NULL; + BSTR fname; + if (!PyWinObject_AsBstr(obfname, &fname)) + return NULL; + ICreateTypeLib2 *pcti = NULL; + PY_INTERFACE_PRECALL; + HRESULT hr = CreateTypeLib2((SYSKIND)syskind, fname, &pcti); + PY_INTERFACE_POSTCALL; + PyWinObject_FreeBstr(fname); + if (FAILED(hr)) + return PyCom_BuildPyException(hr); + return PyCom_PyObjectFromIUnknown(pcti, IID_ICreateTypeLib2, FALSE); + } + + // @pymethod int|pythoncom|PumpWaitingMessages|Pumps all waiting messages for the current thread. // @comm It is sometimes necessary for a COM thread to have a message loop. This function *************** *** 1490,1493 **** --- 1512,1516 ---- { "CreatePointerMoniker", pythoncom_CreatePointerMoniker, 1 }, // @pymeth CreatePointerMoniker|Creates a pointer moniker based on a pointer to an object. { "CreateTypeLib", pythoncom_CreateTypeLib, 1}, // @pymeth CreateTypeLib|Provides access to a new object instance that supports the ICreateTypeLib interface. + { "CreateTypeLib2", pythoncom_CreateTypeLib2, 1}, // @pymeth CreateTypeLib2|Provides access to a new object instance that supports the ICreateTypeLib2 interface. #endif // MS_WINCE { "EnableQuitMessage", pythoncom_EnableQuitMessage, 1 }, // @pymeth EnableQuitMessage|Indicates the thread PythonCOM should post a WM_QUIT message to. Index: Register.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Register.cpp 22 Apr 2004 06:47:15 -0000 1.13 --- Register.cpp 13 Jul 2004 04:47:15 -0000 1.14 *************** *** 230,233 **** --- 230,234 ---- PYCOM_INTERFACE_CLIENT_ONLY( CreateTypeInfo), PYCOM_INTERFACE_CLIENT_ONLY( CreateTypeLib), + PYCOM_INTERFACE_CLIENT_ONLY( CreateTypeLib2), PYCOM_INTERFACE_FULL ( DataObject ), PYCOM_INTERFACE_FULL ( DropSource), |
|
From: Mark H. <mha...@us...> - 2004-07-13 04:47:24
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24290/com/win32com/src/include Modified Files: PyICreateTypeLib.h Log Message: Implement patch [ 982914 ] Support for CreateTypeLib2, contributed by Phil Rittenhouse. Index: PyICreateTypeLib.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyICreateTypeLib.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyICreateTypeLib.h 1 Sep 1999 23:04:13 -0000 1.1 --- PyICreateTypeLib.h 13 Jul 2004 04:47:16 -0000 1.2 *************** *** 28,29 **** --- 28,53 ---- ~PyICreateTypeLib(); }; + + class PyICreateTypeLib2 : public PyIUnknown + { + public: + MAKE_PYCOM_CTOR(PyICreateTypeLib2); + static ICreateTypeLib2 *GetI(PyObject *self); + static PyComTypeObject type; + + // The Python methods + static PyObject *CreateTypeInfo(PyObject *self, PyObject *args); + static PyObject *SetName(PyObject *self, PyObject *args); + static PyObject *SetVersion(PyObject *self, PyObject *args); + static PyObject *SetGuid(PyObject *self, PyObject *args); + static PyObject *SetDocString(PyObject *self, PyObject *args); + static PyObject *SetHelpFileName(PyObject *self, PyObject *args); + static PyObject *SetHelpContext(PyObject *self, PyObject *args); + static PyObject *SetLcid(PyObject *self, PyObject *args); + static PyObject *SetLibFlags(PyObject *self, PyObject *args); + static PyObject *SaveAllChanges(PyObject *self, PyObject *args); + + protected: + PyICreateTypeLib2(IUnknown *pdisp); + ~PyICreateTypeLib2(); + }; |
|
From: Mark H. <mha...@us...> - 2004-07-13 04:47:23
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24290/com Modified Files: win32com.dsp Log Message: Implement patch [ 982914 ] Support for CreateTypeLib2, contributed by Phil Rittenhouse. Index: win32com.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com.dsp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** win32com.dsp 9 Apr 2004 11:27:49 -0000 1.25 --- win32com.dsp 13 Jul 2004 04:47:15 -0000 1.26 *************** *** 279,282 **** --- 279,286 ---- # Begin Source File + SOURCE=.\win32com\src\extensions\PyICreateTypeLib2.cpp + # End Source File + # Begin Source File + SOURCE=.\win32com\src\extensions\PyIDataObject.cpp # End Source File |
|
From: Mark H. <mha...@us...> - 2004-07-13 04:44:55
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24018 Modified Files: setup_win32all.py Log Message: win32security doesn't need Secur32 - it loads it dynamically so things still work with NT. Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** setup_win32all.py 2 Jul 2004 04:20:50 -0000 1.23 --- setup_win32all.py 13 Jul 2004 04:44:45 -0000 1.24 *************** *** 716,720 **** ("win32process", "advapi32 user32", False, 0x0500), ("win32ras", "rasapi32 user32", False), ! ("win32security", "advapi32 user32 Secur32", True), ("win32service", "advapi32 oleaut32", True, 0x0500), ("win32trace", "advapi32", False), --- 716,720 ---- ("win32process", "advapi32 user32", False, 0x0500), ("win32ras", "rasapi32 user32", False), ! ("win32security", "advapi32 user32", True), ("win32service", "advapi32 oleaut32", True, 0x0500), ("win32trace", "advapi32", False), |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:23:55
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31683 Removed Files: build_for_version.bat removebuilt.bat set_for_version.py Log Message: Remove old batch files used pre distutils. --- removebuilt.bat DELETED --- --- set_for_version.py DELETED --- --- build_for_version.bat DELETED --- |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:22:06
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31504 Modified Files: pywin32_postinstall.py Log Message: Install a shortcut to the docs, handle 'non-admin' installs, and pull more tricks to work around our system dll issues. Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pywin32_postinstall.py 7 Feb 2004 10:03:54 -0000 1.10 --- pywin32_postinstall.py 2 Jul 2004 04:21:57 -0000 1.11 *************** *** 19,22 **** --- 19,25 ---- verbose = 1 + ver_string = "%d.%d" % (sys.version_info[0], sys.version_info[1]) + root_key_name = "Software\\Python\\PythonCore\\" + ver_string + try: # When this script is run from inside the bdist_wininst installer, *************** *** 31,50 **** def directory_created(directory): pass ! def AbortRetryIgnore(desc, func, *args): import win32api, win32con while 1: try: ! return func(*args) ! except: if silent: # Running silent mode - just re-raise the error. raise ! exc_type, exc_val, tb = sys.exc_info() tb = None full_desc = "Error %s\n\n" \ "If you have any Python applications running, " \ "please close them now\nand select 'Retry'\n\n%s" \ ! % (desc, exc_val) rc = win32api.MessageBox(0, full_desc, --- 34,65 ---- def directory_created(directory): pass + def get_root_hkey(): + try: + _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, + root_key_name, _winreg.KEY_CREATE_SUB_KEY) + return _winreg.HKEY_LOCAL_MACHINE + except OSError, details: + # Either not exist, or no permissions to create subkey means + # must be HKCU + return _winreg.HKEY_CURRENT_USER ! def CopyTo(desc, src, dest): import win32api, win32con while 1: try: ! win32api.CopyFile(src, dest, 0) ! return ! except win32api.error, details: ! if details[0]==5: # access denied - user not admin. ! raise if silent: # Running silent mode - just re-raise the error. raise ! err_msg = details[2] tb = None full_desc = "Error %s\n\n" \ "If you have any Python applications running, " \ "please close them now\nand select 'Retry'\n\n%s" \ ! % (desc, err_msg) rc = win32api.MessageBox(0, full_desc, *************** *** 54,68 **** raise elif rc == win32con.IDIGNORE: ! return None # else retry - around we go again. def SetPyKeyVal(key_name, value_name, value): ! ver_string = "%d.%d" % (sys.version_info[0], sys.version_info[1]) ! root_key_name = "Software\\Python\\PythonCore\\" + ver_string ! try: ! root_key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, root_key_name) ! except OSError: ! root_key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER_MACHINE, ! root_key_name) try: my_key = _winreg.CreateKey(root_key, key_name) --- 69,100 ---- raise elif rc == win32con.IDIGNORE: ! return # else retry - around we go again. + # We need to import win32api to determine the Windows system directory, + # so we can copy our system files there - but importing win32api will + # load the pywintypes.dll already in the system directory preventing us + # from updating them! + # So, we pull the same trick pywintypes.py does, but it loads from + # our pywintypes_system32 directory. + def LoadSystemModule(lib_dir, modname): + # See if this is a debug build. + import imp + for suffix_item in imp.get_suffixes(): + if suffix_item[0]=='_d.pyd': + suffix = '_d' + break + else: + suffix = "" + filename = "%s%d%d%s.dll" % \ + (modname, sys.version_info[0], sys.version_info[1], suffix) + filename = os.path.join(lib_dir, "pywin32_system32", filename) + mod = imp.load_module(modname, None, filename, + ('.dll', 'rb', imp.C_EXTENSION)) + + def SetPyKeyVal(key_name, value_name, value): ! root_hkey = get_root_hkey() ! root_key = _winreg.OpenKey(root_hkey, root_key_name) try: my_key = _winreg.CreateKey(root_key, key_name) *************** *** 93,96 **** --- 125,129 ---- def install(): import distutils.sysconfig + import traceback lib_dir = distutils.sysconfig.get_python_lib(plat_specific=1) fname = os.path.join(sys.prefix, "pywin32.pth") *************** *** 120,148 **** except WindowsError: pass ! # To be able to import win32api, PyWinTypesxx.dll must be on the PATH ! # We must be careful to use the one we just installed, not one already ! # in the system directory, otherwise we will not be able to copy the one ! # just installed into the system dir. ! os.environ["PATH"] = "%s;%s" % (os.path.join(lib_dir, "pywin32_system32"), os.environ["PATH"]) ! # importing pywintypes explicitly before win32api means our one in sys.path ! # is found, rather than whatever Windows implicitly finds as a side-effect ! # of importing win32api. ! import pywintypes import win32api # and now we can get the system directory: - sysdir = win32api.GetSystemDirectory() - # and copy some files over there files = glob.glob(os.path.join(lib_dir, "pywin32_system32\\*.*")) if not files: raise RuntimeError, "No system files to copy!!" ! for fname in files: ! base = os.path.basename(fname) ! dst = os.path.join(sysdir, base) ! if verbose: ! print "Copy %s to %s" % (base, sysdir) ! AbortRetryIgnore("installing %s" % base, ! shutil.copyfile, fname, dst) ! # Register the files with the uninstaller ! file_created(dst) # Pythonwin 'compiles' config files - record them for uninstall. pywin_dir = os.path.join(lib_dir, "Pythonwin", "pywin") --- 153,189 ---- except WindowsError: pass ! LoadSystemModule(lib_dir, "pywintypes") ! LoadSystemModule(lib_dir, "pythoncom") import win32api # and now we can get the system directory: files = glob.glob(os.path.join(lib_dir, "pywin32_system32\\*.*")) if not files: raise RuntimeError, "No system files to copy!!" ! # Try the system32 directory first - if that fails due to "access denied", ! # it implies a non-admin user, and we use sys.prefix ! for dest_dir in [win32api.GetSystemDirectory(), sys.prefix]: ! # and copy some files over there ! worked = 0 ! try: ! for fname in files: ! base = os.path.basename(fname) ! dst = os.path.join(dest_dir, base) ! CopyTo("installing %s" % base, fname, dst) ! if verbose: ! print "Copied %s to %s" % (base, dst) ! # Register the files with the uninstaller ! file_created(dst) ! worked = 1 ! if worked: ! break ! except win32api.error, details: ! if details[0]==5: ! # access denied - user not admin - try sys.prefix dir. ! continue ! raise ! else: ! raise RuntimeError, \ ! "You don't have enough permissions to install the system files" ! # Pythonwin 'compiles' config files - record them for uninstall. pywin_dir = os.path.join(lib_dir, "Pythonwin", "pywin") *************** *** 151,155 **** # Register our demo COM objects. ! RegisterCOMObjects() # Register the .chm help file. chm_file = os.path.join(lib_dir, "PyWin32.chm") --- 192,207 ---- # Register our demo COM objects. ! try: ! try: ! RegisterCOMObjects() ! except win32api.error, details: ! if details[0]!=5: # ERROR_ACCESS_DENIED ! raise ! print "You do not have the permissions to install COM objects." ! print "The sample COM objects were not registered." ! except: ! print "FAILED to register the Python COM objects" ! traceback.print_exc() ! # Register the .chm help file. chm_file = os.path.join(lib_dir, "PyWin32.chm") *************** *** 177,198 **** try: # use bdist_wininst builtins to create a shortcut. ! try: ! # CSIDL_COMMON_PROGRAMS only available works on NT/2000/XP: ! fldr = get_special_folder_path("CSIDL_COMMON_PROGRAMS") ! except OSError: ! # CSIDL_PROGRAMS should work on Win 98 fldr = get_special_folder_path("CSIDL_PROGRAMS") ! dst = os.path.join(fldr, "Python %d.%d\\PythonWin.lnk" % \ ! (sys.version_info[0], sys.version_info[1])) create_shortcut(os.path.join(lib_dir, "Pythonwin\\Pythonwin.exe"), ! "The Pythonwin IDE", ! dst) file_created(dst) except Exception, details: if verbose: print details - else: - if verbose: - print "Shortcut for Pythonwin created" print "The pywin32 extensions were successfully installed." --- 229,265 ---- try: # use bdist_wininst builtins to create a shortcut. ! # CSIDL_COMMON_PROGRAMS only available works on NT/2000/XP, and ! # will fail there if the user has no admin rights. ! if get_root_hkey()==_winreg.HKEY_LOCAL_MACHINE: ! try: ! fldr = get_special_folder_path("CSIDL_COMMON_PROGRAMS") ! except OSError: ! # No CSIDL_COMMON_PROGRAMS on this platform ! fldr = get_special_folder_path("CSIDL_PROGRAMS") ! else: ! # non-admin install - always goes in this user's start menu. fldr = get_special_folder_path("CSIDL_PROGRAMS") ! ! vi = sys.version_info ! fldr = os.path.join(fldr, "Python %d.%d" % (vi[0], vi[1])) ! if not os.path.isdir(fldr): ! os.mkdir(fldr) ! ! dst = os.path.join(fldr, "PythonWin.lnk") create_shortcut(os.path.join(lib_dir, "Pythonwin\\Pythonwin.exe"), ! "The Pythonwin IDE", dst, "", sys.prefix) ! file_created(dst) ! if verbose: ! print "Shortcut for Pythonwin created" ! # And the docs. ! dst = os.path.join(fldr, "Python for Windows Documentation.lnk") ! doc = "Documentation for the PyWin32 extensions" ! create_shortcut(chm_file, doc, dst) file_created(dst) + if verbose: + print "Shortcut to documentation created" except Exception, details: if verbose: print details print "The pywin32 extensions were successfully installed." *************** *** 250,254 **** verbose = 0 elif arg == "-remove": ! break # we do nothing for now else: print "Unknown option:", arg --- 317,323 ---- verbose = 0 elif arg == "-remove": ! # Nothing to do here - we can't unregister much, as we have ! # already been uninstalled. ! pass else: print "Unknown option:", arg |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:20:59
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31427 Modified Files: setup_win32all.py Log Message: Build 202 Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** setup_win32all.py 22 Jun 2004 00:54:47 -0000 1.22 --- setup_win32all.py 2 Jul 2004 04:20:50 -0000 1.23 *************** *** 1,3 **** ! build_number=201 """distutils setup-script for win32all --- 1,3 ---- ! build_number=202 """distutils setup-script for win32all *************** *** 968,972 **** scripts = ["pywin32_postinstall.py"], ! ext_modules = win32_extensions + com_extensions + pythonwin_extensions, --- 968,972 ---- scripts = ["pywin32_postinstall.py"], ! ext_modules = win32_extensions + com_extensions + pythonwin_extensions, |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:17:18
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30904 Added Files: shellexecuteex.py Log Message: Simple demo of ShellExecuteEx --- NEW FILE: shellexecuteex.py --- from win32com.shell import shell, shellcon import win32con def ExplorePIDL(): pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP) print "The desktop is at", shell.SHGetPathFromIDList(pidl) shell.ShellExecuteEx(fMask=shellcon.SEE_MASK_NOCLOSEPROCESS, nShow=win32con.SW_NORMAL, lpClass="folder", lpVerb="explore", lpIDList=pidl) print "Done!" if __name__=='__main__': ExplorePIDL() |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:14:13
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30406 Modified Files: shell.dsp Log Message: Add PyIAsyncOperation files. Index: shell.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/shell.dsp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shell.dsp 9 Apr 2004 11:29:37 -0000 1.10 --- shell.dsp 2 Jul 2004 04:14:02 -0000 1.11 *************** *** 95,98 **** --- 95,102 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyIAsyncOperation.cpp + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\PyIBrowserFrameOptions.cpp # End Source File *************** *** 155,158 **** --- 159,166 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyIAsyncOperation.h + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\PyIBrowserFrameOptions.h # End Source File |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:13:24
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30326 Modified Files: shellcon.py Log Message: New FD_ constants. Index: shellcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/shellcon.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shellcon.py 25 Apr 2004 03:59:41 -0000 1.11 --- shellcon.py 2 Jul 2004 04:13:13 -0000 1.12 *************** *** 871,872 **** --- 871,882 ---- SHCNRF_RecursiveInterrupt = 4096 SHCNRF_NewDelivery = 32768 + + FD_CLSID = 0x0001 + FD_SIZEPOINT = 0x0002 + FD_ATTRIBUTES = 0x0004 + FD_CREATETIME = 0x0008 + FD_ACCESSTIME = 0x0010 + FD_WRITESTIME = 0x0020 + FD_FILESIZE = 0x0040 + FD_PROGRESSUI = 0x4000 + FD_LINKUI = 0x8000 |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:11:54
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30105 Modified Files: shell.cpp Added Files: PyIAsyncOperation.cpp PyIAsyncOperation.h Log Message: Add IAsyncOperation --- NEW FILE: PyIAsyncOperation.h --- // This file declares the IAsyncOperation Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIAsyncOperation : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIAsyncOperation); static IAsyncOperation *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *SetAsyncMode(PyObject *self, PyObject *args); static PyObject *GetAsyncMode(PyObject *self, PyObject *args); static PyObject *StartOperation(PyObject *self, PyObject *args); static PyObject *InOperation(PyObject *self, PyObject *args); static PyObject *EndOperation(PyObject *self, PyObject *args); protected: PyIAsyncOperation(IUnknown *pdisp); ~PyIAsyncOperation(); }; // --------------------------------------------------- // // Gateway Declaration class PyGAsyncOperation : public PyGatewayBase, public IAsyncOperation { protected: PyGAsyncOperation(PyObject *instance) : PyGatewayBase(instance) { ; } PYGATEWAY_MAKE_SUPPORT2(PyGAsyncOperation, IAsyncOperation, IID_IAsyncOperation, PyGatewayBase) // IAsyncOperation STDMETHOD(SetAsyncMode)( BOOL fDoOpAsync); STDMETHOD(GetAsyncMode)( BOOL * pfIsOpAsync); STDMETHOD(StartOperation)( IBindCtx * pbcReserved); STDMETHOD(InOperation)( BOOL * pfInAsyncOp); STDMETHOD(EndOperation)( HRESULT hResult, IBindCtx * pbcReserved, DWORD dwEffects); }; --- NEW FILE: PyIAsyncOperation.cpp --- // This file implements the IAsyncOperation Interface and Gateway for Python. // Generated by makegw.py #include "shell_pch.h" #include "PyIAsyncOperation.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIAsyncOperation::PyIAsyncOperation(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIAsyncOperation::~PyIAsyncOperation() { } /* static */ IAsyncOperation *PyIAsyncOperation::GetI(PyObject *self) { return (IAsyncOperation *)PyIUnknown::GetI(self); } // @pymethod |PyIAsyncOperation|SetAsyncMode|Description of SetAsyncMode. PyObject *PyIAsyncOperation::SetAsyncMode(PyObject *self, PyObject *args) { IAsyncOperation *pIAO = GetI(self); if ( pIAO == NULL ) return NULL; // @pyparm int|fDoOpAsync||Description for fDoOpAsync BOOL fDoOpAsync; if ( !PyArg_ParseTuple(args, "i:SetAsyncMode", &fDoOpAsync) ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAO->SetAsyncMode( fDoOpAsync ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAO, IID_IAsyncOperation ); Py_INCREF(Py_None); return Py_None; } // @pymethod bool|PyIAsyncOperation|GetAsyncMode|Description of GetAsyncMode. PyObject *PyIAsyncOperation::GetAsyncMode(PyObject *self, PyObject *args) { IAsyncOperation *pIAO = GetI(self); if ( pIAO == NULL ) return NULL; BOOL fIsOpAsync; if ( !PyArg_ParseTuple(args, ":GetAsyncMode") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAO->GetAsyncMode( &fIsOpAsync ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAO, IID_IAsyncOperation ); PyObject *rc = fIsOpAsync ? Py_True : Py_False; return rc; } // @pymethod |PyIAsyncOperation|StartOperation|Description of StartOperation. PyObject *PyIAsyncOperation::StartOperation(PyObject *self, PyObject *args) { IAsyncOperation *pIAO = GetI(self); if ( pIAO == NULL ) return NULL; // @pyparm <o PyIBindCtx *>|pbcReserved||Description for pbcReserved PyObject *obpbcReserved; IBindCtx *pbcReserved; if ( !PyArg_ParseTuple(args, "O:StartOperation", &obpbcReserved) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpbcReserved, IID_IBindCtx, (void **)&pbcReserved, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAO->StartOperation( pbcReserved ); if (pbcReserved) pbcReserved->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAO, IID_IAsyncOperation ); Py_INCREF(Py_None); return Py_None; } // @pymethod |PyIAsyncOperation|InOperation|Description of InOperation. PyObject *PyIAsyncOperation::InOperation(PyObject *self, PyObject *args) { IAsyncOperation *pIAO = GetI(self); if ( pIAO == NULL ) return NULL; BOOL fInAsyncOp; if ( !PyArg_ParseTuple(args, ":InOperation") ) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAO->InOperation( &fInAsyncOp ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAO, IID_IAsyncOperation ); PyObject *rc = fInAsyncOp ? Py_True : Py_False; return rc; } // @pymethod |PyIAsyncOperation|EndOperation|Description of EndOperation. PyObject *PyIAsyncOperation::EndOperation(PyObject *self, PyObject *args) { IAsyncOperation *pIAO = GetI(self); if ( pIAO == NULL ) return NULL; // @pyparm int|hResult||Description for hResult // @pyparm <o PyIBindCtx *>|pbcReserved||Description for pbcReserved // @pyparm int|dwEffects||Description for dwEffects PyObject *obpbcReserved; HRESULT hResult; IBindCtx * pbcReserved; DWORD dwEffects; if ( !PyArg_ParseTuple(args, "lOl:EndOperation", &hResult, &obpbcReserved, &dwEffects) ) return NULL; BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpbcReserved, IID_IBindCtx, (void **)&pbcReserved, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIAO->EndOperation( hResult, pbcReserved, dwEffects ); if (pbcReserved) pbcReserved->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIAO, IID_IAsyncOperation ); Py_INCREF(Py_None); return Py_None; } // @object PyIAsyncOperation|Description of the interface static struct PyMethodDef PyIAsyncOperation_methods[] = { { "SetAsyncMode", PyIAsyncOperation::SetAsyncMode, 1 }, // @pymeth SetAsyncMode|Description of SetAsyncMode { "GetAsyncMode", PyIAsyncOperation::GetAsyncMode, 1 }, // @pymeth GetAsyncMode|Description of GetAsyncMode { "StartOperation", PyIAsyncOperation::StartOperation, 1 }, // @pymeth StartOperation|Description of StartOperation { "InOperation", PyIAsyncOperation::InOperation, 1 }, // @pymeth InOperation|Description of InOperation { "EndOperation", PyIAsyncOperation::EndOperation, 1 }, // @pymeth EndOperation|Description of EndOperation { NULL } }; PyComTypeObject PyIAsyncOperation::type("PyIAsyncOperation", &PyIUnknown::type, sizeof(PyIAsyncOperation), PyIAsyncOperation_methods, GET_PYCOM_CTOR(PyIAsyncOperation)); // --------------------------------------------------- // // Gateway Implementation STDMETHODIMP PyGAsyncOperation::SetAsyncMode( /* [in] */ BOOL fDoOpAsync) { PY_GATEWAY_METHOD; HRESULT hr=InvokeViaPolicy("SetAsyncMode", NULL, "i", fDoOpAsync); return hr; } STDMETHODIMP PyGAsyncOperation::GetAsyncMode( /* [out] */ BOOL * pfIsOpAsync) { if (!pfIsOpAsync) return E_POINTER; PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("GetAsyncMode", &result); if (FAILED(hr)) return hr; if (!PyInt_Check(result)) { PyErr_Format(PyExc_TypeError, "Result for GetAsyncMode must be a bool (got '%s')", result->ob_type->tp_name); hr = PyCom_HandlePythonFailureToCOM(); } else // NOTE: MSDN says "VARIANT_TRUE/VARIANT_FALSE, but fails to work! *pfIsOpAsync = PyInt_AsLong(result) ? TRUE : FALSE; Py_DECREF(result); return hr; } STDMETHODIMP PyGAsyncOperation::StartOperation( /* [optional][unique][in] */ IBindCtx * pbcReserved) { PY_GATEWAY_METHOD; PyObject *obpbcReserved; obpbcReserved = PyCom_PyObjectFromIUnknown(pbcReserved, IID_IBindCtx, TRUE); HRESULT hr=InvokeViaPolicy("StartOperation", NULL, "O", obpbcReserved); Py_XDECREF(obpbcReserved); return hr; } STDMETHODIMP PyGAsyncOperation::InOperation( /* [out] */ BOOL * pfInAsyncOp) { if (!pfInAsyncOp) return E_POINTER; PY_GATEWAY_METHOD; PyObject *result; HRESULT hr=InvokeViaPolicy("InOperation", &result); if (FAILED(hr)) return hr; if (!PyInt_Check(result)) { PyErr_Format(PyExc_TypeError, "Result for InOperation must be a bool (got '%s')", result->ob_type->tp_name); hr = PyCom_HandlePythonFailureToCOM(); } else // NOTE: MSDN says "VARIANT_TRUE/VARIANT_FALSE, but fails to work! *pfInAsyncOp = PyInt_AsLong(result) ? TRUE : FALSE; Py_DECREF(result); return hr; } STDMETHODIMP PyGAsyncOperation::EndOperation( /* [in] */ HRESULT hResult, /* [unique][in] */ IBindCtx * pbcReserved, /* [in] */ DWORD dwEffects) { PY_GATEWAY_METHOD; PyObject *obpbcReserved; obpbcReserved = PyCom_PyObjectFromIUnknown(pbcReserved, IID_IBindCtx, TRUE); HRESULT hr=InvokeViaPolicy("EndOperation", NULL, "lOl", hResult, obpbcReserved, dwEffects); Py_XDECREF(obpbcReserved); return hr; } Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** shell.cpp 12 Jun 2004 13:27:35 -0000 1.27 --- shell.cpp 2 Jul 2004 04:11:44 -0000 1.28 *************** *** 29,32 **** --- 29,33 ---- #include "PyIColumnProvider.h" #include "PyIDropTargetHelper.h" + #include "PyIAsyncOperation.h" #include "PythonCOMRegister.h" // For simpler registration of IIDs etc. *************** *** 402,406 **** { PyObject *obVerb; ! if (!PyArg_ParseTuple(ob, "iiOzziii", &pci->fMask, &pci->hwnd, &obVerb, &pci->lpParameters, &pci->lpDirectory, &pci->nShow, &pci->dwHotKey, &pci->hIcon)) --- 403,407 ---- { PyObject *obVerb; ! if (!PyArg_ParseTuple(ob, "iiOzziii:CMINVOKECOMMANDINFO tuple", &pci->fMask, &pci->hwnd, &obVerb, &pci->lpParameters, &pci->lpDirectory, &pci->nShow, &pci->dwHotKey, &pci->hIcon)) *************** *** 810,813 **** --- 811,816 ---- } + #if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ + // Callback for BrowseForFolder struct PyCallback { *************** *** 816,819 **** --- 819,823 ---- }; + static int CALLBACK PyBrowseCallbackProc( HWND hwnd, *************** *** 850,853 **** --- 854,858 ---- } + #endif // PY_VERSION_HEX ////////////////////////////////////////////////////////////// // *************** *** 868,872 **** --- 873,879 ---- bi.pszDisplayName = retPath; LPITEMIDLIST pl = NULL; + #if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ PyCallback pycb; + #endif if(!PyArg_ParseTuple(args, "|lOOlOO:SHBrowseForFolder", *************** *** 880,883 **** --- 887,891 ---- 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"); *************** *** 888,891 **** --- 896,905 ---- 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)) *************** *** 1964,1967 **** --- 1978,1982 ---- PYCOM_INTERFACE_CLSID_ONLY (ShellLink), PYCOM_INTERFACE_IID_ONLY (ShellLinkW), + PYCOM_INTERFACE_FULL(AsyncOperation), PYCOM_INTERFACE_FULL(ContextMenu), PYCOM_INTERFACE_FULL(ExtractIcon), |
|
From: Mark H. <mha...@us...> - 2004-07-02 04:11:04
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29756 Modified Files: PyIShellFolder.cpp Log Message: Default value for ParseDisplayName attributes param should be 0, not -1 Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyIShellFolder.cpp 26 May 2004 09:37:10 -0000 1.7 --- PyIShellFolder.cpp 2 Jul 2004 04:10:53 -0000 1.8 *************** *** 46,50 **** ULONG pchEaten = (ULONG)-1; ITEMIDLIST *ppidl; ! ULONG pdwAttributes = -1; if ( !PyArg_ParseTuple(args, "lOO|l:ParseDisplayName", &hwndOwner, &obpbcReserved, &oblpszDisplayName, &pdwAttributes) ) --- 46,50 ---- ULONG pchEaten = (ULONG)-1; ITEMIDLIST *ppidl; ! ULONG pdwAttributes = 0; if ( !PyArg_ParseTuple(args, "lOO|l:ParseDisplayName", &hwndOwner, &obpbcReserved, &oblpszDisplayName, &pdwAttributes) ) |