pywin32-checkins Mailing List for Python for Windows Extensions (Page 127)
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-09-09 08:57:24
|
Update of /cvsroot/pywin32/pywin32/pyisapi/isapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32054 Modified Files: threaded_extension.py Log Message: remove second import of the sys module. Index: threaded_extension.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/threaded_extension.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** threaded_extension.py 9 Sep 2004 08:56:14 -0000 1.3 --- threaded_extension.py 9 Sep 2004 08:57:15 -0000 1.4 *************** *** 22,26 **** import threading import traceback - import sys ISAPI_REQUEST = 1 --- 22,25 ---- |
|
From: Mark H. <mha...@us...> - 2004-09-09 08:56:22
|
Update of /cvsroot/pywin32/pywin32/pyisapi/isapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31859 Modified Files: threaded_extension.py Log Message: ISAPI changes the C locale, and this screws Python 2.3 and earlier - reset it Index: threaded_extension.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/threaded_extension.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** threaded_extension.py 4 Sep 2004 09:36:49 -0000 1.2 --- threaded_extension.py 9 Sep 2004 08:56:14 -0000 1.3 *************** *** 1,2 **** --- 1,6 ---- + """An ISAPI extension base class implemented using a thread-pool.""" + # $Id$ + + import sys from isapi import isapicon import isapi.simple *************** *** 7,10 **** --- 11,23 ---- 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 |
|
From: Mark H. <mha...@us...> - 2004-09-09 06:53:12
|
Update of /cvsroot/pywin32/pywin32/pyisapi/isapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11400 Modified Files: install.py Log Message: Brand new websites may not already have a "Filters" collection - create it in that case. Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/install.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** install.py 7 Sep 2004 02:20:43 -0000 1.4 --- install.py 9 Sep 2004 06:52:47 -0000 1.5 *************** *** 208,212 **** server = FindWebServer(options, filterParams.Server) _CallHook(filterParams, "PreInstall", options) ! filters = GetObject(server+"/Filters") try: newFilter = filters.Create(_IIS_FILTER, filterParams.Name) --- 208,223 ---- server = FindWebServer(options, filterParams.Server) _CallHook(filterParams, "PreInstall", options) ! try: ! filters = GetObject(server+"/Filters") ! except pythoncom.com_error, (hr, msg, exc, arg): ! # Brand new sites don't have the '/Filters' collection - create it. ! # Any errors other than 'not found' we shouldn't ignore. ! if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32 or \ ! winerror.HRESULT_CODE(hr) != winerror.ERROR_PATH_NOT_FOUND: ! raise ! server_ob = GetObject(server) ! filters = server_ob.Create(_IIS_FILTERS, "Filters") ! filters.FilterLoadOrder = "" ! filters.SetInfo() try: newFilter = filters.Create(_IIS_FILTER, filterParams.Name) |
|
From: Mark H. <mha...@us...> - 2004-09-09 06:09:22
|
Update of /cvsroot/pywin32/pywin32/pyisapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4565 Modified Files: ControlBlock.h PyExtensionObjects.cpp Log Message: Make DoneWithSession take the same args as HSE_REQ_DONE_WITH_SESSION Index: ControlBlock.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/src/ControlBlock.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ControlBlock.h 1 Sep 2004 03:07:12 -0000 1.1 --- ControlBlock.h 9 Sep 2004 06:09:03 -0000 1.2 *************** *** 82,91 **** } ! void SignalAsyncRequestDone(const bool bKeepAlive=true) { // Let IIS know that this worker thread is done with this request. This will allow // IIS to recycle the EXTENSION_CONTROL_BLOCK. - DWORD dwState = (bKeepAlive) ? HSE_STATUS_SUCCESS_AND_KEEP_CONN : HSE_STATUS_SUCCESS; m_pECB->ServerSupportFunction(m_pECB->ConnID, HSE_REQ_DONE_WITH_SESSION, &dwState, NULL, 0); } --- 82,90 ---- } ! void DoneWithSession(DWORD dwState) { // Let IIS know that this worker thread is done with this request. This will allow // IIS to recycle the EXTENSION_CONTROL_BLOCK. m_pECB->ServerSupportFunction(m_pECB->ConnID, HSE_REQ_DONE_WITH_SESSION, &dwState, NULL, 0); } Index: PyExtensionObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/src/PyExtensionObjects.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyExtensionObjects.cpp 9 Sep 2004 00:22:28 -0000 1.3 --- PyExtensionObjects.cpp 9 Sep 2004 06:09:11 -0000 1.4 *************** *** 145,148 **** --- 145,149 ---- {"ReadClient", PyECB::ReadClient, 1}, // @pymeth ReadClient| {"SendResponseHeaders", PyECB::SendResponseHeaders, 1}, // @pymeth SendResponseHeaders| + {"DoneWithSession", PyECB::DoneWithSession, 1}, // @pymeth DoneWithSession| {"close", PyECB::DoneWithSession, 1}, // @pymeth close|A synonym for DoneWithSession. *************** *** 499,517 **** PyObject * PyECB::DoneWithSession(PyObject *self, PyObject * args) { ! BOOL bRes = FALSE; ! int bKeepAlive = 0; ! PyECB * pecb = (PyECB *) self; ! if (!PyArg_ParseTuple(args, "|i:DoneWithSession", &bKeepAlive)) return NULL; if (pecb->m_pcb){ Py_BEGIN_ALLOW_THREADS ! pecb->m_pcb->SignalAsyncRequestDone((bKeepAlive!=0)?true:false); pecb->m_bAsyncDone = true; Py_END_ALLOW_THREADS } - Py_INCREF(Py_None); return Py_None; --- 500,517 ---- PyObject * PyECB::DoneWithSession(PyObject *self, PyObject * args) { ! DWORD status = HSE_STATUS_SUCCESS; PyECB * pecb = (PyECB *) self; ! // @pyparm int|status|HSE_STATUS_SUCCESS|An optional status. ! // HSE_STATUS_SUCCESS_AND_KEEP_CONN is supported by IIS to keep the connection alive. ! if (!PyArg_ParseTuple(args, "|i:DoneWithSession", &status)) return NULL; if (pecb->m_pcb){ Py_BEGIN_ALLOW_THREADS ! pecb->m_pcb->DoneWithSession(status); pecb->m_bAsyncDone = true; Py_END_ALLOW_THREADS } Py_INCREF(Py_None); return Py_None; |
|
From: Mark H. <mha...@us...> - 2004-09-09 01:21:05
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28961 Modified Files: win32trace.cpp Log Message: Explicitly create the events in the "Global" namespace, so win32trace works when used in conjunction with Terminal Services. Index: win32trace.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32trace.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32trace.cpp 13 May 2004 14:14:53 -0000 1.11 --- win32trace.cpp 9 Sep 2004 01:20:52 -0000 1.12 *************** *** 41,48 **** const size_t BUFFER_SIZE = 0x20000; // Includes size integer. ! const char *MAP_OBJECT_NAME = "PythonTraceOutputMapping"; ! const char *MUTEX_OBJECT_NAME = "PythonTraceOutputMutex"; ! const char *EVENT_OBJECT_NAME = "PythonTraceOutputEvent"; ! const char *EVENT_EMPTY_OBJECT_NAME = "PythonTraceOutputEmptyEvent"; // no const because of python api, this is the name of the entry --- 41,48 ---- const size_t BUFFER_SIZE = 0x20000; // Includes size integer. ! const char *MAP_OBJECT_NAME = "Global\\PythonTraceOutputMapping"; ! const char *MUTEX_OBJECT_NAME = "Global\\PythonTraceOutputMutex"; ! const char *EVENT_OBJECT_NAME = "Global\\PythonTraceOutputEvent"; ! const char *EVENT_EMPTY_OBJECT_NAME = "Global\\PythonTraceOutputEmptyEvent"; // no const because of python api, this is the name of the entry |
|
From: Mark H. <mha...@us...> - 2004-09-09 00:22:39
|
Update of /cvsroot/pywin32/pywin32/pyisapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20443 Modified Files: PyExtensionObjects.cpp PyFilterObjects.cpp Log Message: Rename the main objects passed to the filter/extension to match the Win32 structure names, and add the skeleton of autoduck for all properties and methods. Index: PyExtensionObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/src/PyExtensionObjects.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyExtensionObjects.cpp 4 Sep 2004 09:25:49 -0000 1.2 --- PyExtensionObjects.cpp 9 Sep 2004 00:22:28 -0000 1.3 *************** *** 28,37 **** #include "PyExtensionObjects.h" ! PyTypeObject PyVERSION_INFOType = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "PyVERSION_INFO", sizeof(PyVERSION_INFO), 0, --- 28,38 ---- #include "PyExtensionObjects.h" ! // @doc ! // @object HSE_VERSION_INFO|An object used by ISAPI GetExtensionVersion PyTypeObject PyVERSION_INFOType = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "HSE_VERSION_INFO", sizeof(PyVERSION_INFO), 0, *************** *** 84,87 **** --- 85,89 ---- return -1; } + // @prop string|ExtensionDesc|The description of the extension. else if (strcmp(name, "ExtensionDesc")==0) { if (!PyString_Check(v)) { *************** *** 116,120 **** #define ECBOFF(e) offsetof(PyECB, e) ! struct memberlist PyECB::PyECB_memberlist[] = { {"Version", T_INT, ECBOFF(m_version), READONLY}, --- 118,123 ---- #define ECBOFF(e) offsetof(PyECB, e) ! // @object EXTENSION_CONTROL_BLOCK|A python representation of an ISAPI ! // EXTENSION_CONTROL_BLOCK. struct memberlist PyECB::PyECB_memberlist[] = { {"Version", T_INT, ECBOFF(m_version), READONLY}, *************** *** 133,137 **** {"HttpStatusCode", T_INT, ECBOFF(m_HttpStatusCode)}, {"LogData", T_OBJECT, ECBOFF(m_logData)}, - {NULL} }; --- 136,139 ---- *************** *** 142,151 **** {"GetServerVariable", PyECB::GetServerVariable, 1}, // @pymeth GetServerVariable| {"ReadClient", PyECB::ReadClient, 1}, // @pymeth ReadClient| ! {"SendResponseHeaders", PyECB::SendResponseHeaders, 1}, ! {"DoneWithSession", PyECB::DoneWithSession, 1}, ! {"close", PyECB::DoneWithSession, 1}, // @pymeth close|A synonym for DoneWithSession. ! {"IsSessionActive", PyECB::IsSessionActive,1}, ! {"Redirect", PyECB::Redirect,1}, ! {"IsKeepAlive", PyECB::IsKeepAlive,1}, {"GetImpersonationToken", PyECB::GetImpersonationToken, 1}, // @pymeth GetImpersonationToken| {NULL} --- 144,153 ---- {"GetServerVariable", PyECB::GetServerVariable, 1}, // @pymeth GetServerVariable| {"ReadClient", PyECB::ReadClient, 1}, // @pymeth ReadClient| ! {"SendResponseHeaders", PyECB::SendResponseHeaders, 1}, // @pymeth SendResponseHeaders| ! {"DoneWithSession", PyECB::DoneWithSession, 1}, // @pymeth DoneWithSession| ! {"close", PyECB::DoneWithSession, 1}, // @pymeth close|A synonym for DoneWithSession. ! {"IsSessionActive", PyECB::IsSessionActive,1}, // @pymeth IsSessionActive|Indicates if DoneWithSession has been called ! {"Redirect", PyECB::Redirect,1}, // @pymeth Redirect| ! {"IsKeepAlive", PyECB::IsKeepAlive,1}, // @pymeth IsKeepAlive| {"GetImpersonationToken", PyECB::GetImpersonationToken, 1}, // @pymeth GetImpersonationToken| {NULL} *************** *** 156,160 **** PyObject_HEAD_INIT(&PyType_Type) 0, ! "PyECB", sizeof(PyECB), 0, --- 158,162 ---- PyObject_HEAD_INIT(&PyType_Type) 0, ! "EXTENSION_CONTROL_BLOCK", sizeof(PyECB), 0, *************** *** 175,193 **** PyECB::PyECB(CControlBlock * pcb): ! m_version(0), // Version info of this spec ! m_connID(0), // Context number not to be modified! ! m_method(NULL), // REQUEST_METHOD ! m_queryString(NULL), // QUERY_STRING ! m_pathInfo(NULL), // PATH_INFO ! m_pathTranslated(NULL), // PATH_TRANSLATED ! m_totalBytes(0), // Total bytes indicated from client ! m_available(0), // Available number of bytes ! m_data(NULL), // Pointer to cbAvailable bytes ! m_contentType(NULL), // Content type of client data ! m_HttpStatusCode(0), // The status of the current transaction when the request is completed. ! m_logData(NULL), // log data string m_bAsyncDone(false) // async done { --- 177,197 ---- PyECB::PyECB(CControlBlock * pcb): ! ! m_version(0), // @prop integer|Version|Version info of this spec (read-only) ! m_connID(0), // @prop integer|ConnID|Context number (read-only) ! m_method(NULL), // @prop string|Method|REQUEST_METHOD ! m_queryString(NULL), // @prop string|QueryString|QUERY_STRING ! m_pathInfo(NULL), // @prop string|PathInfo|PATH_INFO ! m_pathTranslated(NULL), // @prop string|PathTranslated|PATH_TRANSLATED ! m_totalBytes(0), // @prop int|TotalBytes|Total bytes indicated from client ! m_available(0), // @prop int|AvailableBytes|Available number of bytes ! m_data(NULL), // @prop string|AvailableData|Pointer to cbAvailable bytes ! m_contentType(NULL), // @prop string|ContentType|Content type of client data ! m_HttpStatusCode(0), // @prop int|HttpStatusCode|The status of the current transaction when the request is completed. ! m_logData(NULL), // @prop string|LogData|log data string ! m_bAsyncDone(false) // async done { *************** *** 290,293 **** --- 294,298 ---- + // @pymethod |EXTENSION_CONTROL_BLOCK|WriteClient| PyObject * PyECB::WriteClient(PyObject *self, PyObject *args) { *************** *** 298,302 **** PyECB * pecb = (PyECB *) self; ! if (!PyArg_ParseTuple(args, "s#|l:WriteClient", &buffer, &buffLen, &reserved)) return NULL; --- 303,308 ---- PyECB * pecb = (PyECB *) self; ! // @pyparm string/buffer|data||The data to write ! // @pyparm int|reserved|0| if (!PyArg_ParseTuple(args, "s#|l:WriteClient", &buffer, &buffLen, &reserved)) return NULL; *************** *** 314,317 **** --- 320,324 ---- } + // @pymethod string|EXTENSION_CONTROL_BLOCK|GetServerVariable| PyObject * PyECB::GetServerVariable(PyObject *self, PyObject *args) { *************** *** 320,324 **** PyECB * pecb = (PyECB *) self; ! if (!PyArg_ParseTuple(args, "s:GetServerVariable", &variable)) return NULL; --- 327,331 ---- PyECB * pecb = (PyECB *) self; ! // @pyparm string|variable|| if (!PyArg_ParseTuple(args, "s:GetServerVariable", &variable)) return NULL; *************** *** 337,340 **** --- 344,348 ---- } + // @pymethod string|EXTENSION_CONTROL_BLOCK|ReadClient| PyObject * PyECB::ReadClient(PyObject *self, PyObject *args) { *************** *** 349,353 **** nSize = pecb->m_totalBytes - pecb->m_available; } ! if (!PyArg_ParseTuple(args, "|l:ReadClient", &nSize)) return NULL; --- 357,361 ---- nSize = pecb->m_totalBytes - pecb->m_available; } ! // @pyparm int|nbytes|0| if (!PyArg_ParseTuple(args, "|l:ReadClient", &nSize)) return NULL; *************** *** 400,406 **** // The following are wrappers for the various ServerSupportFunction ! ! // HSE_REQ_SEND_RESPONSE_HEADER_EX ! PyObject * PyECB::SendResponseHeaders(PyObject *self, PyObject * args) { --- 408,412 ---- // The following are wrappers for the various ServerSupportFunction ! // @pymethod |EXTENSION_CONTROL_BLOCK|SendResponseHeaders|Calls ServerSupportFunction with HSE_REQ_SEND_RESPONSE_HEADER_EX PyObject * PyECB::SendResponseHeaders(PyObject *self, PyObject * args) { *************** *** 412,415 **** --- 418,424 ---- PyECB * pecb = (PyECB *) self; + // @pyparm string|reply|| + // @pyparm string|headers|| + // @pyparm bool|keepAlive|False| if (!PyArg_ParseTuple(args, "ss|i:SendResponseHeaders", &reply, &headers, &bKeepAlive)) return NULL; *************** *** 427,432 **** } ! // HSE_REQ_SEND_URL_REDIRECT_RESP. ! PyObject * PyECB::Redirect(PyObject *self, PyObject * args) { --- 436,440 ---- } ! // @pymethod |EXTENSION_CONTROL_BLOCK|Redirect|Calls ServerSupportFunction with HSE_REQ_SEND_URL_REDIRECT_RESP PyObject * PyECB::Redirect(PyObject *self, PyObject * args) { *************** *** 436,439 **** --- 444,448 ---- PyECB * pecb = (PyECB *) self; + // @pyparm string|url||The URL to redirect to if (!PyArg_ParseTuple(args, "s:Redirect", &url)) return NULL; *************** *** 451,455 **** } ! // HSE_REQ_GET_IMPERSONATION_TOKEN PyObject * PyECB::GetImpersonationToken(PyObject *self, PyObject *args) { --- 460,464 ---- } ! // @pymethod int|EXTENSION_CONTROL_BLOCK|GetImpersonationToken|Calls ServerSupportFunction with HSE_REQ_GET_IMPERSONATION_TOKEN PyObject * PyECB::GetImpersonationToken(PyObject *self, PyObject *args) { *************** *** 468,471 **** --- 477,481 ---- } + // @pymethod |EXTENSION_CONTROL_BLOCK|IsKeepAlive| PyObject * PyECB::IsKeepAlive(PyObject *self, PyObject * args) { *************** *** 485,490 **** return PyInt_FromLong((bKeepAlive)?1:0); } - //HSE_REQ_DONE_WITH_SESSION PyObject * PyECB::DoneWithSession(PyObject *self, PyObject * args) { --- 495,500 ---- return PyInt_FromLong((bKeepAlive)?1:0); } + // @pymethod |EXTENSION_CONTROL_BLOCK|DoneWithSession|Calls ServerSupportFunction with HSE_REQ_DONE_WITH_SESSION PyObject * PyECB::DoneWithSession(PyObject *self, PyObject * args) { *************** *** 508,516 **** } PyObject * PyECB::IsSessionActive(PyObject *self, PyObject * args) { PyECB * pecb = (PyECB *) self; ! if (!PyArg_ParseTuple(args, ":SessionActive")) return NULL; --- 518,528 ---- } + // @pymethod bool|EXTENSION_CONTROL_BLOCK|IsSessionActive|Indicates if <om EXTENSION_CONTROL_BLOCK.DoneWithSession> + // has been called. PyObject * PyECB::IsSessionActive(PyObject *self, PyObject * args) { PyECB * pecb = (PyECB *) self; ! if (!PyArg_ParseTuple(args, ":IsSessionActive")) return NULL; *************** *** 519,524 **** bActive = (pecb->m_bAsyncDone) ? FALSE : TRUE; } ! ! return PyInt_FromLong(bActive); } --- 531,535 ---- bActive = (pecb->m_bAsyncDone) ? FALSE : TRUE; } ! return PyBool_FromLong(bActive); } Index: PyFilterObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/src/PyFilterObjects.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyFilterObjects.cpp 4 Sep 2004 09:25:49 -0000 1.2 --- PyFilterObjects.cpp 9 Sep 2004 00:22:28 -0000 1.3 *************** *** 28,37 **** #include "pyFilterObjects.h" PyTypeObject PyFILTER_VERSIONType = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "PyFILTER_VERSION", sizeof(PyFILTER_VERSION), 0, --- 28,40 ---- #include "pyFilterObjects.h" + // @doc + // @object HTTP_FILTER_VERSION|A Python interface to the ISAPI HTTP_FILTER_VERSION + // structure. PyTypeObject PyFILTER_VERSIONType = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "HTTP_FILTER_VERSION", sizeof(PyFILTER_VERSION), 0, *************** *** 67,79 **** --- 70,86 ---- if (!me->m_pfv) return PyErr_Format(PyExc_RuntimeError, "FILTER_VERSION structure no longer exists"); + // @prop int|ServerFilterVersion|(read-only) if (strcmp(name, "ServerFilterVersion")==0) { return PyInt_FromLong(me->m_pfv->dwServerFilterVersion); } + // @prop int|FilterVersion| if (strcmp(name, "FilterVersion")==0) { return PyInt_FromLong(me->m_pfv->dwFilterVersion); } + // @prop int|Flags| if (strcmp(name, "Flags")==0) { return PyInt_FromLong(me->m_pfv->dwFlags); } + // @prop string|FilterDesc| if (strcmp(name, "FilterDesc")==0) { return PyString_FromString(me->m_pfv->lpszFilterDesc); *************** *** 132,148 **** ///////////////////////////////////////////////////////////////////// ! // Extension block wrapper ///////////////////////////////////////////////////////////////////// - #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) #define ECBOFF(e) offsetof(PyHFC, e) PyObject * PyHFC::GetData(PyObject *self, PyObject *args) { PyHFC *me = (PyHFC *)self; switch (me->m_notificationType) { case SF_NOTIFY_URL_MAP: return new PyURL_MAP(me); case SF_NOTIFY_PREPROC_HEADERS: return new PyPREPROC_HEADERS(me); --- 139,161 ---- ///////////////////////////////////////////////////////////////////// ! // filter context wrapper ///////////////////////////////////////////////////////////////////// #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) #define ECBOFF(e) offsetof(PyHFC, e) + // @pymethod object|HTTP_FILTER_CONTEXT|GetData|Obtains the data passed to + // The HttpFilterProc function. This is not techinally part of the + // HTTP_FILTER_CONTEXT structure, but packaged here for convenience. PyObject * PyHFC::GetData(PyObject *self, PyObject *args) { PyHFC *me = (PyHFC *)self; + // @rdesc The result depends on the value of <om HTTP_FILTER_CONTEXT.NotificationType> + // @flagh NotificationType|Result type switch (me->m_notificationType) { + // @flag SF_NOTIFY_URL_MAP|<o HTTP_FILTER_URL_MAP> case SF_NOTIFY_URL_MAP: return new PyURL_MAP(me); + // @flag SF_NOTIFY_PREPROC_HEADERS|<o HTTP_FILTER_PREPROC_HEADERS> case SF_NOTIFY_PREPROC_HEADERS: return new PyPREPROC_HEADERS(me); *************** *** 155,158 **** --- 168,172 ---- } + // @pymethod |HTTP_FILTER_CONTEXT|WriteClient| PyObject * PyHFC::WriteClient(PyObject *self, PyObject *args) { *************** *** 163,166 **** --- 177,182 ---- PyHFC * phfc = (PyHFC *) self; + // @pyparm string|data|| + // @pyparm int|reserverd|0| if (!PyArg_ParseTuple(args, "s#|l:WriteClient", &buffer, &buffLen, &reserved)) return NULL; *************** *** 178,181 **** --- 194,198 ---- } + // @pymethod string|HTTP_FILTER_CONTEXT|GetServerVariable| PyObject * PyHFC::GetServerVariable(PyObject *self, PyObject *args) { *************** *** 185,188 **** --- 202,206 ---- PyHFC * phfc = (PyHFC *) self; + // @pyparm string|variable|| if (!PyArg_ParseTuple(args, "s:GetServerVariable", &variable)) return NULL; *************** *** 200,204 **** } ! // @pymethod |SendResponseHeader|| PyObject * PyHFC::SendResponseHeader(PyObject *self, PyObject *args) { --- 218,222 ---- } ! // @pymethod |HTTP_FILTER_CONTEXT|SendResponseHeader| PyObject * PyHFC::SendResponseHeader(PyObject *self, PyObject *args) { *************** *** 226,235 **** } static struct PyMethodDef PyHFC_methods[] = { ! {"GetData", PyHFC::GetData, 1}, // @pymeth | ! {"GetServerVariable", PyHFC::GetServerVariable, 1}, // @pymeth | ! {"WriteClient", PyHFC::WriteClient, 1}, // @pymeth | {"write", PyHFC::WriteClient, 1}, // @pymeth write|A synonym for WriteClient, this allows you to 'print >> fc' ! {"SendResponseHeader", PyHFC::SendResponseHeader, 1}, // @pymeth | {NULL} }; --- 244,255 ---- } + // @object HTTP_FILTER_CONTEXT|A Python representation of an ISAPI + // HTTP_FILTER_CONTEXT structure. static struct PyMethodDef PyHFC_methods[] = { ! {"GetData", PyHFC::GetData, 1}, // @pymeth GetData| ! {"GetServerVariable", PyHFC::GetServerVariable, 1}, // @pymeth GetServerVariable| ! {"WriteClient", PyHFC::WriteClient, 1}, // @pymeth WriteClient| {"write", PyHFC::WriteClient, 1}, // @pymeth write|A synonym for WriteClient, this allows you to 'print >> fc' ! {"SendResponseHeader", PyHFC::SendResponseHeader, 1}, // @pymeth SendResponseHeader| {NULL} }; *************** *** 237,242 **** --- 257,265 ---- struct memberlist PyHFC::PyHFC_memberlist[] = { + // @prop int|Revision|(read-only) {"Revision", T_INT,ECBOFF(m_revision), READONLY}, + // @prop bool|fIsSecurePort|(read-only) {"fIsSecurePort", T_INT, ECBOFF(m_isSecurePort), READONLY}, + // @prop int|NotificationType|(read-only) {"NotificationType", T_INT,ECBOFF(m_notificationType), READONLY}, {NULL} *************** *** 247,251 **** PyObject_HEAD_INIT(&PyType_Type) 0, ! "PyHFC", sizeof(PyHFC), 0, --- 270,274 ---- PyObject_HEAD_INIT(&PyType_Type) 0, ! "HTTP_FILTER_CONTEXT", sizeof(PyHFC), 0, *************** *** 344,352 **** // PyURL_MAP object ///////////////////////////////////////////////////////////////////////// PyTypeObject PyURL_MAPType = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "PyURL_MAP", sizeof(PyURL_MAP), 0, --- 367,377 ---- // PyURL_MAP object ///////////////////////////////////////////////////////////////////////// + // @object HTTP_FILTER_URL_MAP|A Python representation of an ISAPI + // HTTP_FILTER_URL_MAP structure. PyTypeObject PyURL_MAPType = { PyObject_HEAD_INIT(&PyType_Type) 0, ! "HTTP_FILTER_URL_MAP", sizeof(PyURL_MAP), 0, *************** *** 396,403 **** if (!pMap) return NULL; ! if (strcmp(name, "URL")==0) { return PyString_FromString(pMap->pszURL); } if (strcmp(name, "PhysicalPath")==0) { return PyString_FromString(pMap->pszPhysicalPath); --- 421,429 ---- if (!pMap) return NULL; ! // @prop string|URL| if (strcmp(name, "URL")==0) { return PyString_FromString(pMap->pszURL); } + // @prop string|PhysicalPath| if (strcmp(name, "PhysicalPath")==0) { return PyString_FromString(pMap->pszPhysicalPath); *************** *** 438,441 **** --- 464,468 ---- // PyPREPROC_HEADERS object ///////////////////////////////////////////////////////////////////////// + // @pymethod string|HTTP_FILTER_PREPROC_HEADERS|GetHeader| PyObject * PyPREPROC_HEADERS_GetHeader(PyObject *self, PyObject *args) { *************** *** 443,446 **** --- 470,474 ---- DWORD bufSize = sizeof(buffer) / sizeof(TCHAR); char *name; + // @pyparm string|header|| if (!PyArg_ParseTuple(args, "s:GetHeader", &name)) return NULL; *************** *** 458,461 **** --- 486,490 ---- } + // @pymethod |HTTP_FILTER_PREPROC_HEADERS|SetHeader| PyObject * PyPREPROC_HEADERS_SetHeader(PyObject *self, PyObject *args) { *************** *** 466,469 **** --- 495,500 ---- if (!pp || !pfc) return NULL; + // @pyparm string|name|| + // @pyparm string|val|| if (!PyArg_ParseTuple(args, "ss:SetHeader", &name, &val)) return NULL; *************** *** 477,480 **** --- 508,512 ---- } + // @pymethod |HTTP_FILTER_PREPROC_HEADERS|AddHeader| PyObject * PyPREPROC_HEADERS_AddHeader(PyObject *self, PyObject *args) { *************** *** 496,503 **** } static struct PyMethodDef PyPREPROC_HEADERS_methods[] = { ! {"GetHeader", PyPREPROC_HEADERS_GetHeader, 1}, // @pymeth | ! {"SetHeader", PyPREPROC_HEADERS_SetHeader, 1}, // @pymeth | ! {"AddHeader", PyPREPROC_HEADERS_AddHeader, 1}, // @pymeth | {NULL} }; --- 528,537 ---- } + // @object HTTP_FILTER_PREPROC_HEADERS|A Python representation of an ISAPI + // HTTP_FILTER_PREPROC_HEADERS structure. static struct PyMethodDef PyPREPROC_HEADERS_methods[] = { ! {"GetHeader", PyPREPROC_HEADERS_GetHeader, 1}, // @pymeth GetHeader| ! {"SetHeader", PyPREPROC_HEADERS_SetHeader, 1}, // @pymeth SetHeader| ! {"AddHeader", PyPREPROC_HEADERS_AddHeader, 1}, // @pymeth AddHeader| {NULL} }; *************** *** 507,511 **** PyObject_HEAD_INIT(&PyType_Type) 0, ! "PyPREPROC_HEADERS", sizeof(PyPREPROC_HEADERS), 0, --- 541,545 ---- PyObject_HEAD_INIT(&PyType_Type) 0, ! "HTTP_FILTER_PREPROC_HEADERS", sizeof(PyPREPROC_HEADERS), 0, |
|
From: Trent M. <tm...@us...> - 2004-09-08 23:31:22
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11256 Modified Files: win32uimodule.cpp Log Message: Fix up some document markup in win32uimodule.cpp that resulted in some 404s and/or incorrectly named links in the TOC in PyWin32.chm. Index: win32uimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uimodule.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** win32uimodule.cpp 11 Apr 2004 04:44:24 -0000 1.27 --- win32uimodule.cpp 8 Sep 2004 23:31:12 -0000 1.28 *************** *** 1820,1824 **** {"CreatePropertyPageIndirect", PyCPropertyPage::createIndirect, 1}, // @pymeth CreatePropertyPageIndirect|Creates a <o PyCPropertyPage> object from a template. {"CreatePropertySheet", PyCPropertySheet::create, 1}, // @pymeth CreatePropertySheet|Creates a <o PyCPropertySheet> object ! {"CreateRectRgn", PyCRgn::create_rect_rgn, 1}, // @pymeth CreateRectRgn|Initializes a Mo PyCRgn> to a rectangle {"CreateRgn", PyCRgn::create, 1}, // @pymeth CreateRgn|Creates a new <o PyCRgn> object. {"CreateRichEditCtrl", PyCRichEditCtrl_create, 1}, // @pymeth CreateRichEditCtrl|Creates a rich edit control. --- 1820,1824 ---- {"CreatePropertyPageIndirect", PyCPropertyPage::createIndirect, 1}, // @pymeth CreatePropertyPageIndirect|Creates a <o PyCPropertyPage> object from a template. {"CreatePropertySheet", PyCPropertySheet::create, 1}, // @pymeth CreatePropertySheet|Creates a <o PyCPropertySheet> object ! {"CreateRectRgn", PyCRgn::create_rect_rgn, 1}, // @pymeth CreateRectRgn|Initializes a <o PyCRgn> to a rectangle {"CreateRgn", PyCRgn::create, 1}, // @pymeth CreateRgn|Creates a new <o PyCRgn> object. {"CreateRichEditCtrl", PyCRichEditCtrl_create, 1}, // @pymeth CreateRichEditCtrl|Creates a rich edit control. *************** *** 1831,1836 **** {"CreateFont", PyCFont::create, 1}, // @pymeth CreateFont|Creates a <o PyCFont> object. {"CreateToolBar", PyCToolBar::create, 1}, // @pymeth CreateToolBar|Creates a toolbar object. ! {"CreateToolBarCtrl", PyCToolBarCtrl_create, 1}, // @pymeth CreateToolBar|Creates a toolbar object. ! {"CreateToolTipCtrl", PyCToolTipCtrl_create, 1}, // @pymeth CreateToolTip|Creates a tooltip control object. {"CreateThread", PyCWinThread::create, 1}, // @pymeth CreateThread|Creates a <o PyCWinThread> object. {"CreateView", PyCScrollView::create, 1}, // @pymeth CreateView|Creates a <o PyCView> object. --- 1831,1836 ---- {"CreateFont", PyCFont::create, 1}, // @pymeth CreateFont|Creates a <o PyCFont> object. {"CreateToolBar", PyCToolBar::create, 1}, // @pymeth CreateToolBar|Creates a toolbar object. ! {"CreateToolBarCtrl", PyCToolBarCtrl_create, 1}, // @pymeth CreateToolBarCtrl|Creates a toolbar object. ! {"CreateToolTipCtrl", PyCToolTipCtrl_create, 1}, // @pymeth CreateToolTipCtrl|Creates a tooltip control object. {"CreateThread", PyCWinThread::create, 1}, // @pymeth CreateThread|Creates a <o PyCWinThread> object. {"CreateView", PyCScrollView::create, 1}, // @pymeth CreateView|Creates a <o PyCView> object. |
|
From: Trent M. <tm...@us...> - 2004-09-08 23:28:25
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10740 Modified Files: win32netmisc.cpp Log Message: Fix the doc markup in win32netmisc.cpp. Before this the AutoDuck generation and post processing to CHM would result in bogus TOC entries under "Win32 API/Objects/PyWKSTA_INFO_402". Index: win32netmisc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmisc.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32netmisc.cpp 6 Mar 2004 23:55:59 -0000 1.8 --- win32netmisc.cpp 8 Sep 2004 23:28:16 -0000 1.9 *************** *** 150,174 **** // @object PyWKSTA_INFO_402|A dictionary holding the infomation in a Win32 WKSTA_INFO_402 structure. static struct PyNET_STRUCT_ITEM wki402[] = { ! WKI402_ENTRY(char_wait, NSI_DWORD, 0), // @prop int|number of seconds the computer will wait for a remote resource to become available| ! WKI402_ENTRY(collection_time, NSI_DWORD, 0), // @prop int|number of milliseconds the computer will collect data before sending the data to a character device resource. The workstation waits the specified time or collects the number of characters specified by wki402_maximum_collection_count, whichever comes first.| ! WKI402_ENTRY(maximum_collection_count , NSI_DWORD, 0), // @prop string/<o PyUnicode>|Name of the domain to which computer belongs| ! WKI402_ENTRY(keep_conn, NSI_DWORD, 0), // @prop int|Major version number of operating system running on the computer| ! WKI402_ENTRY(keep_search, NSI_DWORD, 0), // @prop int|Minor version number of operating system running on the computer| ! WKI402_ENTRY(max_cmds, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(num_work_buf, NSI_DWORD, 0), // @prop int|Number of users who are logged on to the local computer| ! WKI402_ENTRY(siz_work_buf, NSI_DWORD, 0), // @prop int|Number of users who are logged on to the local computer| ! WKI402_ENTRY(max_wrk_cache, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(sess_timeout, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(siz_error, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(num_alerts, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(num_services, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(errlog_sz, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(print_buf_time, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(num_char_buf, NSI_DWORD, 0), // @prop int| .. | WKI402_ENTRY(siz_char_buf, NSI_DWORD, 0), // @prop int|siz_char_buf|Specifies the maximum size, in bytes, of a character pipe buffer and device buffer. ! WKI402_ENTRY(wrk_heuristics, NSI_WSTR, 0), // @prop string/<o PyUnicode>|..| ! WKI402_ENTRY(mailslots, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(num_dgram_buf, NSI_DWORD, 0), // @prop int| .. | ! WKI402_ENTRY(max_threads, NSI_DWORD, 0), // @prop int|Number of threads the computer can dedicate to the network| {NULL} }; --- 150,174 ---- // @object PyWKSTA_INFO_402|A dictionary holding the infomation in a Win32 WKSTA_INFO_402 structure. static struct PyNET_STRUCT_ITEM wki402[] = { ! WKI402_ENTRY(char_wait, NSI_DWORD, 0), // @prop int|char_wait|number of seconds the computer will wait for a remote resource to become available ! WKI402_ENTRY(collection_time, NSI_DWORD, 0), // @prop int|collection_time|number of milliseconds the computer will collect data before sending the data to a character device resource. The workstation waits the specified time or collects the number of characters specified by wki402_maximum_collection_count, whichever comes first. ! WKI402_ENTRY(maximum_collection_count , NSI_DWORD, 0), // @prop string/<o PyUnicode>|maximum_collection_count|Name of the domain to which computer belongs ! WKI402_ENTRY(keep_conn, NSI_DWORD, 0), // @prop int|keep_conn|Major version number of operating system running on the computer ! WKI402_ENTRY(keep_search, NSI_DWORD, 0), // @prop int|keep_search|Minor version number of operating system running on the computer ! WKI402_ENTRY(max_cmds, NSI_DWORD, 0), // @prop int|max_cmds|.. ! WKI402_ENTRY(num_work_buf, NSI_DWORD, 0), // @prop int|num_work_buf|Number of users who are logged on to the local computer ! WKI402_ENTRY(siz_work_buf, NSI_DWORD, 0), // @prop int|siz_work_buf|Number of users who are logged on to the local computer ! WKI402_ENTRY(max_wrk_cache, NSI_DWORD, 0), // @prop int|max_wrk_cache|.. ! WKI402_ENTRY(sess_timeout, NSI_DWORD, 0), // @prop int|sess_timeout|.. ! WKI402_ENTRY(siz_error, NSI_DWORD, 0), // @prop int|siz_error|.. ! WKI402_ENTRY(num_alerts, NSI_DWORD, 0), // @prop int|num_alerts|.. ! WKI402_ENTRY(num_services, NSI_DWORD, 0), // @prop int|num_services|.. ! WKI402_ENTRY(errlog_sz, NSI_DWORD, 0), // @prop int|errlog_sz|.. ! WKI402_ENTRY(print_buf_time, NSI_DWORD, 0), // @prop int|print_buf_time|.. ! WKI402_ENTRY(num_char_buf, NSI_DWORD, 0), // @prop int|num_char_buf|.. WKI402_ENTRY(siz_char_buf, NSI_DWORD, 0), // @prop int|siz_char_buf|Specifies the maximum size, in bytes, of a character pipe buffer and device buffer. ! WKI402_ENTRY(wrk_heuristics, NSI_WSTR, 0), // @prop string/<o PyUnicode>|siz_char_buf|.. ! WKI402_ENTRY(mailslots, NSI_DWORD, 0), // @prop int|mailslots|.. ! WKI402_ENTRY(num_dgram_buf, NSI_DWORD, 0), // @prop int|num_dgram_buf|.. ! WKI402_ENTRY(max_threads, NSI_DWORD, 0), // @prop int|max_threads|Number of threads the computer can dedicate to the network {NULL} }; |
|
From: Mark H. <mha...@us...> - 2004-09-07 22:17:13
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29239 Modified Files: Dump2HHC.py Log Message: Patch from Trent Mick to fix the TOC entries for the 'more' modules. Index: Dump2HHC.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/Dump2HHC.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Dump2HHC.py 17 Apr 2002 14:06:19 -0000 1.4 --- Dump2HHC.py 7 Sep 2004 22:17:00 -0000 1.5 *************** *** 173,180 **** if top2.type == "pymeth": top2.name = fields[2] ! top2.context = "%s__%s_meth.html" % (top.name, top2.name) elif top2.type == "prop": top2.name = fields[3] ! top2.context = "%s__%s_prop.html" % (top.name, top2.name) else: # and loop.... --- 173,180 ---- if top2.type == "pymeth": top2.name = fields[2] ! top2.context = "%s__%s_meth.html" % (_urlescape(top.name), top2.name) elif top2.type == "prop": top2.name = fields[3] ! top2.context = "%s__%s_prop.html" % (_urlescape(top.name), top2.name) else: # and loop.... *************** *** 198,201 **** --- 198,212 ---- d[top.name] = top + def _urlescape(name): + """Escape the given name for inclusion in a URL. + + Escaping is done in the manner in which AutoDuck(?) seems to be doing + it. + """ + name = name.replace(' ', '_')\ + .replace('(', '.28')\ + .replace(')', '.29') + return name + def _genCategoryHTMLFromDict(dict, output): keys = dict.keys() |
|
From: Mark H. <mha...@us...> - 2004-09-07 10:23:06
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24242 Modified Files: win32timezone.py Log Message: Prevent syntax-errors in Python 2.2 (even though ti will still fail unless you have datetime installed) Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32timezone.py 18 Apr 2004 05:58:16 -0000 1.1 --- win32timezone.py 7 Sep 2004 10:22:56 -0000 1.2 *************** *** 70,73 **** --- 70,74 ---- __date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] + from __future__ import generators import os, win32api, win32con, struct, datetime |
|
From: Mark H. <mha...@us...> - 2004-09-07 10:16:03
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23087 Modified Files: setup_win32all.py Log Message: Avoid "LINK : warning LNK4068: /MACHINE not specified; defaulting to IX86" Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** setup_win32all.py 7 Sep 2004 09:47:33 -0000 1.29 --- setup_win32all.py 7 Sep 2004 10:15:54 -0000 1.30 *************** *** 117,120 **** --- 117,122 ---- sources = sources or [] sources.extend(self.get_source_files(dsp_file)) + extra_link_args = extra_link_args or [] + extra_link_args.append("/MACHINE:ix86") # Some of our swigged files behave differently in distutils vs # MSVC based builds. Always define DISTUTILS_BUILD so they can tell. |
|
From: Mark H. <mha...@us...> - 2004-09-07 10:04:50
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21152 Modified Files: PyWinTypes.h Log Message: Add PyBool_FromLong helper for pre python 2.3 builds. Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PyWinTypes.h 7 Sep 2004 04:27:04 -0000 1.23 --- PyWinTypes.h 7 Sep 2004 10:04:35 -0000 1.24 *************** *** 228,231 **** --- 228,243 ---- PyObject *PyLong_FromI64(__int64 ival); BOOL PyLong_AsI64(PyObject *val, __int64 *lval); + + // Some boolean helpers for Python 2.2 and earlier + #if (PY_VERSION_HEX < 0x02030000 && !defined(PYWIN_NO_BOOL_FROM_LONG)) + // PyBool_FromLong only in 2.3 and later + inline PyObject *PyBool_FromLong(long v) + { + PyObject *ret= v ? Py_True : Py_False; + Py_INCREF(ret); + return ret; + } + #endif + /* ** OVERLAPPED Object and API |
|
From: Mark H. <mha...@us...> - 2004-09-07 09:47:42
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18251 Modified Files: setup_win32all.py Log Message: Recent win32service changes require user32.dll Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** setup_win32all.py 4 Sep 2004 03:06:29 -0000 1.28 --- setup_win32all.py 7 Sep 2004 09:47:33 -0000 1.29 *************** *** 787,791 **** ("win32ras", "rasapi32 user32", False), ("win32security", "advapi32 user32", True), ! ("win32service", "advapi32 oleaut32", True, 0x0500), ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), --- 787,791 ---- ("win32ras", "rasapi32 user32", False), ("win32security", "advapi32 user32", True), ! ("win32service", "advapi32 oleaut32 user32", True, 0x0500), ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), |
|
From: Mark H. <mha...@us...> - 2004-09-07 09:44:05
|
Update of /cvsroot/pywin32/pywin32/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17428 Modified Files: PyWinTypes.dsp Log Message: Add new PyDEVMODE.cpp to the project. Index: PyWinTypes.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/PyWinTypes.dsp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PyWinTypes.dsp 31 Jul 2003 02:14:35 -0000 1.15 --- PyWinTypes.dsp 7 Sep 2004 09:43:46 -0000 1.16 *************** *** 120,123 **** --- 120,127 ---- # Begin Source File + SOURCE=.\src\PyDEVMODE.cpp + # End Source File + # Begin Source File + SOURCE=.\src\PyHANDLE.cpp # End Source File |
|
From: Mark H. <mha...@us...> - 2004-09-07 08:38:24
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4315 Modified Files: win32gui.i Log Message: SetFocus was defined as a BOOL, when it really returns the hwnd previously with focus. This meant it raised bogus exceptions. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** win32gui.i 7 Sep 2004 02:04:28 -0000 1.47 --- win32gui.i 7 Sep 2004 08:38:15 -0000 1.48 *************** *** 1922,1926 **** // @pyswig |SetFocus|Sets focus to the specified window. // @pyparm int|hwnd||The handle to the window ! BOOLAPI SetFocus(HWND hwnd); // @pyswig |UpdateWindow| --- 1922,1926 ---- // @pyswig |SetFocus|Sets focus to the specified window. // @pyparm int|hwnd||The handle to the window ! HWND SetFocus(HWND hwnd); // @pyswig |UpdateWindow| |
|
From: Roger U. <ru...@us...> - 2004-09-07 04:27:17
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29343/win32/src Modified Files: PyWinObjects.h PyWinTypes.h PyWinTypesmodule.cpp win32apimodule.cpp Added Files: PyDEVMODE.cpp Log Message: Add support for DEVMODE structure, and EnumDisplaySettings and ChangeDisplaySettings Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** win32apimodule.cpp 13 Jul 2004 07:12:45 -0000 1.38 --- win32apimodule.cpp 7 Sep 2004 04:27:04 -0000 1.39 *************** *** 4260,4263 **** --- 4260,4310 ---- } + //@pymethod <o PyDEVMODE>|win32api|EnumDisplaySettings|List available modes for specified display device + PyObject *PyEnumDisplaySettings(PyObject *self, PyObject *args) + { + PyObject *obDeviceName=NULL; + char *DeviceName; + DWORD ModeNum; + DEVMODE devmode; + // @pyparm string|DeviceName||Name of device, use None for current display device + // @pyparm int|ModeNum||Index of setting to return, or one of ENUM_CURRENT_SETTINGS, ENUM_REGISTRY_SETTINGS + if (!PyArg_ParseTuple(args, "Ol:EnumDisplaySettings",&obDeviceName, &ModeNum)) + return NULL; + if (obDeviceName==NULL || obDeviceName==Py_None) + DeviceName=NULL; + else{ + DeviceName=PyString_AsString(obDeviceName); + if (DeviceName==NULL) + return NULL; + } + ZeroMemory(&devmode,sizeof(DEVMODE)); + devmode.dmSize=sizeof(DEVMODE); + if (!EnumDisplaySettings(DeviceName, ModeNum, &devmode)){ + // msdn says GetLastError should return something on win2k and up, I get 0 + PyWin_SetAPIError("EnumDisplaySettings"); + return NULL; + } + return PyWinObject_FromDEVMODE(&devmode); + } + + // @pymethod int|win32api|ChangeDisplaySettings|Changes video mode for default display + // @comm Returns DISP_CHANGE_SUCCESSFUL on success, or one of the DISP_CHANGE_* error constants on failure + PyObject *PyChangeDisplaySettings(PyObject *self, PyObject *args) + { + DWORD Flags; + PDEVMODE pdevmode; + PyObject *obdevmode; + long ret; + // @pyparm <o PyDEVMODE>|DevMode||A PyDEVMODE object as returned from EnumDisplaySettings, or None to reset to default settings from registry + // @pyparm int|Flags||One of the CDS_* constants, or 0 + if (!PyArg_ParseTuple(args, "Ol:ChangeDisplaySettings",&obdevmode, &Flags)) + return NULL; + if (!PyWinObject_AsDEVMODE(obdevmode, &pdevmode, TRUE)) + return NULL; + // DISP_CHANGE_* errors don't translate as win32 error codes, just return it + ret=::ChangeDisplaySettings(pdevmode, Flags); + return Py_BuildValue("l",ret); + } + /* List of functions exported by this module */ // @module win32api|A module, encapsulating the Windows Win32 API. *************** *** 4272,4275 **** --- 4319,4323 ---- {"Beep", PyBeep, 1}, // @pymeth Beep|Generates a simple tone on the speaker. {"BeginUpdateResource", PyBeginUpdateResource, 1 }, // @pymeth BeginUpdateResource|Begins an update cycle for a PE file. + {"ChangeDisplaySettings", PyChangeDisplaySettings, 1}, // @pymeth ChangeDisplaySettings|Changes video mode for default display {"ClipCursor", PyClipCursor, 1}, // @pymeth ClipCursor|Confines the cursor to a rectangular area on the screen. {"CloseHandle", PyCloseHandle, 1}, // @pymeth CloseHandle|Closes an open handle. *************** *** 4281,4284 **** --- 4329,4333 ---- {"DuplicateHandle", PyDuplicateHandle, 1}, // @pymeth DuplicateHandle|Duplicates a handle. {"EndUpdateResource", PyEndUpdateResource, 1 }, // @pymeth EndUpdateResource|Ends a resource update cycle of a PE file. + {"EnumDisplaySettings", PyEnumDisplaySettings,1}, //@pymeth EnumDisplaySettings|Lists available modes for specified device {"EnumResourceLanguages", PyEnumResourceLanguages, 1 }, // @pymeth EnumResourceLanguages|List languages for specified resource {"EnumResourceNames", PyEnumResourceNames, 1 }, // @pymeth EnumResourceNames|Enumerates all the resources of the specified type from the nominated file. --- NEW FILE: PyDEVMODE.cpp --- #include "PyWinTypes.h" #include "structmember.h" #include "PyWinObjects.h" struct PyMethodDef PyDEVMODE::methods[] = { {"Clear", PyDEVMODE::Clear, 1}, // @pymeth Clear|Resets all members of the structure {NULL} }; #define OFF(e) offsetof(PyDEVMODE, e) struct PyMemberDef PyDEVMODE::members[] = { // DeviceName is a dummy so it will show up in property list, get and set handle manually {"DeviceName", T_OBJECT, 0, 0, "String of at most 32 chars"}, {"SpecVersion", T_USHORT, OFF(devmode.dmSpecVersion), 0, "Should always be set to DM_SPECVERSION"}, {"DriverVersion", T_USHORT, OFF(devmode.dmDriverVersion), 0, ""}, {"Size", T_USHORT, OFF(devmode.dmSize), READONLY, "Size of structure"}, {"DriverExtra", T_USHORT, OFF(devmode.dmDriverExtra), READONLY, "Number of extra bytes allocated for driver data, can only be set when new object is created"}, {"Fields", T_ULONG, OFF(devmode.dmFields), 0, "Bitmask of DM_* constants indicating which members are set"}, {"Orientation", T_SHORT, OFF(devmode.dmOrientation), 0, "Only applies to printers, DMORIENT_PORTRAIT or DMORIENT_LANDSCAPE"}, {"PaperSize", T_SHORT, OFF(devmode.dmPaperSize), 0, "Use 0 if PaperWidth and PaperLength are set, otherwise DMPAPER_* constant"}, {"PaperLength", T_SHORT, OFF(devmode.dmPaperLength), 0, "Specified in 1/10 millimeters"}, {"PaperWidth", T_SHORT, OFF(devmode.dmPaperWidth), 0, "Specified in 1/10 millimeters"}, {"Position_x", T_LONG, OFF(devmode.dmPosition.x), 0, "Position of display relative to desktop"}, {"Position_y", T_LONG, OFF(devmode.dmPosition.y), 0, "Position of display relative to desktop"}, // {"DisplayOrientation",T_ULONG,OFF(devmode.dmDisplayOrientation), 0, "Display rotation: DMDO_DEFAULT,DMDO_90, DMDO_180, DMDO_270"}, // {"DisplayFixedOutput",T_ULONG,OFF(devmode.dmDisplayFixedOutput), 0, "DMDFO_DEFAULT, DMDFO_CENTER, DMDFO_STRETCH"}, {"Scale", T_SHORT, OFF(devmode.dmScale), 0, "Specified as percentage, eg 50 means half size of original"}, {"Copies", T_SHORT, OFF(devmode.dmCopies), 0, ""}, {"DefaultSource", T_SHORT, OFF(devmode.dmDefaultSource), 0, "DMBIN_* constant, or can be a printer-specific value"}, {"PrintQuality", T_SHORT, OFF(devmode.dmPrintQuality), 0, "DMRES_* constant, interpreted as DPI if positive"}, {"Color", T_SHORT, OFF(devmode.dmColor), 0, "DMCOLOR_COLOR or DMCOLOR_MONOCHROME"}, {"Duplex", T_SHORT, OFF(devmode.dmDuplex), 0, "For printers that do two-sided printing: DMDUP_SIMPLEX, DMDUP_HORIZONTAL, DMDUP_VERTICAL"}, {"YResolution", T_SHORT, OFF(devmode.dmYResolution), 0, "Vertical printer resolution in DPI - if this is set, PrintQuality indicates horizontal DPI"}, {"TTOption", T_SHORT, OFF(devmode.dmTTOption), 0, "TrueType options: DMTT_BITMAP, DMTT_DOWNLOAD, DMTT_DOWNLOAD_OUTLINE, DMTT_SUBDEV"}, {"Collate", T_SHORT, OFF(devmode.dmCollate), 0, "DMCOLLATE_TRUE or DMCOLLATE_FLASE"}, {"FormName", T_OBJECT, 0, 0, "String of at most 32 chars"}, // same semantics as DeviceName {"LogPixels", T_USHORT, OFF(devmode.dmLogPixels), 0, "Pixels per inch (only for display devices)"}, {"BitsPerPel", T_ULONG, OFF(devmode.dmBitsPerPel), 0, "Color resolution in bits per pixel"}, {"PelsWidth", T_ULONG, OFF(devmode.dmPelsWidth), 0, "Pixel width of display"}, {"PelsHeight", T_ULONG, OFF(devmode.dmPelsHeight), 0, "Pixel height of display"}, {"DisplayFlags", T_ULONG, OFF(devmode.dmDisplayFlags), 0, "Combination of DM_GRAYSCALE and DM_INTERLACED"}, {"Nup", T_ULONG, OFF(devmode.dmNup), 0, "DMNUP_SYSTEM or DMNUP_ONEUP"}, // wtf is a "Nup"? {"DisplayFrequency",T_ULONG, OFF(devmode.dmDisplayFrequency), 0, "Refresh rate"}, {"ICMMethod", T_ULONG, OFF(devmode.dmICMMethod), 0, ""}, {"ICMIntent", T_ULONG, OFF(devmode.dmICMIntent), 0, ""}, {"MediaType", T_ULONG, OFF(devmode.dmMediaType), 0, ""}, {"DitherType", T_ULONG, OFF(devmode.dmDitherType), 0, ""}, {"Reserved1", T_ULONG, OFF(devmode.dmReserved1), 0, ""}, {"Reserved2", T_ULONG, OFF(devmode.dmReserved2), 0, ""}, {"PanningWidth", T_ULONG, OFF(devmode.dmPanningWidth), 0, ""}, {"PanningHeight", T_ULONG, OFF(devmode.dmPanningHeight), 0, ""}, {"DriverData", T_OBJECT, OFF(devmode)+sizeof(DEVMODE), 0, "Driver data appended to end of structure"}, {NULL} }; // @object PyDEVMODE|Python object wrapping a DEVMODE structure PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType = { PyObject_HEAD_INIT(&PyType_Type) 0, "PyDEVMODE", sizeof(PyDEVMODE), 0, PyDEVMODE::deallocFunc, 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 0, 0, /* tp_call */ 0, /* tp_str */ PyDEVMODE::getattro, // PyObject_GenericGetAttr PyDEVMODE::setattro, // PyObject_GenericSetAttr 0, // tp_as_buffer; Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags; 0, // tp_doc; /* Documentation string */ 0, // traverseproc tp_traverse; 0, // tp_clear; 0, // tp_richcompare; 0, // tp_weaklistoffset; 0, // tp_iter 0, // iternextfunc tp_iternext PyDEVMODE::methods, PyDEVMODE::members, 0, // tp_getset; 0, // tp_base; 0, // tp_dict; 0, // tp_descr_get; 0, // tp_descr_set; 0, // tp_dictoffset; 0, // tp_init; 0, // tp_alloc; PyDEVMODE::tp_new // newfunc tp_new; }; PyDEVMODE::PyDEVMODE(PDEVMODE pdm) { ob_type = &PyDEVMODEType; memcpy(&devmode, pdm, pdm->dmSize); pdevmode=(PDEVMODE)malloc(pdm->dmSize + pdm->dmDriverExtra); if (pdevmode==NULL) PyErr_Format(PyExc_MemoryError, "PyDEVMODE::PyDEVMODE - Unable to allocate DEVMODE of size %d", pdm->dmSize + pdm->dmDriverExtra); else; memcpy(pdevmode, pdm, pdm->dmSize + pdm->dmDriverExtra); _Py_NewReference(this); } PyDEVMODE::PyDEVMODE(void) { ob_type = &PyDEVMODEType; static WORD dmSize=sizeof(DEVMODE); pdevmode=(PDEVMODE)malloc(dmSize); ZeroMemory(pdevmode,dmSize); pdevmode->dmSize=dmSize; pdevmode->dmSpecVersion=DM_SPECVERSION; ZeroMemory(&devmode,dmSize); devmode.dmSize=dmSize; devmode.dmSpecVersion=DM_SPECVERSION; _Py_NewReference(this); } PyDEVMODE::PyDEVMODE(USHORT dmDriverExtra) { ob_type = &PyDEVMODEType; static WORD dmSize=sizeof(DEVMODE); pdevmode=(PDEVMODE)malloc(dmSize+dmDriverExtra); ZeroMemory(pdevmode,dmSize+dmDriverExtra); pdevmode->dmSize=dmSize; pdevmode->dmSpecVersion=DM_SPECVERSION; pdevmode->dmDriverExtra=dmDriverExtra; ZeroMemory(&devmode,dmSize); devmode.dmSize=dmSize; devmode.dmSpecVersion=DM_SPECVERSION; devmode.dmDriverExtra=dmDriverExtra; _Py_NewReference(this); } PyDEVMODE::~PyDEVMODE() { if (pdevmode!=NULL) free(pdevmode); } BOOL PyDEVMODE_Check(PyObject *ob) { if (ob->ob_type!=&PyDEVMODEType){ PyErr_SetString(PyExc_TypeError,"Object must be a PyDEVMODE"); return FALSE; } return TRUE; } void PyDEVMODE::deallocFunc(PyObject *ob) { delete (PyDEVMODE *)ob; } PDEVMODE PyDEVMODE::GetDEVMODE(void) { return pdevmode; } PyObject *PyDEVMODE::Clear(PyObject *self, PyObject *args) { PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; USHORT dmDriverExtra=pdevmode->dmDriverExtra; WORD dmSize=pdevmode->dmSize; DWORD totalsize=dmSize + dmDriverExtra; ZeroMemory(pdevmode, totalsize); pdevmode->dmDriverExtra=dmDriverExtra; pdevmode->dmSize=dmSize; pdevmode->dmSpecVersion=DM_SPECVERSION; pdevmode=&((PyDEVMODE *)self)->devmode; ZeroMemory(pdevmode, dmSize); pdevmode->dmDriverExtra=dmDriverExtra; pdevmode->dmSize=dmSize; pdevmode->dmSpecVersion=DM_SPECVERSION; Py_INCREF(Py_None); return Py_None; } PyObject *PyDEVMODE::getattro(PyObject *self, PyObject *obname) { PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; char *name=PyString_AsString(obname); if (name==NULL) return NULL; if (strcmp(name,"DeviceName")==0) if (pdevmode->dmDeviceName[CCHDEVICENAME-1]==0) // in case DeviceName fills space and has no trailing NULL return PyString_FromString((char *)&pdevmode->dmDeviceName); else return PyString_FromStringAndSize((char *)&pdevmode->dmDeviceName, CCHDEVICENAME); if (strcmp(name,"FormName")==0) if (pdevmode->dmFormName[CCHFORMNAME-1]==0) // If dmFormName occupies whole 32 chars, trailing NULL not present return PyString_FromString((char *)&pdevmode->dmFormName); else return PyString_FromStringAndSize((char *)&pdevmode->dmFormName, CCHFORMNAME); if (strcmp(name,"DriverData")==0) if (pdevmode->dmDriverExtra==0){ // No extra space allocated Py_INCREF(Py_None); return Py_None; } else return PyString_FromStringAndSize((char *)((long)pdevmode + pdevmode->dmSize), pdevmode->dmDriverExtra); return PyObject_GenericGetAttr(self,obname); } int PyDEVMODE::setattro(PyObject *self, PyObject *obname, PyObject *obvalue) { char *name, *value; int valuelen; name=PyString_AsString(obname); if (name==NULL) return -1; if (strcmp(name,"DeviceName")==0){ if (PyString_AsStringAndSize(obvalue, &value, &valuelen)==-1) return -1; if (valuelen > CCHDEVICENAME){ PyErr_Format(PyExc_ValueError,"DeviceName must be a string of length %d or less", CCHDEVICENAME); return -1; } PDEVMODE pdevmode=&((PyDEVMODE *)self)->devmode; ZeroMemory(&pdevmode->dmDeviceName, CCHDEVICENAME); memcpy(&pdevmode->dmDeviceName, value, valuelen); // update variable length DEVMODE with same value memcpy(((PyDEVMODE *)self)->pdevmode, pdevmode, pdevmode->dmSize); return 0; } if (strcmp(name,"FormName")==0){ if (PyString_AsStringAndSize(obvalue, &value, &valuelen)==-1) return -1; if (valuelen > CCHFORMNAME){ PyErr_Format(PyExc_ValueError,"FormName must be a string of length %d or less", CCHFORMNAME); return -1; } PDEVMODE pdevmode=&((PyDEVMODE *)self)->devmode; ZeroMemory(&pdevmode->dmFormName, CCHFORMNAME); memcpy(&pdevmode->dmFormName, value, valuelen); // update variable length PDEVMODE with same value memcpy(((PyDEVMODE *)self)->pdevmode, pdevmode, pdevmode->dmSize); return 0; } if (strcmp(name,"DriverData")==0){ if (PyString_AsStringAndSize(obvalue, &value, &valuelen)==-1) return -1; PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; if (valuelen > pdevmode->dmDriverExtra){ PyErr_Format(PyExc_ValueError,"Length of DriverData cannot be longer that DriverExtra (%d bytes)", pdevmode->dmDriverExtra); return -1; } // This is not a real struct member, calculate address after end of fixed part of structure char *driverdata=(char *)((long)pdevmode + pdevmode->dmSize); ZeroMemory(driverdata, pdevmode->dmDriverExtra); memcpy(driverdata, value, valuelen); return 0; } int ret=PyObject_GenericSetAttr(self, obname, obvalue); // Propagate changes to the externally usable structure if (ret==0) memcpy(((PyDEVMODE *)self)->pdevmode, &((PyDEVMODE *)self)->devmode, ((PyDEVMODE *)self)->devmode.dmSize); return ret; } PyObject *PyDEVMODE::tp_new(PyTypeObject *typ, PyObject *args, PyObject *kwargs) { USHORT DriverExtra=0; static char *keywords[]={"DriverExtra", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|H", keywords, &DriverExtra)) return NULL; return new PyDEVMODE(DriverExtra); } BOOL PyWinObject_AsDEVMODE(PyObject *ob, PDEVMODE *ppDEVMODE, BOOL bNoneOk) { if (ob==Py_None) if (bNoneOk){ *ppDEVMODE=NULL; return TRUE; } else{ PyErr_SetString(PyExc_ValueError,"PyDEVMODE cannot be None in this context"); return FALSE; } if (!PyDEVMODE_Check(ob)) return FALSE; *ppDEVMODE=((PyDEVMODE *)ob)->GetDEVMODE(); return TRUE; } PyObject *PyWinObject_FromDEVMODE(PDEVMODE pDEVMODE) { static WORD dmSize=sizeof(DEVMODE); if (pDEVMODE==NULL){ Py_INCREF(Py_None); return Py_None; } // make sure we can't overflow the fixed size DEVMODE in PyDEVMODE if (pDEVMODE->dmSize>dmSize){ PyErr_Format(PyExc_WindowsError,"DEVMODE structure of size %d greater than supported size of %d", pDEVMODE->dmSize, dmSize); return NULL; } PyObject *ret=new PyDEVMODE(pDEVMODE); // check that variable sized pdevmode is allocated if (((PyDEVMODE *)ret)->GetDEVMODE()==NULL){ Py_DECREF(ret); ret=NULL; } return ret; } Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyWinObjects.h 20 Jan 2003 23:14:45 -0000 1.6 --- PyWinObjects.h 7 Sep 2004 04:27:02 -0000 1.7 *************** *** 218,219 **** --- 218,248 ---- }; #endif /* __PYWINTYPES_H__ */ + + class PYWINTYPES_EXPORT PyDEVMODE : public PyObject + { + public: + #ifdef _MSC_VER + #pragma warning( disable : 4251 ) + #endif // _MSC_VER + static struct PyMemberDef members[]; + static struct PyMethodDef methods[]; + #ifdef _MSC_VER + #pragma warning( default : 4251 ) + #endif // _MSC_VER + + static void deallocFunc(PyObject *ob); + PyDEVMODE(PDEVMODE); + PyDEVMODE(void); + PyDEVMODE(USHORT); + static PyObject *getattro(PyObject *self, PyObject *name); + static int setattro(PyObject *self, PyObject *obname, PyObject *obvalue); + static PyObject *Clear(PyObject *self, PyObject *args); + static PyObject *tp_new(PyTypeObject *, PyObject *, PyObject *); + PDEVMODE GetDEVMODE(void); + protected: + // Pointer to variable length DEVMODE with dmDriverExtra bytes allocated at end, always use this externally + PDEVMODE pdevmode; + // copy of fixed portion of DEVMODE for structmember api to access + DEVMODE devmode; + ~PyDEVMODE(); + }; Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PyWinTypesmodule.cpp 26 Jul 2004 06:47:16 -0000 1.16 --- PyWinTypesmodule.cpp 7 Sep 2004 04:27:04 -0000 1.17 *************** *** 536,539 **** --- 536,540 ---- PyDict_SetItemString(dict, "HANDLEType", (PyObject *)&PyHANDLEType); PyDict_SetItemString(dict, "OVERLAPPEDType", (PyObject *)&PyHANDLEType); + PyDict_SetItemString(dict, "DEVMODEType", (PyObject *)&PyDEVMODEType); Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PyWinTypes.h 12 Jun 2004 07:45:54 -0000 1.22 --- PyWinTypes.h 7 Sep 2004 04:27:04 -0000 1.23 *************** *** 291,299 **** extern PYWINTYPES_EXPORT PyTypeObject PySECURITY_ATTRIBUTESType; #define PySECURITY_ATTRIBUTES_Check(ob) ((ob)->ob_type == &PySECURITY_ATTRIBUTESType) PYWINTYPES_EXPORT PyObject *PyWinMethod_NewSECURITY_ATTRIBUTES(PyObject *self, PyObject *args); PYWINTYPES_EXPORT BOOL PyWinObject_AsSECURITY_ATTRIBUTES(PyObject *ob, SECURITY_ATTRIBUTES **ppSECURITY_ATTRIBUTES, BOOL bNoneOK = TRUE); PYWINTYPES_EXPORT PyObject *PyWinObject_FromSECURITY_ATTRIBUTES(const SECURITY_ATTRIBUTES &sa); ! /* --- 291,301 ---- extern PYWINTYPES_EXPORT PyTypeObject PySECURITY_ATTRIBUTESType; #define PySECURITY_ATTRIBUTES_Check(ob) ((ob)->ob_type == &PySECURITY_ATTRIBUTESType) + extern PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType; PYWINTYPES_EXPORT PyObject *PyWinMethod_NewSECURITY_ATTRIBUTES(PyObject *self, PyObject *args); PYWINTYPES_EXPORT BOOL PyWinObject_AsSECURITY_ATTRIBUTES(PyObject *ob, SECURITY_ATTRIBUTES **ppSECURITY_ATTRIBUTES, BOOL bNoneOK = TRUE); PYWINTYPES_EXPORT PyObject *PyWinObject_FromSECURITY_ATTRIBUTES(const SECURITY_ATTRIBUTES &sa); ! PYWINTYPES_EXPORT BOOL PyWinObject_AsDEVMODE(PyObject *ob, PDEVMODE * ppDEVMODE, BOOL bNoneOK = TRUE); ! PYWINTYPES_EXPORT PyObject *PyWinObject_FromDEVMODE(PDEVMODE); /* |
|
From: Mark H. <mha...@us...> - 2004-09-07 03:04:56
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17275 Added Files: winxpgui.d Log Message: Stub for winxpgui --- NEW FILE: winxpgui.d --- // @doc // @module winxpgui|A version of <o win32gui> built specifically for // Windows XP. See the <o win32gui> module for more details. |
|
From: Mark H. <mha...@us...> - 2004-09-07 03:04:25
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17185 Modified Files: common.mak pywin32.mak Log Message: Add winxpgui.d, and change the temp directory used Index: pywin32.mak =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pywin32.mak,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pywin32.mak 12 Jun 2004 13:40:33 -0000 1.5 --- pywin32.mak 7 Sep 2004 03:04:16 -0000 1.6 *************** *** 2,6 **** TARGET = PyWin32 ! GENDIR = ..\build\Temp\Help TITLE = Python for Win32 Extensions Help DOCHDR = Python for Win32 Extensions Reference --- 2,8 ---- TARGET = PyWin32 ! GENDIR = ..\build\temp.autoduck ! # how to get back to the build dir from $GENDIR ! MYDIR_FROM_GENDIR = ..\..\AutoDuck TITLE = Python for Win32 Extensions Help DOCHDR = Python for Win32 Extensions Reference *************** *** 37,41 **** $(GENDIR)/win32service.d $(GENDIR)/win32pipe.d $(GENDIR)/win32security.d \ $(GENDIR)/win32process.d $(GENDIR)/wincerapi.d $(GENDIR)/win32gui.d \ ! $(GENDIR)/win32inet.d WIN32COM_SOURCE = \ --- 39,44 ---- $(GENDIR)/win32service.d $(GENDIR)/win32pipe.d $(GENDIR)/win32security.d \ $(GENDIR)/win32process.d $(GENDIR)/wincerapi.d $(GENDIR)/win32gui.d \ ! $(GENDIR)/win32inet.d \ ! winxpgui.d WIN32COM_SOURCE = \ Index: common.mak =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/common.mak,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** common.mak 1 Jun 2002 08:21:23 -0000 1.8 --- common.mak 7 Sep 2004 03:04:16 -0000 1.9 *************** *** 32,36 **** if exist "..\..\..\$(TARGET).hlp" del "..\..\..\$(TARGET).hlp" move "$(TARGET).hlp" "..\..\..\$(TARGET).hlp" ! cd ..\..\..\AutoDuck # Generate a topic log file --- 32,36 ---- if exist "..\..\..\$(TARGET).hlp" del "..\..\..\$(TARGET).hlp" move "$(TARGET).hlp" "..\..\..\$(TARGET).hlp" ! cd $(MYDIR_FROM_GENDIR) # Generate a topic log file |
|
From: Mark H. <mha...@us...> - 2004-09-07 03:03:07
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17027 Modified Files: makedfromi.py Log Message: Get continuation lines for the module docstring. Index: makedfromi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/makedfromi.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** makedfromi.py 12 Jun 2004 13:35:50 -0000 1.4 --- makedfromi.py 7 Sep 2004 03:02:56 -0000 1.5 *************** *** 6,10 **** def GetComments(line, lineNo, lines): ! # Get the comment from this and continuos lines, if they exist. data = string.split(line, "//", 2) doc = "" --- 6,10 ---- def GetComments(line, lineNo, lines): ! # Get the comment from this and continuous lines, if they exist. data = string.split(line, "//", 2) doc = "" *************** *** 49,53 **** if len(extra)>1: modName = string.strip(extra[0][7:]) ! modDoc = string.strip(extra[1]) elif line[:10]=="// @pyswig": doc, lineNo = GetComments(line, lineNo, lines) --- 49,54 ---- if len(extra)>1: modName = string.strip(extra[0][7:]) ! modDoc, lineNo = GetComments(line, lineNo, lines) ! lineNo += 1 elif line[:10]=="// @pyswig": doc, lineNo = GetComments(line, lineNo, lines) |
|
From: Mark H. <mha...@us...> - 2004-09-07 02:26:30
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11255 Modified Files: win32assoc.cpp win32assoc.h win32toolbar.cpp Log Message: A couple of new toolbar methods, and prevent us looking for an existing toolbar object - we may get the wrong one when MFC pulls its tricks of reusing the underlying control as the MFC class. Index: win32assoc.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32assoc.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32assoc.h 1 Sep 1999 23:33:00 -0000 1.1 --- win32assoc.h 7 Sep 2004 02:26:20 -0000 1.2 *************** *** 44,48 **** public: // some probably shouldnt be, but... PyObject *GetGoodRet(); ! static ui_assoc_object *make( ui_type &makeType, void * search ); // Given a C++ object, return a PyObject associated (map lookup) --- 44,48 ---- public: // some probably shouldnt be, but... PyObject *GetGoodRet(); ! static ui_assoc_object *make( ui_type &makeType, void * search, bool skipLookup=false ); // Given a C++ object, return a PyObject associated (map lookup) Index: win32assoc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32assoc.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32assoc.cpp 26 Apr 2004 01:19:07 -0000 1.5 --- win32assoc.cpp 7 Sep 2004 02:26:20 -0000 1.6 *************** *** 260,267 **** } ! /*static*/ ui_assoc_object *ui_assoc_object::make( ui_type &makeType, void *search ) { ASSERT(search); // really only a C++ problem. ! ui_assoc_object* ret = (ui_assoc_object*)handleMgr.GetAssocObject(search); if (ret) { if (!ret->is_uiobject(&makeType)) --- 260,269 ---- } ! /*static*/ ui_assoc_object *ui_assoc_object::make( ui_type &makeType, void *search, bool skipLookup ) { ASSERT(search); // really only a C++ problem. ! ui_assoc_object* ret=NULL; ! if (!skipLookup) ! ret = (ui_assoc_object*) handleMgr.GetAssocObject(search); if (ret) { if (!ret->is_uiobject(&makeType)) Index: win32toolbar.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32toolbar.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32toolbar.cpp 1 Sep 1999 23:33:02 -0000 1.1 --- win32toolbar.cpp 7 Sep 2004 02:26:20 -0000 1.2 *************** *** 821,826 **** if (!pToolBar) return NULL; ! CToolBarCtrl &pTBC = pToolBar->GetToolBarCtrl(); ! return ui_assoc_object::make (PyCToolBarCtrl::type, pTBC)->GetGoodRet(); } --- 821,831 ---- if (!pToolBar) return NULL; ! CToolBarCtrl &rTBC = pToolBar->GetToolBarCtrl(); ! // Note that below we take the address of rTBC because it's a reference and not a pointer ! // and ui_assoc_object::make expects a pointer. ! // We need to create a new class and not do a map lookup because in MFC CToolBarCtrl is ! // simply a casted CToolBarCtrl (afxext.inl) so the lookup will return the PyCToolBar object ! // which will fail the type tests. ! return ui_assoc_object::make (PyCToolBarCtrl::type, &rTBC, true)->GetGoodRet(); } *************** *** 913,917 **** /* static */ CToolBarCtrl *GetToolBarCtrl (PyObject *self) { ! return (CToolBarCtrl *)ui_assoc_CObject::GetGoodCppObject( self, &PyCToolBarCtrl::type); } --- 918,925 ---- /* static */ CToolBarCtrl *GetToolBarCtrl (PyObject *self) { ! // note we can only ask for a CWnd since the same object can be both ! // a PyCToolBar and a PyCToolBarCtrl instance and their only common ! // base class is PyCWnd. Otherwise the RTTI call will fail ! return (CToolBarCtrl *)PyCWnd::GetPythonGenericWnd(self); } *************** *** 1474,1481 **** int style = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM; int id = AFX_IDW_STATUS_BAR; ! if (!PyArg_ParseTuple (args,"O|ii:CreateStatusBar", ! &parent, // @pyparm <o PyCWnd>|parent||The parent window for the status bar. &style, // @pyparm int|style|afxres.WS_CHILD \| afxres.WS_VISIBLE \| afxres.CBRS_BOTTOM|The style for the status bar. ! &id)) // @pyparm int|windowId|afxres.AFX_IDW_STATUS_BAR|The child window ID. return NULL; if (!ui_base_class::is_uiobject (parent, &PyCWnd::type)) --- 1482,1495 ---- int style = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM; int id = AFX_IDW_STATUS_BAR; ! int ctrlStyle = 0; ! if (!PyArg_ParseTuple (args,"O|iii:CreateStatusBar", ! &parent, // @pyparm <o PyCWnd>|parent||The parent window for the status bar. &style, // @pyparm int|style|afxres.WS_CHILD \| afxres.WS_VISIBLE \| afxres.CBRS_BOTTOM|The style for the status bar. ! &id, // @pyparm int|windowId|afxres.AFX_IDW_STATUS_BAR|The child window ID. ! &ctrlStyle)) // @pyparm int|ctrlStype|0|Additional styles for the creation of the embedded <o PyCStatusBarCtrl> object. ! // <nl>Status bar styles supported are:<nl>commctrl.SBARS_SIZEGRIP - The status bar control includes a ! // sizing grip at the right end of the status bar. A sizing grip is similar to a sizing border; ! // it is a rectangular area that the user can click and drag to resize the parent window. ! // <nl>commctrl.SBT_TOOLTIPS - The status bar supports tooltips. return NULL; if (!ui_base_class::is_uiobject (parent, &PyCWnd::type)) *************** *** 1494,1502 **** BOOL ok; GUI_BGN_SAVE; ! ok = sb->Create (frame, style, id); GUI_END_SAVE; if (!ok) { delete sb; ! RETURN_API_ERR("CStatusBar.Create"); } sb->m_bAutoDelete = TRUE; // let MFC handle deletion??? really?? Cloned from toolbar - not so sure about status bar!! --- 1508,1516 ---- BOOL ok; GUI_BGN_SAVE; ! ok = sb->CreateEx (frame, ctrlStyle, style, id); // @pyseemfc CStatusBar|CreateEx GUI_END_SAVE; if (!ok) { delete sb; ! RETURN_API_ERR("CStatusBar.CreateEx"); } sb->m_bAutoDelete = TRUE; // let MFC handle deletion??? really?? Cloned from toolbar - not so sure about status bar!! *************** *** 1504,1507 **** --- 1518,1561 ---- } + // @pymethod (id, style, width)|PyCStatusBar|GetPaneInfo|Returns the id, style, and width of the indicator pane at the location specified by index. + PyObject * + PyCStatusBar_GetPaneInfo( PyObject *self, PyObject *args ) + { + CStatusBar *pStatusBar = PyCStatusBar::GetStatusBar(self); + if (!pStatusBar) return NULL; + + UINT nIndex; + if (!PyArg_ParseTuple (args,"i:GetPaneInfo", + &nIndex)) // @pyparm int|index||Index of the pane whose information is to be retrieved. + return NULL; + + UINT nID; + UINT nStyle; + int cxWidth; + + GUI_BGN_SAVE; + pStatusBar->GetPaneInfo(nIndex, nID, nStyle, cxWidth); // @pyseemfc CStatusBar|GetPaneInfo + GUI_END_SAVE; + + return Py_BuildValue ("(iii)", nID, nStyle, cxWidth); + } + + // @pymethod <o PyCStatusBarCtrl>|PyCStatusBar|GetStatusBarCtrl|Gets the statusbar control object for the statusbar. + PyObject * + PyCStatusBar_GetStatusBarCtrl( PyObject *self, PyObject *args ) + { + CHECK_NO_ARGS (args); + CStatusBar *pStatusBar = PyCStatusBar::GetStatusBar(self); + if (!pStatusBar) return NULL; + + CStatusBarCtrl &rSBC = pStatusBar->GetStatusBarCtrl(); // @pyseemfc CStatusBar|GetStatusBarCtrl + // Note that below we take the address of rTBC because it's a reference and not a pointer + // and ui_assoc_object::make expects a pointer. + // We need to create a new class and not do a map lookup because in MFC CToolBarCtrl is + // simply a casted CToolBarCtrl (afxext.inl) so the lookup will return the PyCToolBar object + // which will fail the type tests. + return ui_assoc_object::make (PyCStatusBarCtrl::type, &rSBC, true)->GetGoodRet(); + } + // @pymethod |PyCStatusBar|SetIndicators|Sets each indicator's ID. PyObject * *************** *** 1537,1545 **** --- 1591,1627 ---- } + // @pymethod |PyCStatusBar|SetPaneInfo|Sets the specified indicator pane to a new ID, style, and width. + PyObject * + PyCStatusBar_SetPaneInfo( PyObject *self, PyObject *args ) + { + CStatusBar *pStatusBar = PyCStatusBar::GetStatusBar(self); + if (!pStatusBar) return NULL; + + UINT nIndex; + UINT nID; + UINT nStyle; + int cxWidth; + if (!PyArg_ParseTuple (args,"iiii:SetPaneInfo", + &nIndex, // @pyparm int|index||Index of the indicator pane whose style is to be set. + &nID, // @pyparm int|id||New ID for the indicator pane. + &nStyle, // @pyparm int|style||New style for the indicator pane.<nl>The following indicator styles are supported:<nl>afxres.SBPS_NOBORDERS - No 3-D border around the pane.<nl>afxres.SBPS_POPOUT - Reverse border so that text "pops out."<nl>afxres.SBPS_DISABLED - Do not draw text.<nl>afxres.SBPS_STRETCH - Stretch pane to fill unused space. Only one pane per status bar can have this style.<nl>afxres.SBPS_NORMAL - No stretch, borders, or pop-out. + &cxWidth)) // @pyparm int|width||New width for the indicator pane. + return NULL; + + GUI_BGN_SAVE; + pStatusBar->SetPaneInfo(nIndex, nID, nStyle, cxWidth); // @pyseemfc CStatusBar|SetPaneInfo + GUI_END_SAVE; + + RETURN_NONE; + } + // @object PyCStatusBar|A class which encapsulates an MFC <o CStatusBar>. Derived from a <o PyCControlBar> object. static struct PyMethodDef PyCStatusBar_methods[] = { + {"GetPaneInfo", PyCStatusBar_GetPaneInfo, 1}, // @pymeth GetPaneInfo|Returns indicator ID, style, and width for a given pane index. + {"GetStatusBarCtrl", PyCStatusBar_GetStatusBarCtrl, 1}, // @pymeth GetStatusBarCtrl|Returns the status bar control object associated with the status bar. {"SetIndicators", PyCStatusBar_SetIndicators, 1}, // @pymeth SetIndicators|Sets each indicator's ID. + {"SetPaneInfo", PyCStatusBar_SetPaneInfo, 1}, // @pymeth SetPaneInfo|Sets indicator ID, style, and width for a given pane index. { NULL, NULL } }; |
|
From: Mark H. <mha...@us...> - 2004-09-07 02:23:58
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10984 Modified Files: debugger.py Log Message: Don't die if the foreground window when we started debugging no longer exists when we end. Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** debugger.py 7 Feb 2004 02:06:56 -0000 1.12 --- debugger.py 7 Sep 2004 02:23:49 -0000 1.13 *************** *** 833,838 **** Returns non zero if we are allowed to stop interacting""" if self.oldForeground is not None: ! win32ui.GetMainFrame().EnableWindow(self.oldFrameEnableState) ! self.oldForeground.EnableWindow(1) # self.oldForeground.SetForegroundWindow() - fails?? if not self.inForcedGUI: --- 833,842 ---- Returns non zero if we are allowed to stop interacting""" if self.oldForeground is not None: ! try: ! win32ui.GetMainFrame().EnableWindow(self.oldFrameEnableState) ! self.oldForeground.EnableWindow(1) ! except win32ui.error: ! # old window may be dead. ! pass # self.oldForeground.SetForegroundWindow() - fails?? if not self.inForcedGUI: |
|
From: Mark H. <mha...@us...> - 2004-09-07 02:20:52
|
Update of /cvsroot/pywin32/pywin32/pyisapi/isapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10537/isapi Modified Files: install.py Log Message: Make everything work in a py2exe environment. Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/install.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** install.py 5 Sep 2004 08:13:52 -0000 1.3 --- install.py 7 Sep 2004 02:20:43 -0000 1.4 *************** *** 332,345 **** # What to do? The .dll knows its name, but this is likely to be # executed via a .exe, which does not know. ! # For now, we strip everything past the last underscore in the ! # executable name - this will work so long as you don't override ! # the dest_base for the DLL itself. ! base, ext = os.path.splitext(os.path.abspath(sys.argv[0])) path, base = os.path.split(base) ! try: ! base = base[:base.rindex("_")] ! except ValueError: ! pass ! dll_name = os.path.join(path, base + ".dll") else: base, ext = os.path.splitext(mod_name) --- 332,344 ---- # What to do? The .dll knows its name, but this is likely to be # executed via a .exe, which does not know. ! base, ext = os.path.splitext(mod_name) path, base = os.path.split(base) ! # handle the common case of 'foo.exe'/'foow.exe' ! if base.endswith('w'): ! base = base[:-1] ! # For py2exe, we have '_foo.dll' as the standard pyisapi loader - but ! # 'foo.dll' is what we use (it just delegates). ! # So no leading '_' on the installed name. ! dll_name = os.path.abspath(os.path.join(path, base + ".dll")) else: base, ext = os.path.splitext(mod_name) |
|
From: Mark H. <mha...@us...> - 2004-09-07 02:20:52
|
Update of /cvsroot/pywin32/pywin32/pyisapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10537/src Modified Files: PythonEng.cpp Log Message: Make everything work in a py2exe environment. Index: PythonEng.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/pyisapi/src/PythonEng.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonEng.cpp 4 Sep 2004 09:28:50 -0000 1.2 --- PythonEng.cpp 7 Sep 2004 02:20:43 -0000 1.3 *************** *** 108,120 **** // find out where our DLL/EXE module lives // NOTE: the long file name does not get returned (don't know why) ! if (!g_IsFrozen) { ! ::GetModuleFileName(g_hInstance, szFilePath, sizeof(szFilePath)); ! ::_splitpath( szFilePath, NULL, NULL, szBase, NULL); ! module_name = szBase + 1; // skip first char. ! } else { ! // When frozen, the module is always called 'PyISAPI_config' ! strcpy(szBase, "pyISAPI_config.py"); ! module_name = szBase; ! } } strncpy(m_module_name, module_name, sizeof(m_module_name)/sizeof(m_module_name[0])); --- 108,114 ---- // find out where our DLL/EXE module lives // NOTE: the long file name does not get returned (don't know why) ! ::GetModuleFileName(g_hInstance, szFilePath, sizeof(szFilePath)); ! ::_splitpath( szFilePath, NULL, NULL, szBase, NULL); ! module_name = szBase + 1; // skip first char. } strncpy(m_module_name, module_name, sizeof(m_module_name)/sizeof(m_module_name[0])); |
|
From: Mark H. <mha...@us...> - 2004-09-07 02:19:38
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10047/include Modified Files: PythonCOM.h Log Message: The gateway/server functions all now will write exception to a win32com.logger object if it exists (or to sys.stdout, like previously, if it does not). By default, no win32com.logger is created - this is designed for people who want integrated logging for their entire Python application. Index: PythonCOM.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOM.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PythonCOM.h 22 Jun 2004 01:25:50 -0000 1.20 --- PythonCOM.h 7 Sep 2004 02:19:27 -0000 1.21 *************** *** 314,317 **** --- 314,329 ---- PYCOM_EXPORT void PyCom_LogNonServerError(const char *fmt, ...); + // Log an error to a Python logger object if one can be found, or + // to stderr if no log available. + // If logProvider is not NULL, we will call a "_GetLogger_()" method on it. + // If logProvider is NULL, we attempt to fetch "win32com.logger". + // If they do not exist, return None, or raise an error fetching them + // (or even writing to them once fetched), the message still goes to stderr. + // NOTE: By default, win32com does *not* provide a logger. + PYCOM_EXPORT void PyCom_LoggerNonServerException(PyObject *logProvider, + const char *fmt, ...); + + PYCOM_EXPORT void PyCom_LoggerException(PyObject *logProvider, const char *fmt, ...); + // Write a raw string to the error device. PYCOM_EXPORT void PyCom_StreamMessage(const char *msg); *************** *** 327,330 **** --- 339,343 ---- // Set a COM exception, logging the exception if not an explicitly raised 'server' exception PYCOM_EXPORT HRESULT PyCom_SetAndLogCOMErrorFromPyException(const char *methodName, REFIID riid /* = IID_NULL */); + PYCOM_EXPORT HRESULT PyCom_SetAndLogCOMErrorFromPyExceptionEx(PyObject *provider, const char *methodName, REFIID riid /* = IID_NULL */); // Used in gateways to SetErrorInfo() with a simple HRESULT, then return it. |
|
From: Mark H. <mha...@us...> - 2004-09-07 02:19:38
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10047 Modified Files: ErrorUtils.cpp PyGatewayBase.cpp Log Message: The gateway/server functions all now will write exception to a win32com.logger object if it exists (or to sys.stdout, like previously, if it does not). By default, no win32com.logger is created - this is designed for people who want integrated logging for their entire Python application. Index: PyGatewayBase.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyGatewayBase.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PyGatewayBase.cpp 2 Jul 2004 04:04:54 -0000 1.13 --- PyGatewayBase.cpp 7 Sep 2004 02:19:27 -0000 1.14 *************** *** 23,27 **** // Helper function to handle the IDispatch results ! static HRESULT GetIDispatchErrorResult(EXCEPINFO *pexcepinfo) { HRESULT hr; --- 23,27 ---- // Helper function to handle the IDispatch results ! static HRESULT GetIDispatchErrorResult(PyObject *logProvider, EXCEPINFO *pexcepinfo) { HRESULT hr; *************** *** 34,38 **** bCleanupExcepInfo = FALSE; // Log the error ! PyCom_LogNonServerError("Python error invoking COM method."); // Fill the EXCEPINFO with the details. --- 34,38 ---- bCleanupExcepInfo = FALSE; // Log the error ! PyCom_LoggerNonServerException(logProvider, "Python error invoking COM method."); // Fill the EXCEPINFO with the details. *************** *** 444,447 **** --- 444,448 ---- static HRESULT invoke_finish( + PyObject *dispatcher, /* The dispatcher for the gateway */ PyObject *result, /* The PyObject returned from the Python call */ VARIANT FAR* pVarResult, /* Result variant passed by the caller */ *************** *** 578,582 **** // clears the Python error condition. if (PyErr_Occurred()) ! hr = GetIDispatchErrorResult(einfo); Py_DECREF(result); --- 579,583 ---- // clears the Python error condition. if (PyErr_Occurred()) ! hr = GetIDispatchErrorResult(dispatcher, einfo); Py_DECREF(result); *************** *** 638,644 **** if ( result==NULL ) ! return GetIDispatchErrorResult(pexcepinfo); else ! hr = invoke_finish(result, pVarResult, puArgErr, pexcepinfo, IID_IDispatch, params, true); } return hr; --- 639,645 ---- if ( result==NULL ) ! return GetIDispatchErrorResult(m_pPyObject, pexcepinfo); else ! hr = invoke_finish(m_pPyObject, result, pVarResult, puArgErr, pexcepinfo, IID_IDispatch, params, true); } return hr; *************** *** 704,708 **** PyObject *obISP = PyCom_PyObjectFromIUnknown(pspCaller, IID_IServiceProvider, TRUE); if (obISP==NULL) ! return GetIDispatchErrorResult(pexcepinfo); PyObject *argList; --- 705,709 ---- PyObject *obISP = PyCom_PyObjectFromIUnknown(pspCaller, IID_IServiceProvider, TRUE); if (obISP==NULL) ! return GetIDispatchErrorResult(m_pPyObject, pexcepinfo); PyObject *argList; *************** *** 722,728 **** if ( result==NULL ) ! hr = GetIDispatchErrorResult(pexcepinfo); else { ! hr = invoke_finish(result, pVarResult, NULL, pexcepinfo, IID_IDispatchEx, params, false); } } --- 723,729 ---- if ( result==NULL ) ! hr = GetIDispatchErrorResult(m_pPyObject, pexcepinfo); else { ! hr = invoke_finish(m_pPyObject, result, pVarResult, NULL, pexcepinfo, IID_IDispatchEx, params, false); } } *************** *** 909,915 **** va_end(va); ! if (result==NULL) ! PyCom_LogNonServerError("Python error calling method %s\n", szMethodName); ! HRESULT hr = PyCom_SetAndLogCOMErrorFromPyException(szMethodName, GetIID()); if ( ppResult ) --- 910,914 ---- va_end(va); ! HRESULT hr = PyCom_SetAndLogCOMErrorFromPyExceptionEx(m_pPyObject, szMethodName, GetIID()); if ( ppResult ) Index: ErrorUtils.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/ErrorUtils.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ErrorUtils.cpp 24 Nov 2003 09:14:53 -0000 1.20 --- ErrorUtils.cpp 7 Sep 2004 02:19:27 -0000 1.21 *************** *** 21,24 **** --- 21,26 ---- static PyObject *PyCom_PyObjectFromIErrorInfo(IErrorInfo *, HRESULT errorhr); + static const char *traceback_prefix = "Traceback (most recent call last):\n"; + //////////////////////////////////////////////////////////////////////// // *************** *** 346,349 **** --- 348,360 ---- } + PYCOM_EXPORT HRESULT PyCom_SetAndLogCOMErrorFromPyExceptionEx(PyObject *provider, const char *methodName, REFIID riid /* = IID_NULL */) + { + if (!PyErr_Occurred()) + // No error occurred + return S_OK; + PyCom_LoggerNonServerException(provider, "Unexpected exception in gateway method '%s'", methodName); + return PyCom_SetCOMErrorFromPyException(riid); + } + //////////////////////////////////////////////////////////////////////// // Some logging functions *************** *** 458,461 **** --- 469,512 ---- PyErr_Restore(typ, val, tb); } + BOOL VLogF_Logger(PyObject *logger, const char *log_method, + const TCHAR *prefix, const TCHAR *fmt, va_list argptr) + { + // Protected by Python lock + static TCHAR buff[8196]; + int buf_len = sizeof(buff) / sizeof(buff[0]); + int prefix_len = strlen(prefix); + assert(prefix_len<100); + strcpy(buff, prefix); + wvsprintf(buff+prefix_len, fmt, argptr); + + PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL; + PyErr_Fetch( &exc_typ, &exc_val, &exc_tb); + + // Python 2.3 has an issue in that attempting to make the call with + // an exception set causes the call itself to fail - but + // 2.3's logger provides no way of passing the exception! + // We make no attempt to worm around this - if you really want this feature + // in Python 2.3, simply use the Python 2.4 logging package (or at least + // a logger from that package) + PyObject *kw = PyDict_New(); + PyObject *exc_info = Py_BuildValue("OOO", exc_typ, exc_val, exc_tb); + if (kw) + PyDict_SetItemString(kw, "exc_info", exc_info); + Py_XDECREF(exc_info); + PyObject *args = Py_BuildValue("(s)", buff); + PyObject *method = PyObject_GetAttrString(logger, (char *)log_method); + PyObject *result = NULL; + if (method && kw && args) + result = PyObject_Call(method, args, kw); + Py_XDECREF(method); + Py_XDECREF(kw); + Py_XDECREF(args); + if (!result) + PyErr_Print(); + BOOL rc = result != NULL; + Py_XDECREF(result); + PyErr_Restore( exc_typ, exc_val, exc_tb); + return rc; + } void VLogF(const TCHAR *fmt, va_list argptr) *************** *** 484,488 **** PyCom_StreamMessage("Can't get the traceback info!"); else { ! PyCom_StreamMessage("Traceback (most recent call last):\n"); PyCom_StreamMessage(szTraceback); PyMem_Free((void *)szTraceback); --- 535,539 ---- PyCom_StreamMessage("Can't get the traceback info!"); else { ! PyCom_StreamMessage(traceback_prefix); PyCom_StreamMessage(szTraceback); PyMem_Free((void *)szTraceback); *************** *** 507,517 **** } ! PYCOM_EXPORT ! void PyCom_LogError(const char *fmt, ...) { - va_list marker; - va_start(marker, fmt); PyCom_StreamMessage("pythoncom error: "); ! VLogF(fmt, marker); PyCom_StreamMessage("\n"); // If we have a Python exception, also log that: --- 558,565 ---- } ! void _DoLogError(const char *fmt, va_list argptr) { PyCom_StreamMessage("pythoncom error: "); ! VLogF(fmt, argptr); PyCom_StreamMessage("\n"); // If we have a Python exception, also log that: *************** *** 520,523 **** --- 568,572 ---- if (exc_typ) { PyErr_NormalizeException( &exc_typ, &exc_val, &exc_tb); + PyCom_StreamMessage("\n"); _LogException(exc_typ, exc_val, exc_tb); } *************** *** 525,551 **** } - PYCOM_EXPORT ! void PyCom_LogNonServerError(const char *fmt, ...) { ! // See if our gateway exception PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL; PyErr_Fetch( &exc_typ, &exc_val, &exc_tb); if (exc_typ) { PyErr_NormalizeException( &exc_typ, &exc_val, &exc_tb); ! if (!PyErr_GivenExceptionMatches(exc_val, PyWinExc_COMError) || ! ((PyInstance_Check(exc_val) && ! (PyObject *)(((PyInstanceObject *)exc_val)->in_class)==PyWinExc_COMError))) { ! va_list marker; ! va_start(marker, fmt); ! PyCom_StreamMessage("pythoncom error: "); ! VLogF(fmt, marker); ! PyCom_StreamMessage("\n"); ! _LogException(exc_typ, exc_val, exc_tb); } } PyErr_Restore(exc_typ, exc_val, exc_tb); } //////////////////////////////////////////////////////////////////////// --- 574,654 ---- } PYCOM_EXPORT ! void PyCom_LogError(const char *fmt, ...) { ! va_list marker; ! va_start(marker, fmt); ! _DoLogError(fmt, marker); ! } ! ! BOOL IsNonServerErrorCurrent() { ! BOOL rc = FALSE; PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL; PyErr_Fetch( &exc_typ, &exc_val, &exc_tb); if (exc_typ) { PyErr_NormalizeException( &exc_typ, &exc_val, &exc_tb); ! rc = (!PyErr_GivenExceptionMatches(exc_val, PyWinExc_COMError) || ! ((PyInstance_Check(exc_val) && ! (PyObject *)(((PyInstanceObject *)exc_val)->in_class)==PyWinExc_COMError))); ! } ! PyErr_Restore(exc_typ, exc_val, exc_tb); ! return rc; ! } ! ! PYCOM_EXPORT ! void PyCom_LogNonServerError(const char *fmt, ...) ! { ! // If any error other than our explicit 'com server error' is current, ! // assume it is unintended, and log it. ! if (IsNonServerErrorCurrent()) { ! va_list marker; ! va_start(marker, fmt); ! _DoLogError(fmt, marker); ! } ! } ! ! void _DoLogger(PyObject *logProvider, char *log_method, const char *fmt, va_list argptr) ! { ! PyObject *exc_typ = NULL, *exc_val = NULL, *exc_tb = NULL; ! PyErr_Fetch( &exc_typ, &exc_val, &exc_tb); ! PyObject *logger = NULL; ! if (logProvider) ! logger = PyObject_CallMethod(logProvider, "_GetLogger_", NULL); ! if (logger == NULL) { ! PyObject *mod = PyImport_ImportModule("win32com"); ! if (mod) { ! logger = PyObject_GetAttrString(mod, "logger"); ! Py_DECREF(mod); } } + // Returning a logger of None means "no logger" + if (logger == Py_None) { + Py_DECREF(logger); + logger = NULL; + } PyErr_Restore(exc_typ, exc_val, exc_tb); + if (!logger || + !VLogF_Logger(logger, log_method, "pythoncom error: ", fmt, argptr)) + // No logger, or logger error - normal stdout stream. + _DoLogError(fmt, argptr); + Py_XDECREF(logger); } + PYCOM_EXPORT void PyCom_LoggerException(PyObject *logProvider, const char *fmt, ...) + { + va_list marker; + va_start(marker, fmt); + _DoLogger(logProvider, "error", fmt, marker); + } + + PYCOM_EXPORT + void PyCom_LoggerNonServerException(PyObject *logProvider, const char *fmt, ...) + { + if (!IsNonServerErrorCurrent()) + return; + va_list marker; + va_start(marker, fmt); + _DoLogger(logProvider, "error", fmt, marker); + } //////////////////////////////////////////////////////////////////////// |