Moved initmoo() to mooplugin-python.c

master
Yevgen Muntyan 2006-06-19 02:54:46 -05:00
parent c07907a682
commit 9d544ab356
2 changed files with 24 additions and 18 deletions

View File

@ -31,6 +31,7 @@
static PyObject *main_mod;
static gboolean in_moo_module;
static MooPyObject*
@ -355,21 +356,24 @@ moo_python_plugin_read_dirs (void)
gboolean
_moo_python_plugin_init (void)
{
if (!moo_python_api_init ())
return FALSE;
if (!_moo_pygtk_init ())
if (!in_moo_module)
{
PyErr_Print ();
moo_python_init (MOO_PY_API_VERSION, NULL);
return FALSE;
}
if (!moo_python_api_init ())
return FALSE;
if (!_moo_pygtk_init ())
{
PyErr_Print ();
moo_python_init (MOO_PY_API_VERSION, NULL);
return FALSE;
}
#ifdef pyg_disable_warning_redirections
pyg_disable_warning_redirections ();
pyg_disable_warning_redirections ();
#else
moo_reset_log_func ();
moo_reset_log_func ();
#endif
}
moo_python_plugin_read_dirs ();
return TRUE;
@ -395,3 +399,13 @@ MOO_PLUGIN_INIT_FUNC_DECL
_moo_python_plugin_init ();
}
#endif
#ifdef MOO_PYTHON_MODULE
void initmoo (void)
{
in_moo_module = TRUE;
moo_python_api_init ();
_moo_pygtk_init ();
}
#endif

View File

@ -116,11 +116,3 @@ _moo_pygtk_init (void)
return TRUE;
}
#ifdef MOO_PYTHON_MODULE
void initmoo (void)
{
_moo_pygtk_init ();
}
#endif