Skip to content

Update make.py #6530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
import re
import argparse
import matplotlib

def copy_if_out_of_date(original, derived):
if (not os.path.exists(derived) or
Expand Down Expand Up @@ -38,7 +39,13 @@ def linkcheck():

def html(buildername='html'):
check_build()
copy_if_out_of_date('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')

rc = '../lib/matplotlib/mpl-data/matplotlibrc'
default_rc = os.path.join(matplotlib._get_data_path(), 'matplotlibrc')
if not os.path.exists(rc) and os.path.exists(default_rc):
rc = default_rc
copy_if_out_of_date(rc, '_static/matplotlibrc')

if small_docs:
options = "-D plot_formats=png:80"
else:
Expand Down Expand Up @@ -168,9 +175,9 @@ def all():
raise RuntimeError("doc/{0} should be a directory or symlink -- it"
" isn't".format(link))
if not os.path.exists(link):
if hasattr(os, 'symlink'):
try:
os.symlink(target, link)
else:
except OSError:
symlink_warnings.append('files copied to {0}'.format(link))
shutil.copytree(os.path.join(link, '..', target), link)

Expand Down