[gedit] Fix things to make work python plugins on win32.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Fix things to make work python plugins on win32.
- Date: Fri, 20 Nov 2009 16:43:44 +0000 (UTC)
commit 03def963fd345c4a16705ceb4eec774a12197c46
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri Nov 20 17:42:41 2009 +0100
Fix things to make work python plugins on win32.
configure.ac | 24 +++++++++++++------
plugin-loaders/python/gedit-plugin-loader-python.c | 10 ++++++-
plugins/quickopen/quickopen/windowhelper.py | 2 +-
3 files changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fe1fda7..4f47a1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -354,16 +354,24 @@ if test "x$have_python" != "xno"; then
fi
if test "x$have_python" != "xno"; then
- PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
PYTHON_LIBS="-lpython$PYTHON_VERSION"
- PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
- PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
- PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
- PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
- PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
- PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
- PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
+
+ if test "$os_win32" = yes; then
+ PYTHON_LIBS=`echo $PYTHON_LIBS | sed 's/\.//g'`
+ PYTHON_LIB_LOC="-I$PY_EXEC_PREFIX/libs"
+ PYTHON_CFLAGS="-I$PY_EXEC_PREFIX/include"
+ PYTHON_EXTRA_LIBS=
+ else
+ PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
+ PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
+ PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
+ PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
+ PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
+ PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
+ PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
+ PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
+ fi
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_LIB_LOC])
AC_SUBST([PYTHON_CFLAGS])
diff --git a/plugin-loaders/python/gedit-plugin-loader-python.c b/plugin-loaders/python/gedit-plugin-loader-python.c
index 0b718e4..e02c12e 100644
--- a/plugin-loaders/python/gedit-plugin-loader-python.c
+++ b/plugin-loaders/python/gedit-plugin-loader-python.c
@@ -486,9 +486,11 @@ gedit_python_init (GeditPluginLoaderPython *loader)
PyObject *mdict, *tuple;
PyObject *gedit, *geditutils, *geditcommands, *geditplugins;
PyObject *gettext, *install, *gettext_args;
- struct sigaction old_sigint;
- gint res;
char *argv[] = { "gedit", NULL };
+#ifndef G_OS_WIN32
+ gint res;
+ struct sigaction old_sigint;
+#endif
if (loader->priv->init_failed)
{
@@ -514,6 +516,7 @@ gedit_python_init (GeditPluginLoaderPython *loader)
/* CHECK: can't we use Py_InitializeEx instead of Py_Initialize in order
to avoid to manage signal handlers ? - Paolo (Dec. 31, 2006) */
+#ifndef G_OS_WIN32
/* Save old handler */
res = sigaction (SIGINT, NULL, &old_sigint);
if (res != 0)
@@ -524,10 +527,12 @@ gedit_python_init (GeditPluginLoaderPython *loader)
return FALSE;
}
+#endif
/* Python initialization */
Py_Initialize ();
+#ifndef G_OS_WIN32
/* Restore old handler */
res = sigaction (SIGINT, &old_sigint, NULL);
if (res != 0)
@@ -538,6 +543,7 @@ gedit_python_init (GeditPluginLoaderPython *loader)
goto python_init_error;
}
+#endif
PySys_SetArgv (1, argv);
diff --git a/plugins/quickopen/quickopen/windowhelper.py b/plugins/quickopen/quickopen/windowhelper.py
index 750f308..0fb50ab 100644
--- a/plugins/quickopen/quickopen/windowhelper.py
+++ b/plugins/quickopen/quickopen/windowhelper.py
@@ -70,7 +70,7 @@ class WindowHelper:
self.on_quick_open_activate)
])
- manager.insert_action_group(self._action_group)
+ manager.insert_action_group(self._action_group, -1)
self._ui_id = manager.add_ui_from_string(ui_str)
def _create_popup(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]