[geany/geany-plugins] 0b0f4d: geanypy: fix loading plugins from user config directory.

Thomas Martitz git-noreply at xxxxx
Fri Mar 11 07:57:15 UTC 2016


Branch:      refs/heads/master
Author:      Thomas Martitz <kugel at rockbox.org>
Committer:   Thomas Martitz <kugel at rockbox.org>
Date:        Fri, 11 Mar 2016 07:57:15 UTC
Commit:      0b0f4dc89025bbf9f0853eeff01886d7e93d559b
             https://github.com/geany/geany-plugins/commit/0b0f4dc89025bbf9f0853eeff01886d7e93d559b

Log Message:
-----------
geanypy: fix loading plugins from user config directory.

Have to add ~/.config/geany/plugins to Python's path otherwise loading plugins from there
fails.

Tested with a relatively complex plugin which also ships extra modules in subdirectory:
https://github.com/sagarchalise/geanypy-reStructured-preview


Modified Paths:
--------------
    geanypy/src/geanypy-plugin.c

Modified: geanypy/src/geanypy-plugin.c
4 lines changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -119,9 +119,11 @@ GeanyPy_start_interpreter(void)
         "import os, sys\n"
         "path = '%s'.replace('~', os.path.expanduser('~'))\n"
         "sys.path.append(path)\n"
+        "path = '%s/plugins'.replace('~', os.path.expanduser('~'))\n"
+        "sys.path.append(path)\n"
         "path = '%s'.replace('~', os.path.expanduser('~'))\n"
         "sys.path.append(path)\n"
-        "import geany\n", py_dir, GEANYPY_PLUGIN_DIR);
+        "import geany\n", py_dir, geany_data->app->configdir, GEANYPY_PLUGIN_DIR);
     g_free(py_dir);
 
     PyRun_SimpleString(init_code);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list