use old import order to prevent error with circular importings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7960 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b2f07041e1
commit
b5fc607731
1 changed files with 20 additions and 7 deletions
|
|
@ -13,7 +13,7 @@ char cvsroot_python_cxx[] = "$Header$";
|
||||||
|
|
||||||
#include "swigmod.h"
|
#include "swigmod.h"
|
||||||
#include "cparse.h"
|
#include "cparse.h"
|
||||||
static int treduce = SWIG_cparse_template_reduce(1);
|
static int treduce = SWIG_cparse_template_reduce(0);
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
|
@ -61,6 +61,7 @@ static String *real_classname;
|
||||||
static int threads = 0;
|
static int threads = 0;
|
||||||
static int nothreads = 0;
|
static int nothreads = 0;
|
||||||
static int classptr = 0;
|
static int classptr = 0;
|
||||||
|
static int shadowimport = 1;
|
||||||
|
|
||||||
/* flags for the make_autodoc function */
|
/* flags for the make_autodoc function */
|
||||||
enum autodoc_t {
|
enum autodoc_t {
|
||||||
|
|
@ -92,7 +93,9 @@ Python Options (available with -python)\n\
|
||||||
-nothreads - Disable thread support for all the interface\n\
|
-nothreads - Disable thread support for all the interface\n\
|
||||||
-noexcept - No automatic exception handling\n\
|
-noexcept - No automatic exception handling\n\
|
||||||
-noh - Don't generate the output header file\n\
|
-noh - Don't generate the output header file\n\
|
||||||
-noproxy - Don't generate proxy classes \n\n";
|
-noproxy - Don't generate proxy classes \n\
|
||||||
|
-noproxyimport - Don't insert proxy import statements derived from the %import directive \n\
|
||||||
|
\n";
|
||||||
|
|
||||||
class PYTHON : public Language {
|
class PYTHON : public Language {
|
||||||
public:
|
public:
|
||||||
|
|
@ -222,6 +225,9 @@ public:
|
||||||
} else if ((strcmp(argv[i],"-noproxy") == 0)) {
|
} else if ((strcmp(argv[i],"-noproxy") == 0)) {
|
||||||
shadow = 0;
|
shadow = 0;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
|
} else if ((strcmp(argv[i],"-noproxyimport") == 0)) {
|
||||||
|
shadowimport = 0;
|
||||||
|
Swig_mark_arg(i);
|
||||||
} else if (strcmp(argv[i],"-keyword") == 0) {
|
} else if (strcmp(argv[i],"-keyword") == 0) {
|
||||||
use_kw = 1;
|
use_kw = 1;
|
||||||
SWIG_cparse_set_compact_default_args(1);
|
SWIG_cparse_set_compact_default_args(1);
|
||||||
|
|
@ -418,7 +424,6 @@ public:
|
||||||
f_shadow_stubs = NewString("");
|
f_shadow_stubs = NewString("");
|
||||||
|
|
||||||
Swig_register_filebyname("shadow",f_shadow);
|
Swig_register_filebyname("shadow",f_shadow);
|
||||||
Swig_register_filebyname("python_header",f_shadow_imports);
|
|
||||||
Swig_register_filebyname("python",f_shadow);
|
Swig_register_filebyname("python",f_shadow);
|
||||||
|
|
||||||
Printv(f_shadow_py,
|
Printv(f_shadow_py,
|
||||||
|
|
@ -554,8 +559,11 @@ public:
|
||||||
Printf(f_wrappers,"#endif\n");
|
Printf(f_wrappers,"#endif\n");
|
||||||
|
|
||||||
if (shadow) {
|
if (shadow) {
|
||||||
|
/*
|
||||||
Printf(f_shadow_imports,"\nimport %s\n", module);
|
Printf(f_shadow_imports,"\nimport %s\n", module);
|
||||||
Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
|
Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
|
||||||
|
*/
|
||||||
|
Printf(f_shadow_py,"\nimport %s\n", module);
|
||||||
Printv(f_shadow_py, f_shadow, "\n",NIL);
|
Printv(f_shadow_py, f_shadow, "\n",NIL);
|
||||||
Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
|
Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
|
||||||
|
|
||||||
|
|
@ -616,11 +624,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally, output the name of the imported module
|
// finally, output the name of the imported module
|
||||||
Printf(import, "%s\n", modname);
|
if (shadowimport) {
|
||||||
|
if (!options || (!Getattr(options, "noshadow") && !Getattr(options, "noproxy"))) {
|
||||||
if (!Strstr(f_shadow_imports, import)) {
|
Printf(import, "_%s\n", modname);
|
||||||
Printf(f_shadow_imports, "%s", import);
|
if (!Strstr(f_shadow_imports, import)) {
|
||||||
|
Printf(f_shadow, "import %s\n", modname);
|
||||||
|
Printf(f_shadow_imports, "%s", import);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Delete(import);
|
Delete(import);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue