[pywin32-checkins] pywin32/Pythonwin win32assoc.h, 1.3, 1.4 win32assoc.cpp, 1.12, 1.13
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-03-04 23:49:09
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28924 Modified Files: win32assoc.h win32assoc.cpp Log Message: Add GetAttachedObject to ui_assoc_objects. Index: win32assoc.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32assoc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32assoc.h 8 Jan 2009 22:11:52 -0000 1.3 --- win32assoc.h 4 Mar 2009 23:48:56 -0000 1.4 *************** *** 64,67 **** --- 64,68 ---- // methods static PyObject *AttachObject(PyObject *self, PyObject *args); + static PyObject *GetAttachedObject(PyObject *self, PyObject *args); PyObject *virtualInst; Index: win32assoc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32assoc.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32assoc.cpp 8 Jan 2009 22:11:52 -0000 1.12 --- win32assoc.cpp 4 Mar 2009 23:48:57 -0000 1.13 *************** *** 237,243 **** --- 237,259 ---- } + // @pymethod object|PyAssocObject|GetAttachedObject|Returned the attached Python object, or None. + PyObject * + ui_assoc_object::GetAttachedObject(PyObject *self, PyObject *args) + { + ui_assoc_object *pAssoc = (ui_assoc_object *)self; + if (pAssoc==NULL) return NULL; + if (!PyArg_ParseTuple(args, ":GetAttachedObject")) + return NULL; + PyObject *ob = pAssoc->virtualInst; + if (!ob) + ob = Py_None; + Py_INCREF(ob); + return ob; + } + // @object PyAssocObject|An internal class. static struct PyMethodDef PyAssocObject_methods[] = { {"AttachObject", ui_assoc_object::AttachObject, 1 }, // @pymeth AttachObject|Attaches a Python object for lookup of "virtual" functions. + {"GetAttachedObject", ui_assoc_object::GetAttachedObject, 1 }, // @pymeth GetAttachedObject|Returned the attached Python object, or None. {NULL, NULL} }; |