[glade] Python plugin: support multiple paths in env variable
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] Python plugin: support multiple paths in env variable
- Date: Wed, 10 Jun 2020 19:05:14 +0000 (UTC)
commit c687c0c05aac47794ced949f8647fecd0625e006
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Mon Jun 8 20:49:16 2020 -0300
Python plugin: support multiple paths in env variable
plugins/python/glade-python.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/plugins/python/glade-python.c b/plugins/python/glade-python.c
index bbdbbe77..7927fcba 100644
--- a/plugins/python/glade-python.c
+++ b/plugins/python/glade-python.c
@@ -95,6 +95,7 @@ glade_python_setup ()
GString *command;
const gchar *module_path;
const GList *paths;
+ gchar **tokens = NULL;
Py_SetProgramName (PY_STRING (PACKAGE_NAME));
@@ -140,9 +141,14 @@ glade_python_setup ()
command = g_string_new ("import sys; sys.path+=[");
/* GLADE_ENV_MODULE_PATH has priority */
- module_path = g_getenv (GLADE_ENV_MODULE_PATH);
- if (module_path)
- g_string_append_printf (command, "'%s', ", module_path);
+ if ((module_path = g_getenv (GLADE_ENV_MODULE_PATH)))
+ {
+ tokens = g_strsplit(module_path, ":", -1);
+ gint i;
+
+ for (i = 0; tokens[i]; i++)
+ g_string_append_printf (command, "'%s', ", tokens[i]);
+ }
/* Append modules directory */
g_string_append_printf (command, "'%s'", glade_app_get_modules_dir ());
@@ -161,6 +167,7 @@ glade_python_setup ()
PyRun_SimpleString (command->str);
g_string_free (command, TRUE);
+ g_strfreev (tokens);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]