Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b3b221

Browse files
committed
Use packaged jquery and jquery-ui.
1 parent a1a5298 commit 0b3b221

File tree

3 files changed

+6
-60
lines changed

3 files changed

+6
-60
lines changed

lib/matplotlib/backends/web_backend/all_figures.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css">
44
<link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" />
55
<link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" />
6-
<link rel="stylesheet" href="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.css" >
7-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/external/jquery/jquery.js"></script>
8-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.js"></script>
6+
<link rel="stylesheet" href="/usr/share/javascript/jquery_ui/jquery-ui.min.css" >
7+
<script src="/usr/share/javascript/jquery/latest/jquery.min.js"></script>
8+
<script src="/usr/share/javascript/jquery_ui/jquery-ui.min.js"></script>
99
<script src="{{ prefix }}/_static/js/mpl_tornado.js"></script>
1010
<script src="{{ prefix }}/js/mpl.js"></script>
1111

lib/matplotlib/backends/web_backend/single_figure.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<link rel="stylesheet" href="{{ prefix }}/_static/css/page.css" type="text/css">
44
<link rel="stylesheet" href="{{ prefix }}/_static/css/boilerplate.css" type="text/css" />
55
<link rel="stylesheet" href="{{ prefix }}/_static/css/fbm.css" type="text/css" />
6-
<link rel="stylesheet" href="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.css" >
7-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/external/jquery/jquery.js"></script>
8-
<script src="{{ prefix }}/_static/jquery-ui-1.12.1/jquery-ui.min.js"></script>
6+
<link rel="stylesheet" href="/usr/share/javascript/jquery_ui/jquery-ui.min.css" >
7+
<script src="/usr/share/javascript/jquery/latest/jquery.min.js"></script>
8+
<script src="/usr/share/javascript/jquery_ui/jquery-ui.min.js"></script>
99
<script src="{{ prefix }}/_static/js/mpl_tornado.js"></script>
1010
<script src="{{ prefix }}/js/mpl.js"></script>
1111
<script>

setup.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
from setuptools import setup, find_packages, Extension
3030
from setuptools.command.build_ext import build_ext as BuildExtCommand
31-
from setuptools.command.develop import develop as DevelopCommand
32-
from setuptools.command.install_lib import install_lib as InstallLibCommand
3331
from setuptools.command.test import test as TestCommand
3432

3533
# The setuptools version of sdist adds a setup.cfg file to the tree.
@@ -120,58 +118,6 @@ def build_extensions(self):
120118
cmdclass['build_ext'] = BuildExtraLibraries
121119

122120

123-
def _download_jquery_to(dest):
124-
# Note: When bumping the jquery-ui version, also update the versions in
125-
# single_figure.html and all_figures.html.
126-
url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"
127-
sha = "f8233674366ab36b2c34c577ec77a3d70cac75d2e387d8587f3836345c0f624d"
128-
name = Path(url).stem
129-
if (dest / name).exists():
130-
return
131-
# If we are installing from an sdist, use the already downloaded jquery-ui.
132-
sdist_src = Path("lib/matplotlib/backends/web_backend", name)
133-
if sdist_src.exists():
134-
shutil.copytree(sdist_src, dest / name)
135-
return
136-
if not (dest / name).exists():
137-
dest.mkdir(parents=True, exist_ok=True)
138-
try:
139-
buff = download_or_cache(url, sha)
140-
except Exception:
141-
raise IOError(
142-
"Failed to download jquery-ui. Please download "
143-
"{url} and extract it to {dest}.".format(url=url, dest=dest))
144-
with ZipFile(buff) as zf:
145-
zf.extractall(dest)
146-
147-
148-
# Relying on versioneer's implementation detail.
149-
class sdist_with_jquery(cmdclass['sdist']):
150-
def make_release_tree(self, base_dir, files):
151-
super().make_release_tree(base_dir, files)
152-
_download_jquery_to(
153-
Path(base_dir, "lib/matplotlib/backends/web_backend/"))
154-
155-
156-
# Affects install and bdist_wheel.
157-
class install_lib_with_jquery(InstallLibCommand):
158-
def run(self):
159-
super().run()
160-
_download_jquery_to(
161-
Path(self.install_dir, "matplotlib/backends/web_backend/"))
162-
163-
164-
class develop_with_jquery(DevelopCommand):
165-
def run(self):
166-
super().run()
167-
_download_jquery_to(Path("lib/matplotlib/backends/web_backend/"))
168-
169-
170-
cmdclass['sdist'] = sdist_with_jquery
171-
cmdclass['install_lib'] = install_lib_with_jquery
172-
cmdclass['develop'] = develop_with_jquery
173-
174-
175121
# One doesn't normally see `if __name__ == '__main__'` blocks in a setup.py,
176122
# however, this is needed on Windows to avoid creating infinite subprocesses
177123
# when using multiprocessing.

0 commit comments

Comments
 (0)