summaryrefslogtreecommitdiff
path: root/src/plugin_manager.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-08-10 00:24:27 +0200
committermathieui <mathieui@mathieui.net>2013-08-10 00:24:27 +0200
commit64c1a09023298e75eed0b2a0e736d1422f7f46b7 (patch)
tree618030ef3fc30754aef7e054e2eb400e4c3c3780 /src/plugin_manager.py
parenta50b32896d6d6f9ee9786575da65f2ea32b047de (diff)
downloadpoezio-64c1a09023298e75eed0b2a0e736d1422f7f46b7.tar.gz
poezio-64c1a09023298e75eed0b2a0e736d1422f7f46b7.tar.bz2
poezio-64c1a09023298e75eed0b2a0e736d1422f7f46b7.tar.xz
poezio-64c1a09023298e75eed0b2a0e736d1422f7f46b7.zip
Fix #2337 (search the themes the same way than plugins)
- Load the themes from: 1 - The sources found in the directory ../data/themes/ (if it exists) 2 - The user-defined dir (or ~/.local/blah) 3 - The poezio_themes package if found - Also fix some potential issues with the plugins importer
Diffstat (limited to 'src/plugin_manager.py')
-rw-r--r--src/plugin_manager.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugin_manager.py b/src/plugin_manager.py
index 4f728938..bb139dad 100644
--- a/src/plugin_manager.py
+++ b/src/plugin_manager.py
@@ -62,8 +62,6 @@ else:
if poezio_plugins.__path__:
load_path.append(poezio_plugins.__path__[0])
-sys.path.extend(load_path)
-
if version_info[1] >= 3: # 3.3 & >
from importlib import machinery
finder = machinery.PathFinder()
@@ -111,7 +109,7 @@ class PluginManager(object):
imp.acquire_lock()
module = imp.load_module(name, file, filename, info)
else: # 3.3 & >
- loader = finder.find_module(name)
+ loader = finder.find_module(name, load_path)
if not loader:
self.core.information('Could not find plugin')
return
@@ -324,9 +322,9 @@ class PluginManager(object):
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)
+ if plugins_dir in load_path:
+ load_path.remove(plugins_dir)
+ load_path.insert(0, new_value)
plugins_dir = new_value
def on_plugins_conf_dir_change(self, new_value):