where one or more of them have a specific autodoc (not "0" or "1")
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24622
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
retrieving revision 1.28
diff -u -r1.28 python.cxx
--- Source/Modules/python.cxx 18 Nov 2003 20:19:15 -0000 1.28
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";
@@ -68,6 +68,17 @@
-noexcept - No automatic exception handling\n\
-noproxy - Don't generate proxy classes \n\n";
/* ------------------------------------------------------------
/* ------------------------------------------------------------
+ String* make_autodoc(Node *n, autodoc_t ad_type) {
+
+ if (ad_type == AUTODOC_CLASS)
+ 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.
+ // 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) {
+
+ 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");
+
+ 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");
+ Node* lookup = Swig_symbol_clookup(type, 0);
+ if (lookup)
+ type = Getattr(lookup, "sym:name");
+ }
+
+ switch ( ad_type ) {
+ }
+
+ switch ( ad_type ) {
+ case AUTODOC_DTOR:
+ Printf(doc, "__del__()");
+ break;
+ 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);
+ 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 (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");
* have_addtofunc()
* Check if there is a %addtofunc directive and it has text
* ------------------------------------------------------------ */
* have_addtofunc()
* Check if there is a %addtofunc directive and it has text
* ------------------------------------------------------------ */
}
}
Printf(f_shadow,":\n");
}
}
Printf(f_shadow,":\n");
if (!modern) {
Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL);
if (Len(base_class)) {
if (!modern) {
Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL);
if (Len(base_class)) {
Printv(f_shadow,pycode,"\n",NIL);
} else {
Printv(f_shadow,pycode,"\n",NIL);
} else {
String *symname = Getattr(n,"sym:name");
Language::staticmemberfunctionHandler(n);
if (shadow) {
String *symname = Getattr(n,"sym:name");
Language::staticmemberfunctionHandler(n);
if (shadow) {
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname,
" = staticmethod(", symname, ")\n", NIL);
Printv(f_shadow, tab4, modern ? "" : "if _newclass:", symname,
" = staticmethod(", symname, ")\n", NIL);
Printv(f_shadow, tab4, "def __init__(self, *args",
(allow_kwargs ? ", **kwargs" : ""), "):\n", NIL);
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', ",
Printv(f_shadow, pass_self, NIL);
if (!modern) {
Printv(f_shadow, tab8, "_swig_setattr(self, ", rclassname, ", 'this', ",
Printv(f_shadow, tab8, "del newobj.thisown\n", NIL);
}
if ( have_addtofunc(n) )
Printv(f_shadow, tab8, "del newobj.thisown\n", NIL);
}
if ( have_addtofunc(n) )
Delete(pass_self);
}
have_constructor = 1;
Delete(pass_self);
}
have_constructor = 1;
Printv(f_shadow_stubs, "\ndef ", symname, "(*args",
(allow_kwargs ? ", **kwargs" : ""), "):\n", NIL);
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);
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);
Printv(f_shadow,pycode,"\n", NIL);
} else {
Printv(f_shadow, tab4, "def __del__(self, destroy=", module, ".", Swig_name_destroy(symname), "):\n", NIL);
Printv(f_shadow,pycode,"\n", NIL);
} else {
Printv(f_shadow, tab4, "def __del__(self, destroy=", module, ".", Swig_name_destroy(symname), "):\n", NIL);