summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-09-30 18:50:16 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-09-30 18:50:16 +0200
commit45ac81e232b843051b0790fe1469dfb5abb50bda (patch)
tree738a81d0e9a0c2babb885a7a7a8712934cd2b2ba
parent5902f695fc0d7d706867d182c7a70fa9f0beac41 (diff)
downloadjasper-client-45ac81e232b843051b0790fe1469dfb5abb50bda.tar.gz
jasper-client-45ac81e232b843051b0790fe1469dfb5abb50bda.zip
Stop using hardcoded 'modules' prefix in brain.py
This makes the modules path truly configurable
-rw-r--r--client/brain.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/client/brain.py b/client/brain.py
index 007b7fe..6daa366 100644
--- a/client/brain.py
+++ b/client/brain.py
@@ -35,11 +35,11 @@ class Brain(object):
logger = logging.getLogger(__name__)
module_locations = [jasperpath.PLUGIN_PATH]
logger.debug("Looking for modules in: %s", ', '.join(["'%s'" % location for location in module_locations]))
- module_names = [name for loader, name, ispkg in pkgutil.walk_packages(module_locations, prefix='modules.')]
modules = []
- for name in module_names:
+ for finder, name, ispkg in pkgutil.walk_packages(module_locations):
try:
- mod = importlib.import_module(name)
+ loader = finder.find_module(name)
+ mod = loader.load_module(name)
except:
logger.warning("Skipped module '%s' due to an error.", name, exc_info=True)
else: