Esempio n. 1
0
def env_merge_info(app: Sphinx, env: BuildEnvironment, docnames: Iterable[str],
                   other: BuildEnvironment) -> None:
    if not hasattr(other, '_viewcode_modules'):
        return
    # create a _viewcode_modules dict on the main environment
    if not hasattr(env, '_viewcode_modules'):
        env._viewcode_modules = {}  # type: ignore
    # now merge in the information from the subprocess
    env._viewcode_modules.update(other._viewcode_modules)  # type: ignore
Esempio n. 2
0
def env_merge_info(app: Sphinx, env: BuildEnvironment, docnames: Iterable[str],
                   other: BuildEnvironment) -> None:
    if not hasattr(other, '_viewcode_modules'):
        return
    # create a _viewcode_modules dict on the main environment
    if not hasattr(env, '_viewcode_modules'):
        env._viewcode_modules = {}  # type: ignore
    # now merge in the information from the subprocess
    for modname, entry in other._viewcode_modules.items():  # type: ignore
        if modname not in env._viewcode_modules:  # type: ignore
            env._viewcode_modules[modname] = entry  # type: ignore
        else:
            used = env._viewcode_modules[modname][2]  # type: ignore
            for fullname, docname in entry[2].items():
                if fullname not in used:
                    used[fullname] = docname