summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-12-09 13:49:21 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-12-09 13:49:21 +0000
commite838c488f7f2dad14ca1e9b619e218f5685f248d (patch)
tree94af740eaa266cb7f6ccfb9331d429f1dbdd482e
parent45b4916894d6f1b4b0611e2db44c009c052d0345 (diff)
downloadturbo-hipster-e838c488f7f2dad14ca1e9b619e218f5685f248d.tar.gz
Make plugin loading work properly
-rw-r--r--turbo_hipster/worker_server.py8
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'])