Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK
Commits
4f297425
Commit
4f297425
authored
Jul 30, 2015
by
David Gobbi
Browse files
Remove vestigial "module" arg from python init.
parent
212e9425
Changes
3
Hide whitespace changes
Inline
Side-by-side
Wrapping/PythonCore/PyVTKMutableObject.cxx
View file @
4f297425
...
...
@@ -33,7 +33,7 @@
//--------------------------------------------------------------------
// methods for adding this type to a module
extern
"C"
{
VTKWRAPPINGPYTHONCORE_EXPORT
void
PyVTKAddFile_mutable
(
PyObject
*
,
const
char
*
);
}
extern
"C"
{
VTKWRAPPINGPYTHONCORE_EXPORT
void
PyVTKAddFile_mutable
(
PyObject
*
);
}
//--------------------------------------------------------------------
...
...
@@ -812,8 +812,7 @@ PyTypeObject PyVTKMutableObject_Type = {
//--------------------------------------------------------------------
// Exported method for adding this type to a module's dict
void
PyVTKAddFile_mutable
(
PyObject
*
dict
,
const
char
*
)
void
PyVTKAddFile_mutable
(
PyObject
*
dict
)
{
PyObject
*
o
=
(
PyObject
*
)
&
PyVTKMutableObject_Type
;
...
...
Wrapping/Tools/vtkWrapPython.c
View file @
4f297425
...
...
@@ -394,7 +394,7 @@ int main(int argc, char *argv[])
/* do the export of the main entry point */
fprintf
(
fp
,
"extern
\"
C
\"
{ %s void PyVTKAddFile_%s(PyObject
*, const char
*); }
\n
"
,
"extern
\"
C
\"
{ %s void PyVTKAddFile_%s(PyObject *); }
\n
"
,
"VTK_ABI_EXPORT"
,
name
);
/* get the module that is being wrapped */
...
...
@@ -483,7 +483,7 @@ int main(int argc, char *argv[])
contents
->
NumberOfConstants
);
fprintf
(
fp
,
"void PyVTKAddFile_%s(
\n
"
" PyObject *%s
, const char *
)
\n
"
" PyObject *%s)
\n
"
"{
\n
"
"%s"
,
name
,
...
...
Wrapping/Tools/vtkWrapPythonInit.c
View file @
4f297425
...
...
@@ -14,15 +14,14 @@ static void CreateInitFile(const char *libName, FILE *fout)
"#pragma warning ( disable : 4706 )
\n
"
"#endif // Windows Warnings
\n\n
"
);
fprintf
(
fout
,
"extern
\"
C
\"
void real_init%s(const char *
modulename
);
\n\n
"
,
libName
);
fprintf
(
fout
,
"extern
\"
C
\"
void real_init%s(const char *);
\n\n
"
,
libName
);
for
(;;)
{
fprintf
(
fout
,
"extern
\"
C
\"
{ %svoid init%s%s(); }
\n\n
"
,
dllexp
,
prefix
,
libName
);
fprintf
(
fout
,
"void init%s%s()
\n
{
\n
"
,
prefix
,
libName
);
fprintf
(
fout
,
" static const char modulename[] =
\"
%s%s
\"
;
\n
"
,
prefix
,
libName
);
fprintf
(
fout
,
" real_init%s(modulename);
\n
}
\n\n
"
,
libName
);
fprintf
(
fout
,
" real_init%s(NULL);
\n
}
\n\n
"
,
libName
);
#if defined(__CYGWIN__) || !defined(_WIN32)
/* add a "lib" prefix for compatibility with old python scripts */
...
...
@@ -54,26 +53,26 @@ static void CreateImplFile(const char *libName,
fprintf
(
fout
,
"// Handle compiler warning messages, etc.
\n
"
"#if defined( _MSC_VER ) && !defined(VTK_DISPLAY_WIN32_WARNINGS)
\n
"
"#pragma warning ( disable : 4706 )
\n
"
"#endif // Windows Warnings
\n\n
"
);
"#endif // Windows Warnings
\n\n
"
);
for
(
i
=
0
;
i
<
numFiles
;
i
++
)
{
fprintf
(
fout
,
"extern
\"
C
\"
{%sPyObject *PyVTKAddFile_%s(PyObject
*, const char
*); }
\n
"
,
dllexp
,
files
[
i
]);
fprintf
(
fout
,
"extern
\"
C
\"
{%sPyObject *PyVTKAddFile_%s(PyObject *); }
\n
"
,
dllexp
,
files
[
i
]);
}
fprintf
(
fout
,
"
\n
static PyMethodDef Py%s_ClassMethods[] = {
\n
"
,
libName
);
fprintf
(
fout
,
"{NULL, NULL, 0, NULL}};
\n\n
"
);
fprintf
(
fout
,
"extern
\"
C
\"
{%svoid real_init%s(const char *
modulename
); }
\n\n
"
,
dllexp
,
libName
);
fprintf
(
fout
,
"extern
\"
C
\"
{%svoid real_init%s(const char *); }
\n\n
"
,
dllexp
,
libName
);
fprintf
(
fout
,
"void real_init%s(const char *
modulename
)
\n
{
\n
"
,
libName
);
fprintf
(
fout
,
"void real_init%s(const char *)
\n
{
\n
"
,
libName
);
/* module init function */
fprintf
(
fout
,
" PyObject *m
, *d;
\n
\n
"
);
fprintf
(
fout
,
" m = Py_InitModule(modulename,
Py%s_ClassMethods);
\n
"
,
libName
);
fprintf
(
fout
,
" PyObject *m
= Py_InitModule(
\"
%s
\"
,
\n
"
"
Py%s_ClassMethods);
\n
"
,
libName
,
libName
);
fprintf
(
fout
,
" d = PyModule_GetDict(m);
\n
"
);
fprintf
(
fout
,
"
PyObject *
d = PyModule_GetDict(m);
\n
"
);
fprintf
(
fout
,
" if (!d)
\n
"
);
fprintf
(
fout
,
" {
\n
"
);
fprintf
(
fout
,
" Py_FatalError(
\"
can't get dictionary for module %s
\"
);
\n
"
,
...
...
@@ -82,7 +81,7 @@ static void CreateImplFile(const char *libName,
for
(
i
=
0
;
i
<
numFiles
;
i
++
)
{
fprintf
(
fout
,
" PyVTKAddFile_%s(d
, modulename
);
\n
"
,
fprintf
(
fout
,
" PyVTKAddFile_%s(d);
\n
"
,
files
[
i
]);
}
fprintf
(
fout
,
"}
\n\n
"
);
...
...
David Gobbi
@dgobbi
mentioned in commit
6f284f4f
·
Aug 06, 2015
mentioned in commit
6f284f4f
mentioned in commit 6f284f4f363f411413a5750003498dfe197914ae
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment