diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-01 02:39:50 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-01 02:39:50 +0200 |
| commit | 820a44443aa56c18393aaa5e9973530f9101876a (patch) | |
| tree | 9f4c7d2a5ee0acc5991ee0a02a036f7367a83c3f /client/brain.py | |
| parent | 05234077f36200ac87d9b0563cdd25746db3fd64 (diff) | |
| parent | be97529c4c5462aca3b01d69a91f62fd1cd5748a (diff) | |
| download | jasper-client-820a44443aa56c18393aaa5e9973530f9101876a.tar.gz jasper-client-820a44443aa56c18393aaa5e9973530f9101876a.zip | |
Merge pull request #205 from Holzhaus/no-hardcoded-modules-folder
Stop using hardcoded 'modules' prefix in brain.py
Diffstat (limited to 'client/brain.py')
| -rw-r--r-- | client/brain.py | 6 |
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: |
