def __recursive_import(module_name):
    """
    Recursively looks for and imports the names, returning the
    module desired

    >>> __recursive_import("sprinter.formula.unpack") # doctest: +ELLIPSIS
    <module 'unpack' from '...'>

    currently module with relative imports don't work.
    """
    names = module_name.split(".")
    path = None
    module = None
    while len(names) > 0:
        if module:
            path = module.__path__
        name = names.pop(0)
        (module_file, pathname, description) = imp.find_module(name, path)
        module = imp.load_module(name, module_file, pathname, description)
    return module
def __recursive_import ( module_name ) : names = module_name . split ( "." ) path = None module = None while len ( names ) > 0 : if module : path = module . __path__ name = names . pop ( 0 ) ( module_file , pathname , description ) = imp . find_module ( name , path ) module = imp . load_module ( name , module_file , pathname , description ) return module
Recursively looks for and imports the names, returning the
    module desired

    >>> __recursive_import("sprinter.formula.unpack") # doctest: +ELLIPSIS
    <module 'unpack' from '...'>

    currently module with relative imports don't work.