|
Karsten Hopp |
8b6534 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
8b6534 |
Subject: Patch 7.3.672
|
|
Karsten Hopp |
8b6534 |
Fcc: outbox
|
|
Karsten Hopp |
8b6534 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
8b6534 |
Mime-Version: 1.0
|
|
Karsten Hopp |
8b6534 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
8b6534 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
8b6534 |
------------
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
Patch 7.3.672
|
|
Karsten Hopp |
8b6534 |
Problem: Not possible to lock/unlock lists in Python interface.
|
|
Karsten Hopp |
8b6534 |
Solution: Add .locked and .scope attributes. (ZyX)
|
|
Karsten Hopp |
8b6534 |
Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python.c,
|
|
Karsten Hopp |
8b6534 |
src/if_python3.c, src/testdir/test86.in, src/testdir/test86.ok,
|
|
Karsten Hopp |
8b6534 |
src/testdir/test87.in, src/testdir/test87.ok
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/runtime/doc/if_pyth.txt 2012-06-29 12:54:32.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- runtime/doc/if_pyth.txt 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 27,33 ****
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
*:python* *:py* *E205* *E263* *E264*
|
|
Karsten Hopp |
8b6534 |
:[range]py[thon] {stmt}
|
|
Karsten Hopp |
8b6534 |
! Execute Python statement {stmt}.
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
:[range]py[thon] << {endmarker}
|
|
Karsten Hopp |
8b6534 |
{script}
|
|
Karsten Hopp |
8b6534 |
--- 27,35 ----
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
*:python* *:py* *E205* *E263* *E264*
|
|
Karsten Hopp |
8b6534 |
:[range]py[thon] {stmt}
|
|
Karsten Hopp |
8b6534 |
! Execute Python statement {stmt}. A simple check if
|
|
Karsten Hopp |
8b6534 |
! the `:python` command is working: >
|
|
Karsten Hopp |
8b6534 |
! :python print "Hello"
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
:[range]py[thon] << {endmarker}
|
|
Karsten Hopp |
8b6534 |
{script}
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 157,162 ****
|
|
Karsten Hopp |
8b6534 |
--- 159,184 ----
|
|
Karsten Hopp |
8b6534 |
vimlist or vimdictionary python type that are connected to original
|
|
Karsten Hopp |
8b6534 |
list or dictionary. Thus modifications to these objects imply
|
|
Karsten Hopp |
8b6534 |
modifications of the original.
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ Additionally, vimlist and vimdictionary type have read-write
|
|
Karsten Hopp |
8b6534 |
+ `.locked` attribute that returns
|
|
Karsten Hopp |
8b6534 |
+ Value Meaning ~
|
|
Karsten Hopp |
8b6534 |
+ zero Variable is not locked
|
|
Karsten Hopp |
8b6534 |
+ vim.VAR_LOCKED Variable is locked, but can be unlocked
|
|
Karsten Hopp |
8b6534 |
+ vim.VAR_FIXED Variable is locked and can’t be unlocked
|
|
Karsten Hopp |
8b6534 |
+ integer constants. If variable is not fixed, you can do
|
|
Karsten Hopp |
8b6534 |
+ `var.locked=True` to lock it and `var.locked=False` to unlock.
|
|
Karsten Hopp |
8b6534 |
+ There is no recursive locking like |:lockvar|! does. There is also
|
|
Karsten Hopp |
8b6534 |
+ no way to lock a specific key or check whether it is locked (in any
|
|
Karsten Hopp |
8b6534 |
+ case these locks are ignored by anything except |:let|: |extend()|
|
|
Karsten Hopp |
8b6534 |
+ does not care, neither does python interface).
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ Vimdictionary type also supports `.scope` attribute which is one of
|
|
Karsten Hopp |
8b6534 |
+ Value Meaning ~
|
|
Karsten Hopp |
8b6534 |
+ zero Dictionary is not a scope one
|
|
Karsten Hopp |
8b6534 |
+ vim.VAR_DEF_SCOPE Function-local or global scope dictionary
|
|
Karsten Hopp |
8b6534 |
+ vim.VAR_SCOPE Other scope dictionary
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
2. if expression evaluates to a function reference, then it returns
|
|
Karsten Hopp |
8b6534 |
callable vimfunction object. Use self keyword argument to assign
|
|
Karsten Hopp |
8b6534 |
|self| object for dictionary functions.
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 362,369 ****
|
|
Karsten Hopp |
8b6534 |
8. Python 3 *python3*
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
*:py3* *:python3*
|
|
Karsten Hopp |
8b6534 |
! The |:py3| and |:python3| commands work similar to |:python|.
|
|
Karsten Hopp |
8b6534 |
! *:py3file*
|
|
Karsten Hopp |
8b6534 |
The |:py3file| command works similar to |:pyfile|.
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
--- 384,393 ----
|
|
Karsten Hopp |
8b6534 |
8. Python 3 *python3*
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
*:py3* *:python3*
|
|
Karsten Hopp |
8b6534 |
! The |:py3| and |:python3| commands work similar to |:python|. A simple check
|
|
Karsten Hopp |
8b6534 |
! if the `:py3` command is wrong: >
|
|
Karsten Hopp |
8b6534 |
! :py3 print("Hello")
|
|
Karsten Hopp |
8b6534 |
! < *:py3file*
|
|
Karsten Hopp |
8b6534 |
The |:py3file| command works similar to |:pyfile|.
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/if_py_both.h 2012-09-21 13:45:57.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/if_py_both.h 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 808,813 ****
|
|
Karsten Hopp |
8b6534 |
--- 808,851 ----
|
|
Karsten Hopp |
8b6534 |
}
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
static PyInt
|
|
Karsten Hopp |
8b6534 |
+ DictionarySetattr(DictionaryObject *self, char *name, PyObject *val)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ if (val == NULL)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ if (strcmp(name, "locked") == 0)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ if (self->dict->dv_lock == VAR_FIXED)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ else
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ if (!PyBool_Check(val))
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ if (val == Py_True)
|
|
Karsten Hopp |
8b6534 |
+ self->dict->dv_lock = VAR_LOCKED;
|
|
Karsten Hopp |
8b6534 |
+ else
|
|
Karsten Hopp |
8b6534 |
+ self->dict->dv_lock = 0;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ return 0;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ else
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ static PyInt
|
|
Karsten Hopp |
8b6534 |
DictionaryLength(PyObject *self)
|
|
Karsten Hopp |
8b6534 |
{
|
|
Karsten Hopp |
8b6534 |
return ((PyInt) ((((DictionaryObject *)(self))->dict->dv_hashtab.ht_used)));
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1271,1276 ****
|
|
Karsten Hopp |
8b6534 |
--- 1309,1352 ----
|
|
Karsten Hopp |
8b6534 |
return self;
|
|
Karsten Hopp |
8b6534 |
}
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
+ static int
|
|
Karsten Hopp |
8b6534 |
+ ListSetattr(ListObject *self, char *name, PyObject *val)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ if (val == NULL)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ if (strcmp(name, "locked") == 0)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ if (self->list->lv_lock == VAR_FIXED)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed list"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ else
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ if (!PyBool_Check(val))
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ if (val == Py_True)
|
|
Karsten Hopp |
8b6534 |
+ self->list->lv_lock = VAR_LOCKED;
|
|
Karsten Hopp |
8b6534 |
+ else
|
|
Karsten Hopp |
8b6534 |
+ self->list->lv_lock = 0;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ return 0;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ else
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute"));
|
|
Karsten Hopp |
8b6534 |
+ return -1;
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
static struct PyMethodDef ListMethods[] = {
|
|
Karsten Hopp |
8b6534 |
{"extend", (PyCFunction)ListConcatInPlace, METH_O, ""},
|
|
Karsten Hopp |
8b6534 |
{ NULL, NULL, 0, NULL }
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/if_python.c 2012-09-21 13:45:57.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/if_python.c 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 163,168 ****
|
|
Karsten Hopp |
8b6534 |
--- 163,169 ----
|
|
Karsten Hopp |
8b6534 |
# define PyInt_FromLong dll_PyInt_FromLong
|
|
Karsten Hopp |
8b6534 |
# define PyLong_AsLong dll_PyLong_AsLong
|
|
Karsten Hopp |
8b6534 |
# define PyLong_FromLong dll_PyLong_FromLong
|
|
Karsten Hopp |
8b6534 |
+ # define PyBool_Type (*dll_PyBool_Type)
|
|
Karsten Hopp |
8b6534 |
# define PyInt_Type (*dll_PyInt_Type)
|
|
Karsten Hopp |
8b6534 |
# define PyLong_Type (*dll_PyLong_Type)
|
|
Karsten Hopp |
8b6534 |
# define PyList_GetItem dll_PyList_GetItem
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 221,226 ****
|
|
Karsten Hopp |
8b6534 |
--- 222,229 ----
|
|
Karsten Hopp |
8b6534 |
# define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented)
|
|
Karsten Hopp |
8b6534 |
# endif
|
|
Karsten Hopp |
8b6534 |
# define _Py_NoneStruct (*dll__Py_NoneStruct)
|
|
Karsten Hopp |
8b6534 |
+ # define _Py_ZeroStruct (*dll__Py_ZeroStruct)
|
|
Karsten Hopp |
8b6534 |
+ # define _Py_TrueStruct (*dll__Py_TrueStruct)
|
|
Karsten Hopp |
8b6534 |
# define PyObject_Init dll__PyObject_Init
|
|
Karsten Hopp |
8b6534 |
# define PyObject_GetIter dll_PyObject_GetIter
|
|
Karsten Hopp |
8b6534 |
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 263,268 ****
|
|
Karsten Hopp |
8b6534 |
--- 266,272 ----
|
|
Karsten Hopp |
8b6534 |
static PyObject*(*dll_PyInt_FromLong)(long);
|
|
Karsten Hopp |
8b6534 |
static long(*dll_PyLong_AsLong)(PyObject *);
|
|
Karsten Hopp |
8b6534 |
static PyObject*(*dll_PyLong_FromLong)(long);
|
|
Karsten Hopp |
8b6534 |
+ static PyTypeObject* dll_PyBool_Type;
|
|
Karsten Hopp |
8b6534 |
static PyTypeObject* dll_PyInt_Type;
|
|
Karsten Hopp |
8b6534 |
static PyTypeObject* dll_PyLong_Type;
|
|
Karsten Hopp |
8b6534 |
static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt);
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 320,325 ****
|
|
Karsten Hopp |
8b6534 |
--- 324,331 ----
|
|
Karsten Hopp |
8b6534 |
static iternextfunc dll__PyObject_NextNotImplemented;
|
|
Karsten Hopp |
8b6534 |
# endif
|
|
Karsten Hopp |
8b6534 |
static PyObject* dll__Py_NoneStruct;
|
|
Karsten Hopp |
8b6534 |
+ static PyObject* _Py_ZeroStruct;
|
|
Karsten Hopp |
8b6534 |
+ static PyObject* dll__Py_TrueStruct;
|
|
Karsten Hopp |
8b6534 |
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
|
|
Karsten Hopp |
8b6534 |
static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
|
|
Karsten Hopp |
8b6534 |
# endif
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 389,394 ****
|
|
Karsten Hopp |
8b6534 |
--- 395,401 ----
|
|
Karsten Hopp |
8b6534 |
{"PyInt_FromLong", (PYTHON_PROC*)&dll_PyInt_FromLong},
|
|
Karsten Hopp |
8b6534 |
{"PyLong_AsLong", (PYTHON_PROC*)&dll_PyLong_AsLong},
|
|
Karsten Hopp |
8b6534 |
{"PyLong_FromLong", (PYTHON_PROC*)&dll_PyLong_FromLong},
|
|
Karsten Hopp |
8b6534 |
+ {"PyBool_Type", (PYTHON_PROC*)&dll_PyBool_Type},
|
|
Karsten Hopp |
8b6534 |
{"PyInt_Type", (PYTHON_PROC*)&dll_PyInt_Type},
|
|
Karsten Hopp |
8b6534 |
{"PyLong_Type", (PYTHON_PROC*)&dll_PyLong_Type},
|
|
Karsten Hopp |
8b6534 |
{"PyList_GetItem", (PYTHON_PROC*)&dll_PyList_GetItem},
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 449,454 ****
|
|
Karsten Hopp |
8b6534 |
--- 456,463 ----
|
|
Karsten Hopp |
8b6534 |
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented},
|
|
Karsten Hopp |
8b6534 |
# endif
|
|
Karsten Hopp |
8b6534 |
{"_Py_NoneStruct", (PYTHON_PROC*)&dll__Py_NoneStruct},
|
|
Karsten Hopp |
8b6534 |
+ {"_Py_ZeroStruct", (PYTHON_PROC*)&dll__Py_ZeroStruct},
|
|
Karsten Hopp |
8b6534 |
+ {"_Py_TrueStruct", (PYTHON_PROC*)&dll__Py_TrueStruct},
|
|
Karsten Hopp |
8b6534 |
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
|
|
Karsten Hopp |
8b6534 |
{"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
|
|
Karsten Hopp |
8b6534 |
# endif
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1563,1568 ****
|
|
Karsten Hopp |
8b6534 |
--- 1572,1581 ----
|
|
Karsten Hopp |
8b6534 |
PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferList);
|
|
Karsten Hopp |
8b6534 |
PyDict_SetItemString(dict, "current", (PyObject *)(void *)&TheCurrent);
|
|
Karsten Hopp |
8b6534 |
PyDict_SetItemString(dict, "windows", (PyObject *)(void *)&TheWindowList);
|
|
Karsten Hopp |
8b6534 |
+ PyDict_SetItemString(dict, "VAR_LOCKED", PyInt_FromLong(VAR_LOCKED));
|
|
Karsten Hopp |
8b6534 |
+ PyDict_SetItemString(dict, "VAR_FIXED", PyInt_FromLong(VAR_FIXED));
|
|
Karsten Hopp |
8b6534 |
+ PyDict_SetItemString(dict, "VAR_SCOPE", PyInt_FromLong(VAR_SCOPE));
|
|
Karsten Hopp |
8b6534 |
+ PyDict_SetItemString(dict, "VAR_DEF_SCOPE", PyInt_FromLong(VAR_DEF_SCOPE));
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
if (PyErr_Occurred())
|
|
Karsten Hopp |
8b6534 |
return -1;
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1629,1635 ****
|
|
Karsten Hopp |
8b6534 |
(destructor) DictionaryDestructor,
|
|
Karsten Hopp |
8b6534 |
(printfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(getattrfunc) DictionaryGetattr,
|
|
Karsten Hopp |
8b6534 |
! (setattrfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(cmpfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(reprfunc) 0,
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
--- 1642,1648 ----
|
|
Karsten Hopp |
8b6534 |
(destructor) DictionaryDestructor,
|
|
Karsten Hopp |
8b6534 |
(printfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(getattrfunc) DictionaryGetattr,
|
|
Karsten Hopp |
8b6534 |
! (setattrfunc) DictionarySetattr,
|
|
Karsten Hopp |
8b6534 |
(cmpfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(reprfunc) 0,
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1656,1661 ****
|
|
Karsten Hopp |
8b6534 |
--- 1669,1681 ----
|
|
Karsten Hopp |
8b6534 |
static PyObject *
|
|
Karsten Hopp |
8b6534 |
DictionaryGetattr(PyObject *self, char *name)
|
|
Karsten Hopp |
8b6534 |
{
|
|
Karsten Hopp |
8b6534 |
+ DictionaryObject *this = ((DictionaryObject *) (self));
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ if (strcmp(name, "locked") == 0)
|
|
Karsten Hopp |
8b6534 |
+ return PyInt_FromLong(this->dict->dv_lock);
|
|
Karsten Hopp |
8b6534 |
+ else if (strcmp(name, "scope") == 0)
|
|
Karsten Hopp |
8b6534 |
+ return PyInt_FromLong(this->dict->dv_scope);
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
return Py_FindMethod(DictionaryMethods, self, name);
|
|
Karsten Hopp |
8b6534 |
}
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1687,1693 ****
|
|
Karsten Hopp |
8b6534 |
(destructor) ListDestructor,
|
|
Karsten Hopp |
8b6534 |
(printfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(getattrfunc) ListGetattr,
|
|
Karsten Hopp |
8b6534 |
! (setattrfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(cmpfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(reprfunc) 0,
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
--- 1707,1713 ----
|
|
Karsten Hopp |
8b6534 |
(destructor) ListDestructor,
|
|
Karsten Hopp |
8b6534 |
(printfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(getattrfunc) ListGetattr,
|
|
Karsten Hopp |
8b6534 |
! (setattrfunc) ListSetattr,
|
|
Karsten Hopp |
8b6534 |
(cmpfunc) 0,
|
|
Karsten Hopp |
8b6534 |
(reprfunc) 0,
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1714,1719 ****
|
|
Karsten Hopp |
8b6534 |
--- 1734,1742 ----
|
|
Karsten Hopp |
8b6534 |
static PyObject *
|
|
Karsten Hopp |
8b6534 |
ListGetattr(PyObject *self, char *name)
|
|
Karsten Hopp |
8b6534 |
{
|
|
Karsten Hopp |
8b6534 |
+ if (strcmp(name, "locked") == 0)
|
|
Karsten Hopp |
8b6534 |
+ return PyInt_FromLong(((ListObject *)(self))->list->lv_lock);
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
return Py_FindMethod(ListMethods, self, name);
|
|
Karsten Hopp |
8b6534 |
}
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/if_python3.c 2012-09-21 13:45:57.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/if_python3.c 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 161,167 ****
|
|
Karsten Hopp |
8b6534 |
# define PyRun_String py3_PyRun_String
|
|
Karsten Hopp |
8b6534 |
# define PySys_SetObject py3_PySys_SetObject
|
|
Karsten Hopp |
8b6534 |
# define PySys_SetArgv py3_PySys_SetArgv
|
|
Karsten Hopp |
8b6534 |
- # define PyType_Type (*py3_PyType_Type)
|
|
Karsten Hopp |
8b6534 |
# define PyType_Ready py3_PyType_Ready
|
|
Karsten Hopp |
8b6534 |
#undef Py_BuildValue
|
|
Karsten Hopp |
8b6534 |
# define Py_BuildValue py3_Py_BuildValue
|
|
Karsten Hopp |
8b6534 |
--- 161,166 ----
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 170,175 ****
|
|
Karsten Hopp |
8b6534 |
--- 169,176 ----
|
|
Karsten Hopp |
8b6534 |
# define Py_Finalize py3_Py_Finalize
|
|
Karsten Hopp |
8b6534 |
# define Py_IsInitialized py3_Py_IsInitialized
|
|
Karsten Hopp |
8b6534 |
# define _Py_NoneStruct (*py3__Py_NoneStruct)
|
|
Karsten Hopp |
8b6534 |
+ # define _Py_FalseStruct (*py3__Py_FalseStruct)
|
|
Karsten Hopp |
8b6534 |
+ # define _Py_TrueStruct (*py3__Py_TrueStruct)
|
|
Karsten Hopp |
8b6534 |
# define _PyObject_NextNotImplemented (*py3__PyObject_NextNotImplemented)
|
|
Karsten Hopp |
8b6534 |
# define PyModule_AddObject py3_PyModule_AddObject
|
|
Karsten Hopp |
8b6534 |
# define PyImport_AppendInittab py3_PyImport_AppendInittab
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 184,191 ****
|
|
Karsten Hopp |
8b6534 |
--- 185,194 ----
|
|
Karsten Hopp |
8b6534 |
# define PyFloat_FromDouble py3_PyFloat_FromDouble
|
|
Karsten Hopp |
8b6534 |
# define PyFloat_AsDouble py3_PyFloat_AsDouble
|
|
Karsten Hopp |
8b6534 |
# define PyObject_GenericGetAttr py3_PyObject_GenericGetAttr
|
|
Karsten Hopp |
8b6534 |
+ # define PyType_Type (*py3_PyType_Type)
|
|
Karsten Hopp |
8b6534 |
# define PySlice_Type (*py3_PySlice_Type)
|
|
Karsten Hopp |
8b6534 |
# define PyFloat_Type (*py3_PyFloat_Type)
|
|
Karsten Hopp |
8b6534 |
+ # define PyBool_Type (*py3_PyBool_Type)
|
|
Karsten Hopp |
8b6534 |
# define PyErr_NewException py3_PyErr_NewException
|
|
Karsten Hopp |
8b6534 |
# ifdef Py_DEBUG
|
|
Karsten Hopp |
8b6534 |
# define _Py_NegativeRefcount py3__Py_NegativeRefcount
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 245,251 ****
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyImport_ImportModule)(const char *);
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyImport_AddModule)(const char *);
|
|
Karsten Hopp |
8b6534 |
static int (*py3_PyErr_BadArgument)(void);
|
|
Karsten Hopp |
8b6534 |
- static PyTypeObject* py3_PyType_Type;
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyErr_Occurred)(void);
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyModule_GetDict)(PyObject *);
|
|
Karsten Hopp |
8b6534 |
static int (*py3_PyList_SetItem)(PyObject *, Py_ssize_t, PyObject *);
|
|
Karsten Hopp |
8b6534 |
--- 248,253 ----
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 275,280 ****
|
|
Karsten Hopp |
8b6534 |
--- 277,284 ----
|
|
Karsten Hopp |
8b6534 |
static PyObject*(*py3__PyObject_Init)(PyObject *, PyTypeObject *);
|
|
Karsten Hopp |
8b6534 |
static iternextfunc py3__PyObject_NextNotImplemented;
|
|
Karsten Hopp |
8b6534 |
static PyObject* py3__Py_NoneStruct;
|
|
Karsten Hopp |
8b6534 |
+ static PyObject* py3__Py_FalseStruct;
|
|
Karsten Hopp |
8b6534 |
+ static PyObject* py3__Py_TrueStruct;
|
|
Karsten Hopp |
8b6534 |
static int (*py3_PyModule_AddObject)(PyObject *m, const char *name, PyObject *o);
|
|
Karsten Hopp |
8b6534 |
static int (*py3_PyImport_AppendInittab)(const char *name, PyObject* (*initfunc)(void));
|
|
Karsten Hopp |
8b6534 |
static char* (*py3__PyUnicode_AsString)(PyObject *unicode);
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 288,295 ****
|
|
Karsten Hopp |
8b6534 |
--- 292,301 ----
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems);
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds);
|
|
Karsten Hopp |
8b6534 |
+ static PyTypeObject* py3_PyType_Type;
|
|
Karsten Hopp |
8b6534 |
static PyTypeObject* py3_PySlice_Type;
|
|
Karsten Hopp |
8b6534 |
static PyTypeObject* py3_PyFloat_Type;
|
|
Karsten Hopp |
8b6534 |
+ static PyTypeObject* py3_PyBool_Type;
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyErr_NewException)(char *name, PyObject *base, PyObject *dict);
|
|
Karsten Hopp |
8b6534 |
static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
|
|
Karsten Hopp |
8b6534 |
static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 363,369 ****
|
|
Karsten Hopp |
8b6534 |
{"PyImport_ImportModule", (PYTHON_PROC*)&py3_PyImport_ImportModule},
|
|
Karsten Hopp |
8b6534 |
{"PyImport_AddModule", (PYTHON_PROC*)&py3_PyImport_AddModule},
|
|
Karsten Hopp |
8b6534 |
{"PyErr_BadArgument", (PYTHON_PROC*)&py3_PyErr_BadArgument},
|
|
Karsten Hopp |
8b6534 |
- {"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
|
|
Karsten Hopp |
8b6534 |
{"PyErr_Occurred", (PYTHON_PROC*)&py3_PyErr_Occurred},
|
|
Karsten Hopp |
8b6534 |
{"PyModule_GetDict", (PYTHON_PROC*)&py3_PyModule_GetDict},
|
|
Karsten Hopp |
8b6534 |
{"PyList_SetItem", (PYTHON_PROC*)&py3_PyList_SetItem},
|
|
Karsten Hopp |
8b6534 |
--- 369,374 ----
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 386,391 ****
|
|
Karsten Hopp |
8b6534 |
--- 391,398 ----
|
|
Karsten Hopp |
8b6534 |
{"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized},
|
|
Karsten Hopp |
8b6534 |
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented},
|
|
Karsten Hopp |
8b6534 |
{"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct},
|
|
Karsten Hopp |
8b6534 |
+ {"_Py_FalseStruct", (PYTHON_PROC*)&py3__Py_FalseStruct},
|
|
Karsten Hopp |
8b6534 |
+ {"_Py_TrueStruct", (PYTHON_PROC*)&py3__Py_TrueStruct},
|
|
Karsten Hopp |
8b6534 |
{"PyErr_Clear", (PYTHON_PROC*)&py3_PyErr_Clear},
|
|
Karsten Hopp |
8b6534 |
{"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init},
|
|
Karsten Hopp |
8b6534 |
{"PyModule_AddObject", (PYTHON_PROC*)&py3_PyModule_AddObject},
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 400,407 ****
|
|
Karsten Hopp |
8b6534 |
--- 407,416 ----
|
|
Karsten Hopp |
8b6534 |
{"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
|
|
Karsten Hopp |
8b6534 |
{"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc},
|
|
Karsten Hopp |
8b6534 |
{"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew},
|
|
Karsten Hopp |
8b6534 |
+ {"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
|
|
Karsten Hopp |
8b6534 |
{"PySlice_Type", (PYTHON_PROC*)&py3_PySlice_Type},
|
|
Karsten Hopp |
8b6534 |
{"PyFloat_Type", (PYTHON_PROC*)&py3_PyFloat_Type},
|
|
Karsten Hopp |
8b6534 |
+ {"PyBool_Type", (PYTHON_PROC*)&py3_PyBool_Type},
|
|
Karsten Hopp |
8b6534 |
{"PyErr_NewException", (PYTHON_PROC*)&py3_PyErr_NewException},
|
|
Karsten Hopp |
8b6534 |
# ifdef Py_DEBUG
|
|
Karsten Hopp |
8b6534 |
{"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount},
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1534,1539 ****
|
|
Karsten Hopp |
8b6534 |
--- 1543,1570 ----
|
|
Karsten Hopp |
8b6534 |
/* mp_ass_subscript */ (objobjargproc) DictionaryAssItem,
|
|
Karsten Hopp |
8b6534 |
};
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
+ static PyObject *
|
|
Karsten Hopp |
8b6534 |
+ DictionaryGetattro(PyObject *self, PyObject *nameobj)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ DictionaryObject *this = ((DictionaryObject *) (self));
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ GET_ATTR_STRING(name, nameobj);
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ if (strcmp(name, "locked") == 0)
|
|
Karsten Hopp |
8b6534 |
+ return PyLong_FromLong(this->dict->dv_lock);
|
|
Karsten Hopp |
8b6534 |
+ else if (strcmp(name, "scope") == 0)
|
|
Karsten Hopp |
8b6534 |
+ return PyLong_FromLong(this->dict->dv_scope);
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ return PyObject_GenericGetAttr(self, nameobj);
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ static int
|
|
Karsten Hopp |
8b6534 |
+ DictionarySetattro(PyObject *self, PyObject *nameobj, PyObject *val)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ GET_ATTR_STRING(name, nameobj);
|
|
Karsten Hopp |
8b6534 |
+ return DictionarySetattr((DictionaryObject *) self, name, val);
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
static PyTypeObject DictionaryType;
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
static void
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1625,1630 ****
|
|
Karsten Hopp |
8b6534 |
--- 1656,1679 ----
|
|
Karsten Hopp |
8b6534 |
}
|
|
Karsten Hopp |
8b6534 |
}
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
+ static PyObject *
|
|
Karsten Hopp |
8b6534 |
+ ListGetattro(PyObject *self, PyObject *nameobj)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ GET_ATTR_STRING(name, nameobj);
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ if (strcmp(name, "locked") == 0)
|
|
Karsten Hopp |
8b6534 |
+ return PyLong_FromLong(((ListObject *) (self))->list->lv_lock);
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ return PyObject_GenericGetAttr(self, nameobj);
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ static int
|
|
Karsten Hopp |
8b6534 |
+ ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
|
|
Karsten Hopp |
8b6534 |
+ {
|
|
Karsten Hopp |
8b6534 |
+ GET_ATTR_STRING(name, nameobj);
|
|
Karsten Hopp |
8b6534 |
+ return ListSetattr((ListObject *) self, name, val);
|
|
Karsten Hopp |
8b6534 |
+ }
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
static void
|
|
Karsten Hopp |
8b6534 |
ListDestructor(PyObject *self)
|
|
Karsten Hopp |
8b6534 |
{
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1713,1718 ****
|
|
Karsten Hopp |
8b6534 |
--- 1762,1768 ----
|
|
Karsten Hopp |
8b6534 |
PyMODINIT_FUNC Py3Init_vim(void)
|
|
Karsten Hopp |
8b6534 |
{
|
|
Karsten Hopp |
8b6534 |
PyObject *mod;
|
|
Karsten Hopp |
8b6534 |
+ PyObject *tmp;
|
|
Karsten Hopp |
8b6534 |
/* The special value is removed from sys.path in Python3_Init(). */
|
|
Karsten Hopp |
8b6534 |
static wchar_t *(argv[2]) = {L"/must>not&exist/foo", NULL};
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1744,1749 ****
|
|
Karsten Hopp |
8b6534 |
--- 1794,1809 ----
|
|
Karsten Hopp |
8b6534 |
Py_INCREF((PyObject *)(void *)&TheWindowList);
|
|
Karsten Hopp |
8b6534 |
PyModule_AddObject(mod, "windows", (PyObject *)(void *)&TheWindowList);
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
+ #define ADD_INT_CONSTANT(name, value) \
|
|
Karsten Hopp |
8b6534 |
+ tmp = PyLong_FromLong(value); \
|
|
Karsten Hopp |
8b6534 |
+ Py_INCREF(tmp); \
|
|
Karsten Hopp |
8b6534 |
+ PyModule_AddObject(mod, name, tmp)
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
+ ADD_INT_CONSTANT("VAR_LOCKED", VAR_LOCKED);
|
|
Karsten Hopp |
8b6534 |
+ ADD_INT_CONSTANT("VAR_FIXED", VAR_FIXED);
|
|
Karsten Hopp |
8b6534 |
+ ADD_INT_CONSTANT("VAR_SCOPE", VAR_SCOPE);
|
|
Karsten Hopp |
8b6534 |
+ ADD_INT_CONSTANT("VAR_DEF_SCOPE", VAR_DEF_SCOPE);
|
|
Karsten Hopp |
8b6534 |
+
|
|
Karsten Hopp |
8b6534 |
if (PyErr_Occurred())
|
|
Karsten Hopp |
8b6534 |
return NULL;
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1899,1904 ****
|
|
Karsten Hopp |
8b6534 |
--- 1959,1966 ----
|
|
Karsten Hopp |
8b6534 |
vim_memset(&DictionaryType, 0, sizeof(DictionaryType));
|
|
Karsten Hopp |
8b6534 |
DictionaryType.tp_name = "vim.dictionary";
|
|
Karsten Hopp |
8b6534 |
DictionaryType.tp_basicsize = sizeof(DictionaryObject);
|
|
Karsten Hopp |
8b6534 |
+ DictionaryType.tp_getattro = DictionaryGetattro;
|
|
Karsten Hopp |
8b6534 |
+ DictionaryType.tp_setattro = DictionarySetattro;
|
|
Karsten Hopp |
8b6534 |
DictionaryType.tp_dealloc = DictionaryDestructor;
|
|
Karsten Hopp |
8b6534 |
DictionaryType.tp_as_mapping = &DictionaryAsMapping;
|
|
Karsten Hopp |
8b6534 |
DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT;
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 1909,1914 ****
|
|
Karsten Hopp |
8b6534 |
--- 1971,1978 ----
|
|
Karsten Hopp |
8b6534 |
ListType.tp_name = "vim.list";
|
|
Karsten Hopp |
8b6534 |
ListType.tp_dealloc = ListDestructor;
|
|
Karsten Hopp |
8b6534 |
ListType.tp_basicsize = sizeof(ListObject);
|
|
Karsten Hopp |
8b6534 |
+ ListType.tp_getattro = ListGetattro;
|
|
Karsten Hopp |
8b6534 |
+ ListType.tp_setattro = ListSetattro;
|
|
Karsten Hopp |
8b6534 |
ListType.tp_as_sequence = &ListAsSeq;
|
|
Karsten Hopp |
8b6534 |
ListType.tp_as_mapping = &ListAsMapping;
|
|
Karsten Hopp |
8b6534 |
ListType.tp_flags = Py_TPFLAGS_DEFAULT;
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/testdir/test86.in 2012-09-05 19:17:37.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/testdir/test86.in 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 211,216 ****
|
|
Karsten Hopp |
8b6534 |
--- 211,251 ----
|
|
Karsten Hopp |
8b6534 |
m.extend([e.__class__.__name__])
|
|
Karsten Hopp |
8b6534 |
EOF
|
|
Karsten Hopp |
8b6534 |
:$put =messages
|
|
Karsten Hopp |
8b6534 |
+ :unlet messages
|
|
Karsten Hopp |
8b6534 |
+ :" locked and scope attributes
|
|
Karsten Hopp |
8b6534 |
+ :let d={} | let dl={} | lockvar dl
|
|
Karsten Hopp |
8b6534 |
+ :for s in split("d dl v: g:")
|
|
Karsten Hopp |
8b6534 |
+ : let name=tr(s, ':', 's')
|
|
Karsten Hopp |
8b6534 |
+ : execute 'py '.name.'=vim.bindeval("'.s.'")'
|
|
Karsten Hopp |
8b6534 |
+ : let toput=s.' : '.join(map(['locked', 'scope'], 'v:val.":".pyeval(name.".".v:val)'), ';')
|
|
Karsten Hopp |
8b6534 |
+ : $put =toput
|
|
Karsten Hopp |
8b6534 |
+ :endfor
|
|
Karsten Hopp |
8b6534 |
+ :silent! let d.abc=1
|
|
Karsten Hopp |
8b6534 |
+ :silent! let dl.abc=1
|
|
Karsten Hopp |
8b6534 |
+ :py d.locked=True
|
|
Karsten Hopp |
8b6534 |
+ :py dl.locked=False
|
|
Karsten Hopp |
8b6534 |
+ :silent! let d.def=1
|
|
Karsten Hopp |
8b6534 |
+ :silent! let dl.def=1
|
|
Karsten Hopp |
8b6534 |
+ :put ='d:'.string(d)
|
|
Karsten Hopp |
8b6534 |
+ :put ='dl:'.string(dl)
|
|
Karsten Hopp |
8b6534 |
+ :unlet d dl
|
|
Karsten Hopp |
8b6534 |
+ :
|
|
Karsten Hopp |
8b6534 |
+ :let l=[] | let ll=[] | lockvar ll
|
|
Karsten Hopp |
8b6534 |
+ :for s in split("l ll")
|
|
Karsten Hopp |
8b6534 |
+ : let name=tr(s, ':', 's')
|
|
Karsten Hopp |
8b6534 |
+ : execute 'py '.name.'=vim.bindeval("'.s.'")'
|
|
Karsten Hopp |
8b6534 |
+ : let toput=s.' : locked:'.pyeval(name.'.locked')
|
|
Karsten Hopp |
8b6534 |
+ : $put =toput
|
|
Karsten Hopp |
8b6534 |
+ :endfor
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(l, [0])
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(ll, [0])
|
|
Karsten Hopp |
8b6534 |
+ :py l.locked=True
|
|
Karsten Hopp |
8b6534 |
+ :py ll.locked=False
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(l, [1])
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(ll, [1])
|
|
Karsten Hopp |
8b6534 |
+ :put ='l:'.string(l)
|
|
Karsten Hopp |
8b6534 |
+ :put ='ll:'.string(ll)
|
|
Karsten Hopp |
8b6534 |
+ :unlet l ll
|
|
Karsten Hopp |
8b6534 |
:"
|
|
Karsten Hopp |
8b6534 |
:" pyeval()
|
|
Karsten Hopp |
8b6534 |
:let l=pyeval('range(3)')
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 240,245 ****
|
|
Karsten Hopp |
8b6534 |
--- 275,281 ----
|
|
Karsten Hopp |
8b6534 |
:call garbagecollect(1)
|
|
Karsten Hopp |
8b6534 |
:"
|
|
Karsten Hopp |
8b6534 |
:/^start:/,$wq! test.out
|
|
Karsten Hopp |
8b6534 |
+ :call getchar()
|
|
Karsten Hopp |
8b6534 |
ENDTEST
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
start:
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/testdir/test86.ok 2012-09-05 19:17:37.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/testdir/test86.ok 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 44,49 ****
|
|
Karsten Hopp |
8b6534 |
--- 44,59 ----
|
|
Karsten Hopp |
8b6534 |
ValueError
|
|
Karsten Hopp |
8b6534 |
TypeError
|
|
Karsten Hopp |
8b6534 |
TypeError
|
|
Karsten Hopp |
8b6534 |
+ d : locked:0;scope:0
|
|
Karsten Hopp |
8b6534 |
+ dl : locked:1;scope:0
|
|
Karsten Hopp |
8b6534 |
+ v: : locked:2;scope:1
|
|
Karsten Hopp |
8b6534 |
+ g: : locked:0;scope:2
|
|
Karsten Hopp |
8b6534 |
+ d:{'abc': 1}
|
|
Karsten Hopp |
8b6534 |
+ dl:{'def': 1}
|
|
Karsten Hopp |
8b6534 |
+ l : locked:0
|
|
Karsten Hopp |
8b6534 |
+ ll : locked:1
|
|
Karsten Hopp |
8b6534 |
+ l:[0]
|
|
Karsten Hopp |
8b6534 |
+ ll:[1]
|
|
Karsten Hopp |
8b6534 |
[0, 1, 2]
|
|
Karsten Hopp |
8b6534 |
['a', 'b']
|
|
Karsten Hopp |
8b6534 |
['c', 1]
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/testdir/test87.in 2012-09-05 19:17:37.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/testdir/test87.in 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 211,216 ****
|
|
Karsten Hopp |
8b6534 |
--- 211,251 ----
|
|
Karsten Hopp |
8b6534 |
m.extend([e.__class__.__name__])
|
|
Karsten Hopp |
8b6534 |
EOF
|
|
Karsten Hopp |
8b6534 |
:$put =messages
|
|
Karsten Hopp |
8b6534 |
+ :unlet messages
|
|
Karsten Hopp |
8b6534 |
+ :" locked and scope attributes
|
|
Karsten Hopp |
8b6534 |
+ :let d={} | let dl={} | lockvar dl
|
|
Karsten Hopp |
8b6534 |
+ :for s in split("d dl v: g:")
|
|
Karsten Hopp |
8b6534 |
+ : let name=tr(s, ':', 's')
|
|
Karsten Hopp |
8b6534 |
+ : execute 'py3 '.name.'=vim.bindeval("'.s.'")'
|
|
Karsten Hopp |
8b6534 |
+ : let toput=s.' : '.join(map(['locked', 'scope'], 'v:val.":".py3eval(name.".".v:val)'), ';')
|
|
Karsten Hopp |
8b6534 |
+ : $put =toput
|
|
Karsten Hopp |
8b6534 |
+ :endfor
|
|
Karsten Hopp |
8b6534 |
+ :silent! let d.abc=1
|
|
Karsten Hopp |
8b6534 |
+ :silent! let dl.abc=1
|
|
Karsten Hopp |
8b6534 |
+ :py3 d.locked=True
|
|
Karsten Hopp |
8b6534 |
+ :py3 dl.locked=False
|
|
Karsten Hopp |
8b6534 |
+ :silent! let d.def=1
|
|
Karsten Hopp |
8b6534 |
+ :silent! let dl.def=1
|
|
Karsten Hopp |
8b6534 |
+ :put ='d:'.string(d)
|
|
Karsten Hopp |
8b6534 |
+ :put ='dl:'.string(dl)
|
|
Karsten Hopp |
8b6534 |
+ :unlet d dl
|
|
Karsten Hopp |
8b6534 |
+ :
|
|
Karsten Hopp |
8b6534 |
+ :let l=[] | let ll=[] | lockvar ll
|
|
Karsten Hopp |
8b6534 |
+ :for s in split("l ll")
|
|
Karsten Hopp |
8b6534 |
+ : let name=tr(s, ':', 's')
|
|
Karsten Hopp |
8b6534 |
+ : execute 'py3 '.name.'=vim.bindeval("'.s.'")'
|
|
Karsten Hopp |
8b6534 |
+ : let toput=s.' : locked:'.py3eval(name.'.locked')
|
|
Karsten Hopp |
8b6534 |
+ : $put =toput
|
|
Karsten Hopp |
8b6534 |
+ :endfor
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(l, [0])
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(ll, [0])
|
|
Karsten Hopp |
8b6534 |
+ :py3 l.locked=True
|
|
Karsten Hopp |
8b6534 |
+ :py3 ll.locked=False
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(l, [1])
|
|
Karsten Hopp |
8b6534 |
+ :silent! call extend(ll, [1])
|
|
Karsten Hopp |
8b6534 |
+ :put ='l:'.string(l)
|
|
Karsten Hopp |
8b6534 |
+ :put ='ll:'.string(ll)
|
|
Karsten Hopp |
8b6534 |
+ :unlet l ll
|
|
Karsten Hopp |
8b6534 |
:"
|
|
Karsten Hopp |
8b6534 |
:" py3eval()
|
|
Karsten Hopp |
8b6534 |
:let l=py3eval('[0, 1, 2]')
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/testdir/test87.ok 2012-09-05 19:17:37.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/testdir/test87.ok 2012-09-21 13:49:14.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 44,49 ****
|
|
Karsten Hopp |
8b6534 |
--- 44,59 ----
|
|
Karsten Hopp |
8b6534 |
ValueError
|
|
Karsten Hopp |
8b6534 |
TypeError
|
|
Karsten Hopp |
8b6534 |
TypeError
|
|
Karsten Hopp |
8b6534 |
+ d : locked:0;scope:0
|
|
Karsten Hopp |
8b6534 |
+ dl : locked:1;scope:0
|
|
Karsten Hopp |
8b6534 |
+ v: : locked:2;scope:1
|
|
Karsten Hopp |
8b6534 |
+ g: : locked:0;scope:2
|
|
Karsten Hopp |
8b6534 |
+ d:{'abc': 1}
|
|
Karsten Hopp |
8b6534 |
+ dl:{'def': 1}
|
|
Karsten Hopp |
8b6534 |
+ l : locked:0
|
|
Karsten Hopp |
8b6534 |
+ ll : locked:1
|
|
Karsten Hopp |
8b6534 |
+ l:[0]
|
|
Karsten Hopp |
8b6534 |
+ ll:[1]
|
|
Karsten Hopp |
8b6534 |
[0, 1, 2]
|
|
Karsten Hopp |
8b6534 |
['a', 'b']
|
|
Karsten Hopp |
8b6534 |
['c', 1]
|
|
Karsten Hopp |
8b6534 |
*** ../vim-7.3.671/src/version.c 2012-09-21 13:45:57.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
--- src/version.c 2012-09-21 13:48:18.000000000 +0200
|
|
Karsten Hopp |
8b6534 |
***************
|
|
Karsten Hopp |
8b6534 |
*** 721,722 ****
|
|
Karsten Hopp |
8b6534 |
--- 721,724 ----
|
|
Karsten Hopp |
8b6534 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
8b6534 |
+ /**/
|
|
Karsten Hopp |
8b6534 |
+ 672,
|
|
Karsten Hopp |
8b6534 |
/**/
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
--
|
|
Karsten Hopp |
8b6534 |
Vi beats Emacs to death, and then again!
|
|
Karsten Hopp |
8b6534 |
http://linuxtoday.com/stories/5764.html
|
|
Karsten Hopp |
8b6534 |
|
|
Karsten Hopp |
8b6534 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
8b6534 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
8b6534 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
8b6534 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|