klippy: Allow extras modules to be directories

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor committed 2018-06-27 13:01:48 -04:00
1 parent af1cd3c4ce
commit 2622b439fc
1 file changed
+3 -1
+3 -1
View File
@@ -189,7 +189,9 @@ class Printer:
module_name = module_parts[0]
py_name = os.path.join(os.path.dirname(__file__),
'extras', module_name + '.py')
if not os.path.exists(py_name):
py_dirname = os.path.join(os.path.dirname(__file__),
'extras', module_name, '__init__.py')
if not os.path.exists(py_name) and not os.path.exists(py_dirname):
return None
mod = importlib.import_module('extras.' + module_name)
init_func = 'load_config'