[pywin32-checkins] pywin32/win32/src win32gui.i,1.103,1.104
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2007-03-28 12:29:34
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25289/win32/src Modified Files: win32gui.i Log Message: Provide useful info in a TypeError relating to OPENFILENAME and document return/exception semantics for GetOpenFileNameW Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** win32gui.i 5 Mar 2007 05:55:47 -0000 1.103 --- win32gui.i 28 Mar 2007 12:29:33 -0000 1.104 *************** *** 3562,3568 **** %typemap (python, in) OPENFILENAME *INPUT (int size){ size = sizeof(OPENFILENAME); ! /* $source = PyObject_Str($source); */ ! if ( (! PyString_Check($source)) || (size != PyString_GET_SIZE($source)) ) { ! PyErr_Format(PyExc_TypeError, "Argument must be a %d-byte string", size); return NULL; } --- 3562,3573 ---- %typemap (python, in) OPENFILENAME *INPUT (int size){ size = sizeof(OPENFILENAME); ! if (!PyString_Check($source)) { ! PyErr_Format(PyExc_TypeError, "Argument must be a %d-byte string (got type %s)", ! size, $source->ob_type->tp_name); ! return NULL; ! } ! if (size != PyString_GET_SIZE($source)) { ! PyErr_Format(PyExc_TypeError, "Argument must be a %d-byte string (got string of %d bytes)", ! size, PyString_GET_SIZE($source)); return NULL; } *************** *** 6108,6111 **** --- 6113,6119 ---- // @comm Accepts keyword arguments, all arguments optional // Input parameters and return values are identical to <om win32gui.GetSaveFileNameW> + // @rdesc The result is a tuple of (filename, filter, flags), where the first 2 elements are + // unicode strings, and the last an integer. If the user presses cancel or an error occurs, a + // win32gui.error is raised (and if the user pressed cancel, the error number will be zero) static PyObject *PyGetOpenFileNameW(PyObject *self, PyObject *args, PyObject *kwargs) { |