Example #1
0
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()
Example #2
0
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()
Example #3
0
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)
Example #4
0
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)
Example #5
0
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)