diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-12-09 13:49:21 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-12-09 13:49:21 +0000 |
commit | e838c488f7f2dad14ca1e9b619e218f5685f248d (patch) | |
tree | 94af740eaa266cb7f6ccfb9331d429f1dbdd482e | |
parent | 45b4916894d6f1b4b0611e2db44c009c052d0345 (diff) | |
download | turbo-hipster-e838c488f7f2dad14ca1e9b619e218f5685f248d.tar.gz |
Make plugin loading work properly
-rw-r--r-- | turbo_hipster/worker_server.py | 8 |
1 files 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']) |