summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--poezio/plugin_manager.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py
index 2b7b7374..58cfb3d3 100644
--- a/poezio/plugin_manager.py
+++ b/poezio/plugin_manager.py
@@ -10,6 +10,7 @@ import os
from importlib import import_module, machinery
from pathlib import Path
from os import path
+import pkg_resources
from poezio import tabs, xdg
from poezio.core.structs import Command, Completion
@@ -74,6 +75,14 @@ class PluginManager:
module = import_module('poezio_plugins.%s' % name)
except ModuleNotFoundError:
pass
+ for entry in pkg_resources.iter_entry_points('poezio_plugins'):
+ if entry.name == name:
+ try:
+ module = entry.load()
+ except ImportError:
+ pass
+ finally:
+ break
if not module:
self.core.information('Could not find plugin: %s' % name,
'Error')