diff --git a/mitterlib/ui/__init__.py b/mitterlib/ui/__init__.py index 5597691..917ab82 100644 --- a/mitterlib/ui/__init__.py +++ b/mitterlib/ui/__init__.py @@ -36,7 +36,12 @@ def _import_name(module): """Based on the name of the module, return the proper "import" statement.""" (name, _) = os.path.splitext(module) - return 'mitterlib.ui.%s' % (name) + if name.startswith('ui_'): + mask = 'mitterlib.ui.%s' + else: + mask = 'mitterlib.ui.ui_%s' + + return mask % (name) class Interfaces(object): @@ -79,6 +84,7 @@ class Interfaces(object): # [we could be mean and use random.choice(self._interfaces)] import_name = self._interfaces[0] + _log.debug('Loading interface %s', import_name) module_name = _import_name(import_name) - module = __import__(module_name, fromlist[module_name]) + module = __import__(module_name, fromlist=[module_name]) return module.Interface(connection, self._options)