Another merge with master.

Updated Doxygen error numbers yet again, as Python errors got added in the
meanwhile, pushing the Doxygen ones further off.

And re-merged PEP8/whitespace-related conflicts in autodoc_runme.py once again
(if anybody is looking for a motivating example about why significant
whitespace is bad, here is a great use case).
This commit is contained in:
Vadim Zeitlin 2015-07-20 00:40:32 +02:00
commit 302955a152
448 changed files with 8836 additions and 5079 deletions

View file

@ -9,6 +9,7 @@ SWIGINTERN void \
wrapper##_closure(PyObject *a) { \
SwigPyObject *sobj; \
sobj = (SwigPyObject *)a; \
Py_XDECREF(sobj->dict); \
if (sobj->own) { \
PyObject *o = wrapper(a, NULL); \
Py_XDECREF(o); \

View file

@ -40,16 +40,6 @@
#endif
/*
Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
'Swig' namespace. This could be useful for multi-modules projects.
*/
#ifdef SWIG_DIRECTOR_STATIC
/* Force anonymous (static) namespace */
#define Swig
#endif
/*
Use -DSWIG_DIRECTOR_NORTTI if you prefer to avoid the use of the
native C++ RTTI and dynamic_cast<>. But be aware that directors
@ -338,9 +328,8 @@ namespace Swig {
}
public:
/* wrap a python object, optionally taking ownership */
/* wrap a python object. */
Director(PyObject *self) : swig_self(self), swig_disown_flag(false) {
swig_incref();
}
/* discard our reference at destruction */

View file

@ -1,7 +1,7 @@
%define %pythonabc(Type, Abc)
%feature("python:abc", #Abc) Type;
%enddef
%pythoncode {import collections};
%pythoncode %{import collections%}
%pythonabc(std::vector, collections.MutableSequence);
%pythonabc(std::list, collections.MutableSequence);
%pythonabc(std::map, collections.MutableMapping);

View file

@ -710,8 +710,8 @@ namespace swig
#if defined(SWIGPYTHON_BUILTIN)
%feature("python:slot", "tp_iter", functype="getiterfunc") iterator;
#else
%pythoncode {def __iter__(self):
return self.iterator()}
%pythoncode %{def __iter__(self):
return self.iterator()%}
#endif
}

View file

@ -275,7 +275,9 @@ SWIG_Python_FixMethods(PyMethodDef *methods,
size_t i;
for (i = 0; methods[i].ml_name; ++i) {
const char *c = methods[i].ml_doc;
if (c && (c = strstr(c, "swig_ptr: "))) {
if (!c) continue;
c = strstr(c, "swig_ptr: ");
if (c) {
int j;
swig_const_info *ci = 0;
const char *name = c + 10;

View file

@ -344,8 +344,8 @@ namespace swig
%feature("python:slot", "tp_iternext", functype="iternextfunc") SwigPyIterator::__next__;
#else
%extend SwigPyIterator {
%pythoncode {def __iter__(self):
return self}
%pythoncode %{def __iter__(self):
return self%}
}
#endif

View file

@ -381,6 +381,23 @@ typedef struct {
#endif
} SwigPyObject;
#ifdef SWIGPYTHON_BUILTIN
SWIGRUNTIME PyObject *
SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
{
SwigPyObject *sobj = (SwigPyObject *)v;
if (!sobj->dict)
sobj->dict = PyDict_New();
Py_INCREF(sobj->dict);
return sobj->dict;
}
#endif
SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject *v)
{
@ -651,7 +668,7 @@ swigobject_methods[] = {
static PyMethodDef
swigobject_methods[] = {
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"},
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
@ -1420,18 +1437,21 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f
newobj = (SwigPyObject *) newobj->next;
newobj->next = next_self;
newobj = (SwigPyObject *)next_self;
#ifdef SWIGPYTHON_BUILTIN
newobj->dict = 0;
#endif
}
} else {
newobj = PyObject_New(SwigPyObject, clientdata->pytype);
#ifdef SWIGPYTHON_BUILTIN
newobj->dict = 0;
#endif
}
if (newobj) {
newobj->ptr = ptr;
newobj->ty = type;
newobj->own = own;
newobj->next = 0;
#ifdef SWIGPYTHON_BUILTIN
newobj->dict = 0;
#endif
return (PyObject*) newobj;
}
return SWIG_Py_Void();

View file

@ -176,14 +176,14 @@
#else
%extend {
%pythoncode {def __iter__(self):
return self.key_iterator()}
%pythoncode {def iterkeys(self):
return self.key_iterator()}
%pythoncode {def itervalues(self):
return self.value_iterator()}
%pythoncode {def iteritems(self):
return self.iterator()}
%pythoncode %{def __iter__(self):
return self.key_iterator()%}
%pythoncode %{def iterkeys(self):
return self.key_iterator()%}
%pythoncode %{def itervalues(self):
return self.value_iterator()%}
%pythoncode %{def iteritems(self):
return self.iterator()%}
}
#endif

View file

@ -176,7 +176,7 @@ SwigPython_std_pair_setitem (PyObject *a, Py_ssize_t b, PyObject *c)
%define %swig_pair_methods(pair...)
#if !defined(SWIGPYTHON_BUILTIN)
%extend {
%pythoncode {def __len__(self):
%pythoncode %{def __len__(self):
return 2
def __repr__(self):
return str((self.first, self.second))
@ -189,7 +189,7 @@ def __setitem__(self, index, val):
if not (index % 2):
self.first = val
else:
self.second = val}
self.second = val%}
}
#endif
%enddef

View file

@ -231,14 +231,14 @@
return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
}
%pythoncode {def __iter__(self):
return self.key_iterator()}
%pythoncode {def iterkeys(self):
return self.key_iterator()}
%pythoncode {def itervalues(self):
return self.value_iterator()}
%pythoncode {def iteritems(self):
return self.iterator()}
%pythoncode %{def __iter__(self):
return self.key_iterator()%}
%pythoncode %{def iterkeys(self):
return self.key_iterator()%}
%pythoncode %{def itervalues(self):
return self.value_iterator()%}
%pythoncode %{def iteritems(self):
return self.iterator()%}
}
%enddef