Mercurial > vim
diff src/if_python3.c @ 4593:0cf552b325b5 v7.3.1044
updated for version 7.3.1044
Problem: Python: No {Buffer,TabPage,Window}.valid attributes.
Solution: Python patch 5: add .valid (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 29 May 2013 22:15:30 +0200 |
parents | fa39483a1363 |
children | 89bec74fd793 |
line wrap: on
line diff
--- a/src/if_python3.c +++ b/src/if_python3.c @@ -1067,12 +1067,15 @@ static PyMappingMethods BufferAsMapping */ static PyObject * -BufferGetattro(PyObject *self, PyObject*nameobj) +BufferGetattro(PyObject *self, PyObject *nameobj) { PyObject *r; GET_ATTR_STRING(name, nameobj); + if ((r = BufferAttrValid((BufferObject *)(self), name))) + return r; + if (CheckBuffer((BufferObject *)(self))) return NULL; @@ -1094,8 +1097,9 @@ BufferSetattro(PyObject *self, PyObject static PyObject * BufferDir(PyObject *self UNUSED) { - return Py_BuildValue("[sssss]", "name", "number", - "append", "mark", "range"); + return Py_BuildValue("[ssssssss]", + "name", "number", "vars", "options", "valid", + "append", "mark", "range"); } /******************/ @@ -1283,6 +1287,9 @@ TabPageGetattro(PyObject *self, PyObject GET_ATTR_STRING(name, nameobj); + if ((r = TabPageAttrValid((TabPageObject *)(self), name))) + return r; + if (CheckTabPage((TabPageObject *)(self))) return NULL; @@ -1303,6 +1310,9 @@ WindowGetattro(PyObject *self, PyObject GET_ATTR_STRING(name, nameobj); + if ((r = WindowAttrValid((WindowObject *)(self), name))) + return r; + if (CheckWindow((WindowObject *)(self))) return NULL;