From e838c488f7f2dad14ca1e9b619e218f5685f248d Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Tue, 9 Dec 2014 13:49:21 +0000 Subject: Make plugin loading work properly --- turbo_hipster/worker_server.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/turbo_hipster/worker_server.py b/turbo_hipster/worker_server.py index c01e8f2..00cc50b 100644 --- a/turbo_hipster/worker_server.py +++ b/turbo_hipster/worker_server.py @@ -17,6 +17,7 @@ import logging import os +import sys import threading import yaml @@ -89,10 +90,11 @@ class Server(threading.Thread): self.log.debug('Loading plugins') # Load plugins for plugin in self.config['plugins']: - if plugin['pythonpath'] not in sys.path: - sys.path.append(plugin['pythonpath']) + if plugin['location'] not in sys.path: + sys.path.append(plugin['location']) self.plugins.append({ - 'module': __import__(plugin['import-path']), + 'module': __import__(plugin['import-path'], + fromlist='.'.join(plugin['import-path'].split('.')[:-1])), 'plugin_config': plugin }) self.log.debug('Plugin %s loaded' % plugin['name']) -- cgit v1.2.1