retrieving revision 1.28
diff -u -r1.28 python.cxx
--- Source/Modules/python.cxx 18 Nov 2003 20:19:15 -0000 1.28
-+++ Source/Modules/python.cxx 19 Nov 2003 17:34:55 -0000
++++ Source/Modules/python.cxx 21 Nov 2003 16:56:31 -0000
@@ -68,6 +68,17 @@
-noexcept - No automatic exception handling\n\
-noproxy - Don't generate proxy classes \n\n";
}
}
-@@ -439,6 +456,193 @@
+@@ -439,6 +456,200 @@
/* ------------------------------------------------------------
+ String* make_autodoc(Node *n, autodoc_t ad_type) {
+
+ if (ad_type == AUTODOC_CLASS)
-+ return NULL; // No function call do document in this case
++ return NULL; // No function call to document in this case
+
-+ // check how should the parameters be rendered?
-+ String* autodoc = Getattr(n, "feature:autodoc");
-+ bool showTypes;
-+ if (Strcmp(autodoc, "0") == 0)
-+ showTypes = false;
-+ else if (Strcmp(autodoc, "1") == 0)
-+ showTypes = true;
-+ else
-+ return autodoc;
-+
+ // If the function is overloaded then this funciton is called
+ // for the last one. Rewind to the first so the docstrings are
+ // in order.
+
+ String* doc = NewString("");
+ while (n) {
++ bool showTypes = false;
++ bool skipAuto = false;
++
++ // check how should the parameters be rendered?
++ String* autodoc = Getattr(n, "feature:autodoc");
++ if (Strcmp(autodoc, "0") == 0)
++ showTypes = false;
++ else if (Strcmp(autodoc, "1") == 0)
++ showTypes = true;
++ else {
++ // if not "0" or "1" then autodoc is already the string that should be used
++ Printf(doc, "%s", autodoc);
++ skipAuto = true;
++ }
++
++ if (!skipAuto) {
+ String* symname = Getattr(n, "sym:name");
+ SwigType* type = Getattr(n, "type");
+
+ Node* lookup = Swig_symbol_clookup(type, 0);
+ if (lookup)
+ type = Getattr(lookup, "sym:name");
-+ }
++ }
+ }
+
+ switch ( ad_type ) {
+ case AUTODOC_DTOR:
+ Printf(doc, "__del__()");
+ break;
-+
++
+ case AUTODOC_STATICFUNC:
+ Printf(doc, "%s.%s(%s)", class_name, symname, make_autodocParmList(n, showTypes));
+ if (type) Printf(doc, " -> %s", type);
+ if (type) Printf(doc, " -> %s", type);
+ break;
+ }
-+
-+ // if it's overloaded then get the next decl and loop around again
-+ n = Getattr(n, "sym:nextSibling");
-+ if (n)
-+ Printf(doc, "\n");
++ }
++
++ // if it's overloaded then get the next decl and loop around again
++ n = Getattr(n, "sym:nextSibling");
++ if (n)
++ Printf(doc, "\n");
+ }
+
+ return doc;
* have_addtofunc()
* Check if there is a %addtofunc directive and it has text
* ------------------------------------------------------------ */
-@@ -1661,7 +1865,9 @@
+@@ -1661,7 +1872,9 @@
}
}
Printf(f_shadow,":\n");
if (!modern) {
Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL);
if (Len(base_class)) {
-@@ -1796,14 +2002,20 @@
+@@ -1796,14 +2009,20 @@
Printv(f_shadow,pycode,"\n",NIL);
} else {
}
}
-@@ -1820,12 +2032,18 @@
+@@ -1820,12 +2039,18 @@
String *symname = Getattr(n,"sym:name");
Language::staticmemberfunctionHandler(n);
if (shadow) {
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname,
" = staticmethod(", symname, ")\n", NIL);
-@@ -1912,6 +2130,8 @@
+@@ -1912,6 +2137,8 @@
Printv(f_shadow, tab4, "def __init__(self, *args",
(allow_kwargs ? ", **kwargs" : ""), "):\n", NIL);
Printv(f_shadow, pass_self, NIL);
if (!modern) {
Printv(f_shadow, tab8, "_swig_setattr(self, ", rclassname, ", 'this', ",
-@@ -1927,7 +2147,7 @@
+@@ -1927,7 +2154,7 @@
Printv(f_shadow, tab8, "del newobj.thisown\n", NIL);
}
if ( have_addtofunc(n) )
Delete(pass_self);
}
have_constructor = 1;
-@@ -1945,6 +2165,8 @@
+@@ -1945,6 +2172,8 @@
Printv(f_shadow_stubs, "\ndef ", symname, "(*args",
(allow_kwargs ? ", **kwargs" : ""), "):\n", NIL);
Printv(f_shadow_stubs, tab4, "val = ",
funcCallHelper(Swig_name_construct(symname), allow_kwargs), "\n", NIL);
Printv(f_shadow_stubs, tab4, "val.thisown = 1\n", NIL);
-@@ -1978,11 +2200,13 @@
+@@ -1978,11 +2207,13 @@
Printv(f_shadow,pycode,"\n", NIL);
} else {
Printv(f_shadow, tab4, "def __del__(self, destroy=", module, ".", Swig_name_destroy(symname), "):\n", NIL);