summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-12-02 17:21:12 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-12-02 17:21:12 +0000
commit45b4916894d6f1b4b0611e2db44c009c052d0345 (patch)
tree06ed34e5f377588039767078c9fdf35a2798a992
parent3e3deef7b81baf88cd1ebc744f5e7342ab97b72c (diff)
downloadturbo-hipster-45b4916894d6f1b4b0611e2db44c009c052d0345.tar.gz
Allow plugins to be imported from places other than task_plugins
-rw-r--r--turbo_hipster/worker_server.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/turbo_hipster/worker_server.py b/turbo_hipster/worker_server.py
index fae193d..c01e8f2 100644
--- a/turbo_hipster/worker_server.py
+++ b/turbo_hipster/worker_server.py
@@ -89,11 +89,10 @@ 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'])
self.plugins.append({
- 'module': __import__('turbo_hipster.task_plugins.' +
- plugin['name'] + '.task',
- fromlist='turbo_hipster.task_plugins' +
- plugin['name']),
+ 'module': __import__(plugin['import-path']),
'plugin_config': plugin
})
self.log.debug('Plugin %s loaded' % plugin['name'])