summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-08 20:49:16 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-08 20:53:48 -0300
commitc687c0c05aac47794ced949f8647fecd0625e006 (patch)
tree77879dc959221eccee69375c680d1091e2c21c51
parent763aa56b2c0c87064164398bebe367d0aac992e6 (diff)
downloadglade-c687c0c05aac47794ced949f8647fecd0625e006.tar.gz
Python plugin: support multiple paths in env variable
-rw-r--r--plugins/python/glade-python.c13
1 files 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;
}