@@ -52,45 +52,6 @@ def linkcheck():
5252 [sys .executable ]
5353 + '-msphinx -b linkcheck -d build/doctrees . build/linkcheck' .split ())
5454
55-
56- # For generating PNGs of the top row of index.html:
57- FRONTPAGE_PY_PATH = "../examples/frontpage/" # python scripts location
58- FRONTPAGE_PNG_PATH = "_static/" # png files location
59- # png files and corresponding generation scripts:
60- FRONTPAGE_PNGS = {"surface3d_frontpage.png" : "3D.py" ,
61- "contour_frontpage.png" : "contour.py" ,
62- "histogram_frontpage.png" : "histogram.py" ,
63- "membrane_frontpage.png" : "membrane.py" }
64-
65-
66- def generate_frontpage_pngs (only_if_needed = True ):
67- """Executes the scripts for PNG generation of the top row of index.html.
68-
69- If `only_if_needed` is `True`, then the PNG file is only generated, if it
70- doesn't exist or if the python file is newer.
71-
72- Note that the element `div.responsive_screenshots` in the file
73- `_static/mpl.css` has the height and cumulative width of the used PNG files
74- as attributes. This ensures that the magnification of those PNGs is <= 1.
75- """
76- for fn_png , fn_py in FRONTPAGE_PNGS .items ():
77- pn_png = os .path .join (FRONTPAGE_PNG_PATH , fn_png ) # get full paths
78- pn_py = os .path .join (FRONTPAGE_PY_PATH , fn_py )
79-
80- # Read file modification times:
81- mtime_py = os .path .getmtime (pn_py )
82- mtime_png = (os .path .getmtime (pn_png ) if os .path .exists (pn_png ) else
83- mtime_py - 1 ) # set older time, if file doesn't exist
84-
85- if only_if_needed and mtime_py <= mtime_png :
86- continue # do nothing if png is newer
87-
88- # Execute python as subprocess (preferred over os.system()):
89- subprocess .check_call (
90- [sys .executable , pn_py ]) # raises CalledProcessError()
91- os .rename (fn_png , pn_png ) # move file to _static/ directory
92-
93-
9455DEPSY_PATH = "_static/depsy_badge.svg"
9556DEPSY_URL = "http://depsy.org/api/package/pypi/matplotlib/badge.svg"
9657DEPSY_DEFAULT = "_static/depsy_badge_default.svg"
@@ -121,7 +82,6 @@ def fetch_depsy_badge():
12182def html (buildername = 'html' ):
12283 """Build Sphinx 'html' target. """
12384 check_build ()
124- generate_frontpage_pngs ()
12585 fetch_depsy_badge ()
12686
12787 rc = '../lib/matplotlib/mpl-data/matplotlibrc'
@@ -213,10 +173,6 @@ def clean():
213173 for filename in glob .glob (pattern ):
214174 if os .path .exists (filename ):
215175 os .remove (filename )
216- for fn in FRONTPAGE_PNGS .keys (): # remove generated PNGs
217- pn = os .path .join (FRONTPAGE_PNG_PATH , fn )
218- if os .path .exists (pn ):
219- os .remove (os .path .join (pn ))
220176
221177
222178def build_all ():
0 commit comments