summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDaniel Lupu <lupu.daniel.f@gmail.com>2016-05-19 00:37:17 +0300
committerDaniel Lupu <lupu.daniel.f@gmail.com>2016-05-19 00:37:17 +0300
commitcbe0062dfe75b50be1eecf7501d5331d07701d37 (patch)
tree9a0a7b5a8fba55f674274dcb5a5be49f47415076
parent43cc6c32ce9ae28931c0abb83e6e62c9bb2616d5 (diff)
downloadranger-cbe0062dfe75b50be1eecf7501d5331d07701d37.tar.gz
use importlib to load pugins, and try to load commands from them
-rw-r--r--ranger/core/main.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 39d682f7..2972a1eb 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -6,6 +6,7 @@
 import os.path
 import sys
 import tempfile
+import importlib
 
 def main():
     """initialize objects and run the filemanager"""
@@ -301,7 +302,8 @@ def load_settings(fm, clean):
             ranger.fm = fm
             for plugin in sorted(plugins):
                 try:
-                    module = __import__('plugins', fromlist=[plugin])
+                    module = importlib.import_module('plugins.' + plugin)
+                    fm.commands.load_commands_from_module(module)
                     fm.log.append("Loaded plugin '%s'." % plugin)
                 except Exception as e:
                     fm.log.append("Error in plugin '%s'" % plugin)