From baf7b80f5ff7917dbf77503717394ccd423b2479 Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 24 Sep 2014 13:48:19 +0100 Subject: Allow brain to load submodules --- client/brain.py | 4 ++-- 1 file 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) -- cgit v1.3.1