(source_root_parent)
add everything under `source_root_parent` to the list of source roots
    e.g. if you call this with param 'submodules'
    and you have the file structure

    project/
        submodules/
            foo-src/
                foo/
            bar-src/
                bar/

    (where foo and bar are python modules)
    then foo and bar would become top-level importable
add everything under `source_root_parent` to the list of source roots
    e.g. if you call this with param 'submodules'
    and you have the file structure
add everything under source_root_parent to the list of source roots e . g . if you call this with param submodules and you have the file structure
def _set_source_root_parent(source_root_parent):
    """
    add everything under `source_root_parent` to the list of source roots
    e.g. if you call this with param 'submodules'
    and you have the file structure

    project/
        submodules/
            foo-src/
                foo/
            bar-src/
                bar/

    (where foo and bar are python modules)
    then foo and bar would become top-level importable

    """
    filedir = os.path.dirname(__file__)
    dir = os.path.join(filedir, source_root_parent)
    if not os.path.exists(dir):
        return

    submodules_list = os.listdir(dir)
    for d in submodules_list:
        if d == "__init__.py" or d == '.' or d == '..':
            continue
        sys.path.insert(1, os.path.join(filedir, source_root_parent, d))

    sys.path.append(os.path.join(filedir, source_root_parent))
def _set_source_root_parent ( source_root_parent ) : filedir = os . path . dirname ( __file__ ) dir = os . path . join ( filedir , source_root_parent ) if not os . path . exists ( dir ) : return submodules_list = os . listdir ( dir ) for d in submodules_list : if d == "__init__.py" or d == '.' or d == '..' : continue sys . path . insert ( 1 , os . path . join ( filedir , source_root_parent , d ) ) sys . path . append ( os . path . join ( filedir , source_root_parent ) )