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 29 Jan 2006 02:05:55 -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 29 Jan 2006 02:05:55 -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 29 Jan 2006 02:05:55 -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 29 Jan 2006 02:05:56 -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;
207 Swig_banner(f_runtime);
209 Printf(f_runtime,"#define SWIGPYTHON\n");
211 + String *package_version = NewString(PACKAGE_VERSION);
212 + char *token = strtok(Char(package_version), ".");
213 + String *vers = NewString("#define SWIG_VERSION 0x");
215 + int len = strlen(token);
216 + Printf(vers, "%s%s", (len == 1) ? "0" : "", token);
217 + token = strtok(NULL, ".");
219 + Printf(f_runtime, "%s\n", vers);
220 + Delete(package_version);
223 if (directorsEnabled()) {
224 Printf(f_runtime,"#define SWIG_DIRECTORS\n");
229 Delete(filen); filen = NULL;
231 f_shadow = NewString("");
232 - f_shadow_imports = NewString("");
233 f_shadow_stubs = NewString("");
235 Swig_register_filebyname("shadow",f_shadow);
236 Swig_register_filebyname("python",f_shadow);
238 if (mod_docstring && Len(mod_docstring)) {
239 Printv(f_shadow, "\n\"\"\"\n", mod_docstring, "\n\"\"\"\n", NIL);
240 Delete(mod_docstring); mod_docstring = NULL;
243 + Printf(f_shadow,"\nimport %s\n\n", module);
246 /* always needed, a class can be forced to be no-modern, such as an exception */
249 Printf(f_wrappers,"}\n");
250 Printf(f_wrappers,"#endif\n");
253 - Printf(f_shadow_imports,"\nimport %s\n", module);
254 - Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
255 Printv(f_shadow_py, f_shadow, "\n",NIL);
256 Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
262 // finally, output the name of the imported module
263 Printf(import, "%s\n", modname);
265 - if (!Strstr(f_shadow_imports, import)) {
266 - Printf(f_shadow_imports, "%s", import);
268 + Printf(f_shadow, "%s", import);
272 return Language::importDirective(n);
273 @@ -774,10 +781,15 @@
275 // Do the param type too?
277 type = SwigType_base(type);
278 - lookup = Swig_symbol_clookup(type, 0);
279 - if (lookup) type = Getattr(lookup, "sym:name");
280 + SwigType* qt = SwigType_typedef_resolve_all(type);
281 + if (SwigType_isenum(qt))
282 + type = NewString("int");
284 + lookup = Swig_symbol_clookup(type, 0);
285 + if (lookup) type = Getattr(lookup, "sym:name");
287 Printf(doc, "%s ", type);