def load_command_class(name): ''' Given a command name and an application name, returns the Command class instance. All errors raised by the import process (ImportError, AttributeError) are allowed to propagate. ''' module = load_class(COMMANDS_PACKAGE, name) return module.Command()
def load_model(name): ''' Loads the python module with the given name found in the path. ''' try: module = load_class(SUPERVISED_PACKAGE, name) return module except Exception: traceback.print_exc() LOGGER.debug('No %s model found.', name)
def load_bundle(name, path, package): ''' Loads the python module with the given name found in the path. ''' module = load_class(package, name) return module.Bundle(path)