Fix autodoc strings generated in Python builtin case and the test.

Use the proper AUTODOC_METHOD for autodoc strings generation when using
"-builtin", there is no reason to use AUTODOC_FUNC here when AUTODOC_METHOD is
used by default (i.e. without "-builtin").

This allows to (almost) stop differentiating between the two cases in the
autodoc unit test, allowing to simplify it significantly.

Also fix this test to pass after the recent changes removing docstring
indentation in the generated code.
This commit is contained in:
Vadim Zeitlin 2014-12-15 20:27:46 +01:00
commit fd47e6870e
2 changed files with 58 additions and 199 deletions

View file

@ -4273,7 +4273,7 @@ public:
String *wname = Swig_name_wrapper(fullname);
Setattr(class_members, symname, n);
int argcount = Getattr(n, "python:argcount") ? atoi(Char(Getattr(n, "python:argcount"))) : 2;
String *ds = have_docstring(n) ? cdocstring(n, AUTODOC_FUNC) : NewString("");
String *ds = have_docstring(n) ? cdocstring(n, AUTODOC_METHOD) : NewString("");
if (check_kwargs(n)) {
Printf(builtin_methods, " { \"%s\", (PyCFunction) %s, METH_VARARGS|METH_KEYWORDS, (char*) \"%s\" },\n", symname, wname, ds);
} else if (argcount == 0) {