summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-11-17 23:06:21 +0100
committermathieui <mathieui@mathieui.net>2012-11-17 23:06:21 +0100
commit27b7219b79280885128e82c0fcf0acdc8ed2eb26 (patch)
tree41ec6ba469bb65f3bfc99a6d394f0049d590ff41 /src
parenta1c3d0dcdf0b202cbf861c27b04cb8630b68f89f (diff)
downloadpoezio-27b7219b79280885128e82c0fcf0acdc8ed2eb26.tar.gz
poezio-27b7219b79280885128e82c0fcf0acdc8ed2eb26.tar.bz2
poezio-27b7219b79280885128e82c0fcf0acdc8ed2eb26.tar.xz
poezio-27b7219b79280885128e82c0fcf0acdc8ed2eb26.zip
Changes to the plugin_dir option are now taken into account on runtime
Diffstat (limited to 'src')
-rw-r--r--src/core.py3
-rw-r--r--src/plugin_manager.py7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 74b12d0c..b6992cc5 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1993,6 +1993,9 @@ class Core(object):
# Remove all gaptabs if switching from gaps to nogaps
if option == 'create_gaps' and value.lower() == 'false':
self.tabs = list(filter(lambda x: bool(x), self.tabs))
+ elif option == 'plugins_dir':
+ path = os.path.expanduser(value)
+ self.plugin_manager.on_plugins_dir_change(path)
self.information(msg, 'Info')
def completion_set(self, the_input):
diff --git a/src/plugin_manager.py b/src/plugin_manager.py
index 4c3007cc..ef0fae08 100644
--- a/src/plugin_manager.py
+++ b/src/plugin_manager.py
@@ -262,3 +262,10 @@ class PluginManager(object):
completion function that completes the name of the plugins that are loaded
"""
return the_input.auto_completion(list(self.plugins.keys()), '', quotify=False)
+
+ def on_plugins_dir_change(self, new_value):
+ global plugins_dir
+ if plugins_dir in sys.path:
+ sys.path.remove(plugins_dir)
+ sys.path.append(new_value)
+ plugins_dir = new_value