Add a list of pseudo site-packages to :data:`python:sys.path`.

    This centers the list on ``sys.path`` around the current environment.
    I.e. if this environment is in the list, then directories before it in the
    list will be prepended to ``sys.path``, and directories after it will
    be appended to ``sys.path``.

def add_site_list(dir_list):
    """Add a list of pseudo site-packages to :data:`python:sys.path`.

    This centers the list on ``sys.path`` around the current environment.
    I.e. if this environment is in the list, then directories before it in the
    list will be prepended to ``sys.path``, and directories after it will
    be appended to ``sys.path``.

    """
    
    our_site_packages = os.path.abspath(os.path.join(sys.prefix, site_package_postfix))
    dir_list = [os.path.abspath(x) for x in dir_list]

    prepend = SysPathInserter(0)
    append = SysPathInserter()

    try:
        our_index = dir_list.index(our_site_packages)
    except ValueError:
        our_index = None

    for i, dir_name in enumerate(dir_list):
        if our_index is None or i < our_index:
            add_site_dir(dir_name, _path=prepend)
        else:
            add_site_dir(dir_name, _path=append)