Merge latest master into doxygen branch again.
Update Doxygen-specific Python unit tests to work with the new indentation. Update one of Doxygen-specific Java tests to still build with the new handling of srcdir.
This commit is contained in:
commit
6cce652762
557 changed files with 4998 additions and 4138 deletions
|
|
@ -834,7 +834,7 @@ public:
|
|||
Printv(f_shadow, "\nfrom sys import version_info\n", NULL);
|
||||
|
||||
if (!builtin && fastproxy) {
|
||||
Printv(f_shadow, "if version_info >= (3,0,0):\n", NULL);
|
||||
Printv(f_shadow, "if version_info >= (3, 0, 0):\n", NULL);
|
||||
Printf(f_shadow, tab4 "new_instancemethod = lambda func, inst, cls: %s.SWIG_PyInstanceMethod_New(func)\n", module);
|
||||
Printv(f_shadow, "else:\n", NULL);
|
||||
Printv(f_shadow, tab4, "from new import instancemethod as new_instancemethod\n", NULL);
|
||||
|
|
@ -849,7 +849,7 @@ public:
|
|||
* isn't available in python 2.4 or earlier, so we have to write some
|
||||
* code conditional on the python version.
|
||||
*/
|
||||
Printv(f_shadow, "if version_info >= (2,6,0):\n", NULL);
|
||||
Printv(f_shadow, "if version_info >= (2, 6, 0):\n", NULL);
|
||||
Printv(f_shadow, tab4, "def swig_import_helper():\n", NULL);
|
||||
Printv(f_shadow, tab8, "from os.path import dirname\n", NULL);
|
||||
Printv(f_shadow, tab8, "import imp\n", NULL);
|
||||
|
|
@ -879,20 +879,20 @@ public:
|
|||
Printf(f_shadow, "from %s import *\n", module);
|
||||
}
|
||||
if (modern || !classic) {
|
||||
Printv(f_shadow, "try:\n", tab4, "_swig_property = property\n", "except NameError:\n", tab4, "pass # Python < 2.2 doesn't have 'property'.\n", NULL);
|
||||
Printv(f_shadow, "try:\n", tab4, "_swig_property = property\n", "except NameError:\n", tab4, "pass # Python < 2.2 doesn't have 'property'.\n\n", NULL);
|
||||
}
|
||||
/* if (!modern) */
|
||||
/* always needed, a class can be forced to be no-modern, such as an exception */
|
||||
{
|
||||
// Python-2.2 object hack
|
||||
Printv(f_shadow,
|
||||
"def _swig_setattr_nondynamic(self,class_type,name,value,static=1):\n",
|
||||
tab4, "if (name == \"thisown\"): return self.this.own(value)\n",
|
||||
tab4, "if (name == \"this\"):\n", tab4, tab4, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n",
|
||||
"\n", "def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n",
|
||||
tab4, "if (name == \"thisown\"):\n", tab8, "return self.this.own(value)\n",
|
||||
tab4, "if (name == \"this\"):\n", tab8, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n",
|
||||
#ifdef USE_THISOWN
|
||||
tab4, tab8, "if hasattr(value,\"thisown\"): self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n",
|
||||
tab4, tab8, "if hasattr(value,\"thisown\"):\n", tab8, tab8, "self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n",
|
||||
#endif
|
||||
tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name,None)\n", tab4, "if method: return method(self,value)\n",
|
||||
tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name, None)\n", tab4, "if method:\n", tab4, tab4, "return method(self, value)\n",
|
||||
#ifdef USE_THISOWN
|
||||
tab4, "if (not static) or (name == \"thisown\"):\n",
|
||||
#else
|
||||
|
|
@ -901,18 +901,18 @@ public:
|
|||
tab4, tab4, "self.__dict__[name] = value\n",
|
||||
tab4, "else:\n",
|
||||
tab4, tab4, "raise AttributeError(\"You cannot add attributes to %s\" % self)\n\n",
|
||||
"def _swig_setattr(self,class_type,name,value):\n", tab4, "return _swig_setattr_nondynamic(self,class_type,name,value,0)\n\n", NIL);
|
||||
"\n", "def _swig_setattr(self, class_type, name, value):\n", tab4, "return _swig_setattr_nondynamic(self, class_type, name, value, 0)\n\n", NIL);
|
||||
|
||||
Printv(f_shadow,
|
||||
"def _swig_getattr(self,class_type,name):\n",
|
||||
tab4, "if (name == \"thisown\"): return self.this.own()\n",
|
||||
tab4, "method = class_type.__swig_getmethods__.get(name,None)\n",
|
||||
tab4, "if method: return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL);
|
||||
"\n", "def _swig_getattr(self, class_type, name):\n",
|
||||
tab4, "if (name == \"thisown\"):\n", tab8, "return self.this.own()\n",
|
||||
tab4, "method = class_type.__swig_getmethods__.get(name, None)\n",
|
||||
tab4, "if method:\n", tab8, "return method(self)\n", tab4, "raise AttributeError(name)\n\n", NIL);
|
||||
|
||||
Printv(f_shadow,
|
||||
"def _swig_repr(self):\n",
|
||||
tab4, "try: strthis = \"proxy of \" + self.this.__repr__()\n",
|
||||
tab4, "except: strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL);
|
||||
"\n", "def _swig_repr(self):\n",
|
||||
tab4, "try:\n", tab8, "strthis = \"proxy of \" + self.this.__repr__()\n",
|
||||
tab4, "except:\n", tab8, "strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL);
|
||||
|
||||
if (!classic) {
|
||||
/* Usage of types.ObjectType is deprecated.
|
||||
|
|
@ -922,19 +922,19 @@ public:
|
|||
// "import types\n",
|
||||
"try:\n",
|
||||
// " _object = types.ObjectType\n",
|
||||
" _object = object\n", " _newclass = 1\n", "except AttributeError:\n", " class _object : pass\n", " _newclass = 0\n",
|
||||
tab4, "_object = object\n", tab4, "_newclass = 1\n", "except AttributeError:\n", tab4, "class _object:\n", tab8, "pass\n", tab4, "_newclass = 0\n",
|
||||
// "del types\n",
|
||||
"\n\n", NIL);
|
||||
}
|
||||
}
|
||||
if (modern) {
|
||||
Printv(f_shadow, "def _swig_setattr_nondynamic_method(set):\n", tab4, "def set_attr(self,name,value):\n",
|
||||
Printv(f_shadow, "\n", "def _swig_setattr_nondynamic_method(set):\n", tab4, "def set_attr(self, name, value):\n",
|
||||
#ifdef USE_THISOWN
|
||||
tab4, tab4, "if hasattr(self,name) or (name in (\"this\", \"thisown\")):\n",
|
||||
tab4, tab4, "if hasattr(self, name) or (name in (\"this\", \"thisown\")):\n",
|
||||
#else
|
||||
tab4, tab4, "if (name == \"thisown\"): return self.this.own(value)\n", tab4, tab4, "if hasattr(self,name) or (name == \"this\"):\n",
|
||||
tab4, tab4, "if (name == \"thisown\"):\n", tab8, tab4, "return self.this.own(value)\n", tab4, tab4, "if hasattr(self, name) or (name == \"this\"):\n",
|
||||
#endif
|
||||
tab4, tab4, tab4, "set(self,name,value)\n",
|
||||
tab4, tab4, tab4, "set(self, name, value)\n",
|
||||
tab4, tab4, "else:\n",
|
||||
tab4, tab4, tab4, "raise AttributeError(\"You cannot add attributes to %s\" % self)\n", tab4, "return set_attr\n\n\n", NIL);
|
||||
}
|
||||
|
|
@ -1686,7 +1686,7 @@ public:
|
|||
}
|
||||
// Write the function annotation
|
||||
if (func_annotation)
|
||||
Printf(doc, " : '%s'", type_str);
|
||||
Printf(doc, ": '%s'", type_str);
|
||||
|
||||
// Write default value
|
||||
if (value && !calling) {
|
||||
|
|
@ -2061,7 +2061,7 @@ public:
|
|||
if (ret)
|
||||
ret = SwigType_str(ret, 0);
|
||||
}
|
||||
return (ret && py3) ? NewStringf(" -> \"%s\" ", ret)
|
||||
return (ret && py3) ? NewStringf(" -> \"%s\"", ret)
|
||||
: NewString("");
|
||||
}
|
||||
|
||||
|
|
@ -2078,15 +2078,15 @@ public:
|
|||
/* Make a wrapper function to insert the code into */
|
||||
Printv(f_dest, "\ndef ", name, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||
if (have_docstring(n))
|
||||
Printv(f_dest, " ", docstring(n, AUTODOC_FUNC, tab2), "\n", NIL);
|
||||
Printv(f_dest, tab4, docstring(n, AUTODOC_FUNC, tab4), "\n", NIL);
|
||||
if (have_pythonprepend(n))
|
||||
Printv(f_dest, pythoncode(pythonprepend(n), " "), "\n", NIL);
|
||||
Printv(f_dest, pythoncode(pythonprepend(n), tab4), "\n", NIL);
|
||||
if (have_pythonappend(n)) {
|
||||
Printv(f_dest, " val = ", funcCall(name, callParms), "\n", NIL);
|
||||
Printv(f_dest, pythoncode(pythonappend(n), " "), "\n", NIL);
|
||||
Printv(f_dest, " return val\n", NIL);
|
||||
Printv(f_dest, tab4 "val = ", funcCall(name, callParms), "\n", NIL);
|
||||
Printv(f_dest, pythoncode(pythonappend(n), tab4), "\n", NIL);
|
||||
Printv(f_dest, tab4 "return val\n", NIL);
|
||||
} else {
|
||||
Printv(f_dest, " return ", funcCall(name, callParms), "\n", NIL);
|
||||
Printv(f_dest, tab4 "return ", funcCall(name, callParms), "\n", NIL);
|
||||
}
|
||||
|
||||
if (Getattr(n, "feature:python:callback") || !have_addtofunc(n)) {
|
||||
|
|
@ -2203,7 +2203,7 @@ public:
|
|||
Append(f->code, "--argc;\n");
|
||||
}
|
||||
|
||||
Replaceall(dispatch, "$args", "self,args");
|
||||
Replaceall(dispatch, "$args", "self, args");
|
||||
|
||||
Printv(f->code, dispatch, "\n", NIL);
|
||||
|
||||
|
|
@ -3950,7 +3950,7 @@ public:
|
|||
Printv(base_class, bname, NIL);
|
||||
b = Next(b);
|
||||
if (b.item) {
|
||||
Putc(',', base_class);
|
||||
Printv(base_class, ", ", NIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3971,7 +3971,7 @@ public:
|
|||
String *abcs = Getattr(n, "feature:python:abc");
|
||||
if (py3 && abcs) {
|
||||
if (Len(base_class)) {
|
||||
Putc(',', base_class);
|
||||
Printv(base_class, ", ", NIL);
|
||||
}
|
||||
Printv(base_class, abcs, NIL);
|
||||
}
|
||||
|
|
@ -4008,7 +4008,7 @@ public:
|
|||
if (!modern) {
|
||||
Printv(f_shadow, tab4, "__swig_setmethods__ = {}\n", NIL);
|
||||
if (Len(base_class)) {
|
||||
Printf(f_shadow, "%sfor _s in [%s]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))\n", tab4, base_class);
|
||||
Printv(f_shadow, tab4, "for _s in [", base_class, "]:\n", tab8, "__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))\n", NIL);
|
||||
}
|
||||
|
||||
if (!GetFlag(n, "feature:python:nondynamic")) {
|
||||
|
|
@ -4019,7 +4019,7 @@ public:
|
|||
|
||||
Printv(f_shadow, tab4, "__swig_getmethods__ = {}\n", NIL);
|
||||
if (Len(base_class)) {
|
||||
Printf(f_shadow, "%sfor _s in [%s]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))\n", tab4, base_class);
|
||||
Printv(f_shadow, tab4, "for _s in [", base_class, "]:\n", tab8, "__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))\n", NIL);
|
||||
}
|
||||
|
||||
Printv(f_shadow, tab4, "__getattr__ = lambda self, name: _swig_getattr(self, ", class_name, ", name)\n", NIL);
|
||||
|
|
@ -4107,7 +4107,7 @@ public:
|
|||
Delete(realct);
|
||||
if (!have_constructor) {
|
||||
if (!builtin)
|
||||
Printv(f_shadow_file, tab4, "def __init__(self, *args, **kwargs): raise AttributeError(\"", "No constructor defined",
|
||||
Printv(f_shadow_file, "\n", tab4, "def __init__(self, *args, **kwargs):\n", tab8, "raise AttributeError(\"", "No constructor defined",
|
||||
(Getattr(n, "abstracts") ? " - class is abstract" : ""), "\")\n", NIL);
|
||||
} else if (fastinit && !builtin) {
|
||||
|
||||
|
|
@ -4145,12 +4145,12 @@ public:
|
|||
Printv(f_shadow_file, "\nclass ", class_name, "Ptr(", class_name, "):\n", tab4, "def __init__(self, this):\n", NIL);
|
||||
if (!modern) {
|
||||
Printv(f_shadow_file,
|
||||
tab8, "try: self.this.append(this)\n",
|
||||
tab8, "except: self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
||||
tab8, "try:\n", tab8, tab4, "self.this.append(this)\n",
|
||||
tab8, "except:\n", tab8, tab4, "self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
||||
} else {
|
||||
Printv(f_shadow_file,
|
||||
tab8, "try: self.this.append(this)\n",
|
||||
tab8, "except: self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
||||
tab8, "try:\n", tab8, tab4, "self.this.append(this)\n",
|
||||
tab8, "except:\n", tab8, tab4, "self.this = this\n", tab8, "self.this.own(0)\n", tab8, "self.__class__ = ", class_name, "\n\n", NIL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4159,7 +4159,7 @@ public:
|
|||
List *shadow_list = Getattr(n, "shadow_methods");
|
||||
for (int i = 0; i < Len(shadow_list); ++i) {
|
||||
String *symname = Getitem(shadow_list, i);
|
||||
Printf(f_shadow_file, "%s.%s = new_instancemethod(%s.%s,None,%s)\n", class_name, symname, module, Swig_name_member(NSPACE_TODO, class_name, symname),
|
||||
Printf(f_shadow_file, "%s.%s = new_instancemethod(%s.%s, None, %s)\n", class_name, symname, module, Swig_name_member(NSPACE_TODO, class_name, symname),
|
||||
class_name);
|
||||
}
|
||||
}
|
||||
|
|
@ -4274,13 +4274,11 @@ public:
|
|||
String *callParms = make_pyParmList(n, true, true, allow_kwargs);
|
||||
if (!have_addtofunc(n)) {
|
||||
if (!fastproxy || olddefs) {
|
||||
Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":", NIL);
|
||||
Printv(f_shadow, "\n", NIL);
|
||||
Printv(f_shadow, "\n", tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||
Printv(f_shadow, tab8, "return ", funcCall(fullname, callParms), "\n", NIL);
|
||||
}
|
||||
} else {
|
||||
Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":", NIL);
|
||||
Printv(f_shadow, "\n", NIL);
|
||||
Printv(f_shadow, "\n", tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||
if (have_docstring(n))
|
||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL);
|
||||
if (have_pythonprepend(n)) {
|
||||
|
|
@ -4366,7 +4364,7 @@ public:
|
|||
int kw = (check_kwargs(n) && !Getattr(n, "sym:overloaded")) ? 1 : 0;
|
||||
String *parms = make_pyParmList(n, false, false, kw);
|
||||
String *callParms = make_pyParmList(n, false, true, kw);
|
||||
Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||
Printv(f_shadow, "\n", tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||
if (have_docstring(n))
|
||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL);
|
||||
if (have_pythonprepend(n))
|
||||
|
|
@ -4378,7 +4376,7 @@ public:
|
|||
} else {
|
||||
Printv(f_shadow, tab8, "return ", funcCall(Swig_name_member(NSPACE_TODO, class_name, symname), callParms), "\n\n", NIL);
|
||||
}
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = staticmethod(", symname, ")\n", NIL);
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = staticmethod(", symname, ")\n", NIL);
|
||||
|
||||
if (!modern) {
|
||||
Printv(f_shadow, tab4, "__swig_getmethods__[\"", symname, "\"] = lambda x: ", symname, "\n", NIL);
|
||||
|
|
@ -4390,7 +4388,7 @@ public:
|
|||
NIL);
|
||||
}
|
||||
if (!classic) {
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = staticmethod(", module, ".", Swig_name_member(NSPACE_TODO, class_name, symname),
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = staticmethod(", module, ".", Swig_name_member(NSPACE_TODO, class_name, symname),
|
||||
")\n", NIL);
|
||||
}
|
||||
}
|
||||
|
|
@ -4479,7 +4477,7 @@ public:
|
|||
Printv(pass_self, tab8, tab4, "_self = None\n", tab8, "else:\n", tab8, tab4, "_self = self\n", NIL);
|
||||
}
|
||||
|
||||
Printv(f_shadow, tab4, "def __init__(", parms, ")", returnTypeAnnotation(n), ": \n", NIL);
|
||||
Printv(f_shadow, "\n", tab4, "def __init__(", parms, ")", returnTypeAnnotation(n), ":\n", NIL);
|
||||
if (have_docstring(n))
|
||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_CTOR, tab8), "\n", NIL);
|
||||
if (have_pythonprepend(n))
|
||||
|
|
@ -4490,7 +4488,7 @@ public:
|
|||
} else {
|
||||
Printv(f_shadow,
|
||||
tab8, "this = ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), "\n",
|
||||
tab8, "try: self.this.append(this)\n", tab8, "except: self.this = this\n", NIL);
|
||||
tab8, "try:\n", tab8, tab4, "self.this.append(this)\n", tab8, "except:\n", tab8, tab4, "self.this = this\n", NIL);
|
||||
}
|
||||
if (have_pythonappend(n))
|
||||
Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n\n", NIL);
|
||||
|
|
@ -4576,7 +4574,7 @@ public:
|
|||
Printv(f_shadow, tab4, "__swig_destroy__ = ", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "\n", NIL);
|
||||
if (!have_pythonprepend(n) && !have_pythonappend(n)) {
|
||||
if (proxydel) {
|
||||
Printv(f_shadow, tab4, "__del__ = lambda self : None;\n", NIL);
|
||||
Printv(f_shadow, tab4, "__del__ = lambda self: None\n", NIL);
|
||||
}
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
|
@ -4587,7 +4585,7 @@ public:
|
|||
Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL);
|
||||
#ifdef USE_THISOWN
|
||||
Printv(f_shadow, tab8, "try:\n", NIL);
|
||||
Printv(f_shadow, tab8, tab4, "if self.thisown: ", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "(self)\n", NIL);
|
||||
Printv(f_shadow, tab8, tab4, "if self.thisown:", module, ".", Swig_name_destroy(NSPACE_TODO, symname), "(self)\n", NIL);
|
||||
Printv(f_shadow, tab8, "except: pass\n", NIL);
|
||||
#else
|
||||
#endif
|
||||
|
|
@ -4626,9 +4624,9 @@ public:
|
|||
}
|
||||
if (!classic) {
|
||||
if (!assignable) {
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ")\n", NIL);
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ")\n", NIL);
|
||||
} else {
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL);
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL);
|
||||
}
|
||||
}
|
||||
Delete(mname);
|
||||
|
|
@ -4699,9 +4697,9 @@ public:
|
|||
}
|
||||
if (!classic && !builtin) {
|
||||
if (!assignable) {
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ")\n", NIL);
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ")\n", NIL);
|
||||
} else {
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL);
|
||||
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL);
|
||||
}
|
||||
}
|
||||
String *getter = Getattr(n, "pybuiltin:getter");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue