Beispiel #1
0
def _download_jquery_to(dest):
    if os.path.exists(os.path.join(dest, "jquery-ui-1.12.1")):
        return

    # If we are installing from an sdist, use the already downloaded jquery-ui
    sdist_src = os.path.join("lib/matplotlib/backends/web_backend",
                             "jquery-ui-1.12.1")
    if os.path.exists(sdist_src):
        shutil.copytree(sdist_src, os.path.join(dest, "jquery-ui-1.12.1"))
        return

    # Note: When bumping the jquery-ui version, also update the versions in
    # single_figure.html and all_figures.html.
    url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"
    sha = 'f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d'
    if not os.path.exists(os.path.join(dest, "jquery-ui-1.12.1")):
        os.makedirs(dest, exist_ok=True)
        try:
            buff = download_or_cache(url, sha)
        except Exception:
            raise IOError(
                "Failed to download jquery-ui.  Please download " +
                "{url} and extract it to {dest}.".format(url=url, dest=dest))
        with ZipFile(buff) as zf:
            zf.extractall(dest)
Beispiel #2
0
def _download_jquery_to(dest):
    # Note: When bumping the jquery-ui version, also update the versions in
    # single_figure.html and all_figures.html.
    url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"
    sha = 'f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d'
    if not os.path.exists(os.path.join(dest, "jquery-ui-1.12.1")):
        _makedirs(dest, exist_ok=True)
        try:
            buff = download_or_cache(url, sha)
        except Exception:
            raise IOError("Failed to download jquery-ui.  Please download " +
                          "{url} and extract it to {dest}.".format(
                              url=url, dest=dest))
        with ZipFile(buff) as zf:
            zf.extractall(dest)
Beispiel #3
0
def _download_jquery_to(dest):
    # Note: When bumping the jquery-ui version, also update the versions in
    # single_figure.html and all_figures.html.
    url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"
    sha = 'f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d'
    if not os.path.exists(os.path.join(dest, "jquery-ui-1.12.1")):
        os.makedirs(dest, exist_ok=True)
        try:
            buff = download_or_cache(url, sha)
        except Exception:
            raise IOError(
                "Failed to download jquery-ui.  Please download " +
                "{url} and extract it to {dest}.".format(url=url, dest=dest))
        with ZipFile(buff) as zf:
            zf.extractall(dest)
Beispiel #4
0
def _download_jquery_to(dest):
    # Note: When bumping the jquery-ui version, also update the versions in
    # single_figure.html and all_figures.html.
    url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"
    sha = "f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d"
    name = Path(url).stem
    if (dest / name).exists():
        return
    # If we are installing from an sdist, use the already downloaded jquery-ui.
    sdist_src = Path("lib/matplotlib/backends/web_backend", name)
    if sdist_src.exists():
        shutil.copytree(sdist_src, dest / name)
        return
    if not (dest / name).exists():
        dest.mkdir(parents=True, exist_ok=True)
        try:
            buff = download_or_cache(url, sha)
        except Exception:
            raise IOError(f"Failed to download jquery-ui.  Please download "
                          f"{url} and extract it to {dest}.")
        with ZipFile(buff) as zf:
            zf.extractall(dest)