summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-09-24 18:49:26 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-09-24 18:49:26 +0200
commitea3026c133755bf3e35ad78fa253786bc9ff7c36 (patch)
treef02056a2bf5fe04e19ad82359fadd7854ba1e1d8
parent48deee55a583ff851ccae0946c90f36cccbc03b8 (diff)
parentbaf7b80f5ff7917dbf77503717394ccd423b2479 (diff)
downloadjasper-client-ea3026c133755bf3e35ad78fa253786bc9ff7c36.tar.gz
jasper-client-ea3026c133755bf3e35ad78fa253786bc9ff7c36.zip
Merge pull request #195 from alexsiri7/sub_modules
Allow brain to load submodules
-rw-r--r--client/brain.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/brain.py b/client/brain.py
index f197bc4..f2a2efd 100644
--- a/client/brain.py
+++ b/client/brain.py
@@ -33,10 +33,10 @@ class Brain(object):
"""
module_locations = [jasperpath.PLUGIN_PATH]
- module_names = [name for loader, name, ispkg in pkgutil.iter_modules(module_locations)]
+ module_names = [name for loader, name, ispkg in pkgutil.walk_packages(module_locations, prefix='modules.')]
modules = []
for name in module_names:
- mod = importlib.import_module("modules.%s" % name)
+ mod = importlib.import_module(name)
if hasattr(mod, 'WORDS'):
modules.append(mod)
modules.sort(key=lambda mod: mod.PRIORITY if hasattr(mod, 'PRIORITY') else 0, reverse=True)