diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-24 13:48:19 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-24 13:48:19 +0100 |
| commit | baf7b80f5ff7917dbf77503717394ccd423b2479 (patch) | |
| tree | f02056a2bf5fe04e19ad82359fadd7854ba1e1d8 /client | |
| parent | 48deee55a583ff851ccae0946c90f36cccbc03b8 (diff) | |
| download | jasper-client-baf7b80f5ff7917dbf77503717394ccd423b2479.tar.gz jasper-client-baf7b80f5ff7917dbf77503717394ccd423b2479.zip | |
Allow brain to load submodules
Diffstat (limited to 'client')
| -rw-r--r-- | client/brain.py | 4 |
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) |
