1 Index: Doc/Manual/Python.html
2 ===================================================================
3 RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
4 retrieving revision 1.31
5 diff -u -4 -r1.31 Python.html
6 --- Doc/Manual/Python.html 6 Oct 2005 21:49:58 -0000 1.31
7 +++ Doc/Manual/Python.html 28 Jun 2006 22:22:00 -0000
8 @@ -4461,10 +4461,10 @@
9 <H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
13 -Usign docstrings in Python code is becoming more and more important
14 -ans more tools are coming on the scene that take advantage of them,
15 +Using docstrings in Python code is becoming more and more important
16 +and more tools are coming on the scene that take advantage of them,
17 everything from full-blown documentaiton generators to class browsers
18 and popup call-tips in Python-aware IDEs. Given the way that SWIG
19 generates the proxy code by default, your users will normally get
20 something like <tt>"function_name(*args)"</tt> in the popup calltip of
22 ===================================================================
23 RCS file: /cvsroot/swig/SWIG/Lib/swig.swg,v
24 retrieving revision 1.49
25 diff -u -4 -r1.49 swig.swg
26 --- Lib/swig.swg 15 Oct 2005 00:15:30 -0000 1.49
27 +++ Lib/swig.swg 28 Jun 2006 22:22:00 -0000
30 #define %nodefault %feature("nodefault","1")
31 #define %default %feature("nodefault","0")
32 #define %clearnodefault %feature("nodefault","")
33 -#define %makedefault %cleardefault
34 +#define %makedefault %clearnodefault
36 /* the %exception directive */
39 Index: Lib/swiginit.swg
40 ===================================================================
41 RCS file: /cvsroot/swig/SWIG/Lib/swiginit.swg,v
42 retrieving revision 1.5
43 diff -u -4 -r1.5 swiginit.swg
44 --- Lib/swiginit.swg 12 Sep 2005 23:25:03 -0000 1.5
45 +++ Lib/swiginit.swg 28 Jun 2006 22:22:00 -0000
57 +#define SWIGRUNTIME_DEBUG
61 SWIG_InitializeModule(void *clientdata) {
62 - swig_type_info *type, *ret;
63 - swig_cast_info *cast;
65 swig_module_info *module_head;
66 static int init_run = 0;
69 SWIG_SetModule(clientdata, &swig_module);
72 /* Now work on filling in swig_module.types */
73 +#ifdef SWIGRUNTIME_DEBUG
74 + printf("SWIG_InitializeModule: size %d\n", swig_module.size);
76 for (i = 0; i < swig_module.size; ++i) {
78 + swig_type_info *type = 0;
79 + swig_type_info *ret;
80 + swig_cast_info *cast;
82 +#ifdef SWIGRUNTIME_DEBUG
83 + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
86 /* if there is another module already loaded */
87 if (swig_module.next != &swig_module) {
88 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
91 /* Overwrite clientdata field */
92 - if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
93 +#ifdef SWIGRUNTIME_DEBUG
94 + printf("SWIG_InitializeModule: found type %s\n", type->name);
96 + if (swig_module.type_initial[i]->clientdata) {
97 + type->clientdata = swig_module.type_initial[i]->clientdata;
98 +#ifdef SWIGRUNTIME_DEBUG
99 + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
103 type = swig_module.type_initial[i];
109 /* Don't need to add information already in the list */
111 +#ifdef SWIGRUNTIME_DEBUG
112 + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
114 if (swig_module.next != &swig_module) {
115 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
116 +#ifdef SWIGRUNTIME_DEBUG
117 + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
120 - if (ret && type == swig_module.type_initial[i]) {
124 + if (type == swig_module.type_initial[i]) {
125 +#ifdef SWIGRUNTIME_DEBUG
126 + printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
131 + /* Check for casting already in the list */
132 + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
133 +#ifdef SWIGRUNTIME_DEBUG
134 + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
136 + if (!ocast) ret = 0;
142 +#ifdef SWIGRUNTIME_DEBUG
143 + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
146 type->cast->prev = cast;
147 cast->next = type->cast;
155 /* Set entry in modules->types array equal to the type */
156 swig_module.types[i] = type;
158 swig_module.types[i] = 0;
160 +#ifdef SWIGRUNTIME_DEBUG
161 + printf("**** SWIG_InitializeModule: Cast List ******\n");
162 + for (i = 0; i < swig_module.size; ++i) {
164 + swig_cast_info *cast = swig_module.cast_initial[i];
165 + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
166 + while (cast->type) {
167 + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
171 + printf("---- Total casts: %d\n",j);
173 + printf("**** SWIG_InitializeModule: Cast List ******\n");
177 /* This function will propagate the clientdata field of type to
178 * any new swig_type_info structures that have been added into the list
189 Index: Source/Modules/python.cxx
190 ===================================================================
191 RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
192 retrieving revision 1.107
193 diff -u -4 -r1.107 python.cxx
194 --- Source/Modules/python.cxx 7 Oct 2005 13:17:41 -0000 1.107
195 +++ Source/Modules/python.cxx 28 Jun 2006 22:22:01 -0000
197 static File *f_directors_h = 0;
198 static File *f_init = 0;
199 static File *f_shadow_py = 0;
200 static String *f_shadow = 0;
201 -static String *f_shadow_imports = 0;
202 static String *f_shadow_stubs = 0;
204 static String *methods;
205 static String *class_name;
208 Delete(filen); filen = NULL;
210 f_shadow = NewString("");
211 - f_shadow_imports = NewString("");
212 f_shadow_stubs = NewString("");
214 Swig_register_filebyname("shadow",f_shadow);
215 Swig_register_filebyname("python",f_shadow);
217 if (mod_docstring && Len(mod_docstring)) {
218 Printv(f_shadow, "\n\"\"\"\n", mod_docstring, "\n\"\"\"\n", NIL);
219 Delete(mod_docstring); mod_docstring = NULL;
222 + Printf(f_shadow,"\nimport %s\n\n", module);
225 /* always needed, a class can be forced to be no-modern, such as an exception */
228 Printf(f_wrappers,"}\n");
229 Printf(f_wrappers,"#endif\n");
232 - Printf(f_shadow_imports,"\nimport %s\n", module);
233 - Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
234 Printv(f_shadow_py, f_shadow, "\n",NIL);
235 Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
241 // finally, output the name of the imported module
242 Printf(import, "%s\n", modname);
244 - if (!Strstr(f_shadow_imports, import)) {
245 - Printf(f_shadow_imports, "%s", import);
247 + Printf(f_shadow, "%s", import);
251 return Language::importDirective(n);
252 @@ -774,10 +769,15 @@
254 // Do the param type too?
256 type = SwigType_base(type);
257 - lookup = Swig_symbol_clookup(type, 0);
258 - if (lookup) type = Getattr(lookup, "sym:name");
259 + SwigType* qt = SwigType_typedef_resolve_all(type);
260 + if (SwigType_isenum(qt))
261 + type = NewString("int");
263 + lookup = Swig_symbol_clookup(type, 0);
264 + if (lookup) type = Getattr(lookup, "sym:name");
266 Printf(doc, "%s ", type);
270 Index: Lib/python/pyinit.swg
271 ===================================================================
272 RCS file: /cvsroot/swig/SWIG/Lib/python/pyinit.swg,v
273 retrieving revision 1.19
274 diff -u -4 -r1.19 pyinit.swg
275 --- Lib/python/pyinit.swg 17 Jun 2005 19:12:20 -0000 1.19
276 +++ Lib/python/pyinit.swg 28 Jun 2006 22:22:01 -0000
277 @@ -214,13 +214,13 @@
278 swig_type_info **types,
279 swig_type_info **types_initial) {
281 for (i = 0; methods[i].ml_name; ++i) {
282 - char *c = methods[i].ml_doc;
283 + const char *c = methods[i].ml_doc;
284 if (c && (c = strstr(c, "swig_ptr: "))) {
286 swig_const_info *ci = 0;
287 - char *name = c + 10;
288 + const char *name = c + 10;
289 for (j = 0; const_table[j].type; ++j) {
290 if (strncmp(const_table[j].name, name,
291 strlen(const_table[j].name)) == 0) {
292 ci = &(const_table[j]);
293 Index: Lib/python/pyrun.swg
294 ===================================================================
295 RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v
296 retrieving revision 1.73
297 diff -u -4 -r1.73 pyrun.swg
298 --- Lib/python/pyrun.swg 23 Aug 2005 10:55:05 -0000 1.73
299 +++ Lib/python/pyrun.swg 28 Jun 2006 22:22:01 -0000
303 if (PyCFunction_Check(obj)) {
304 /* here we get the method pointer for callbacks */
305 - char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
306 + const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
307 c = doc ? strstr(doc, "swig_ptr: ") : 0;
309 c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0;
310 if (!c) goto type_error;