Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Dflt autodateformat #5698

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 4 commits into from
Jan 4, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
MNT: use string.Template for matplotlibrc.template
Switch to using `string.Template` instead of `%` formatting to
generate default matplotlibrc file.  This is to avoid having to escape
any old or new style format strings that we want to put into the default
matplotlibrc file.
  • Loading branch information
tacaswell committed Jan 3, 2016
commit 5206cb011e7a43dcaf440139f52dce248611c7fb
14 changes: 7 additions & 7 deletions 14 matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# You can also deploy your own backend outside of matplotlib by
# referring to the module name (which must be in the PYTHONPATH) as
# 'module://my_backend'.
backend : %(backend)s
backend : $TEMPLATE_BACKEND

# If you are using the Qt4Agg backend, you can choose here
# to use the PyQt4 bindings or the newer PySide bindings to
Expand Down Expand Up @@ -338,12 +338,12 @@ backend : %(backend)s
# These values map to the scales:
# {'year': 365, 'month': 30, 'day': 1, 'hour': 1/24, 'minute': 1 / (24 * 60)}

# date.autoformatter.year : %%Y
# date.autoformatter.month : %%Y-%%m
# date.autoformatter.day : %%Y-%%m-%%d
# date.autoformatter.hour : %%H:%%M
# date.autoformatter.minute : %%H:%%M:%%S
# date.autoformatter.second : %%H:%%M:%%S.%%f
# date.autoformatter.year : %Y
# date.autoformatter.month : %Y-%m
# date.autoformatter.day : %Y-%m-%d
# date.autoformatter.hour : %H:%M
# date.autoformatter.minute : %H:%M:%S
# date.autoformatter.second : %H:%M:%S.%f

### TICKS
# see http://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick
Expand Down
5 changes: 3 additions & 2 deletions 5 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

from __future__ import print_function, absolute_import

from string import Template
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that I've never used this, but it seems like the right tool for the job...

# This needs to be the very first thing to use distribute
from distribute_setup import use_setuptools
use_setuptools()
Expand Down Expand Up @@ -230,8 +230,9 @@ def run(self):
default_backend = setupext.options['backend']
with open('matplotlibrc.template') as fd:
template = fd.read()
template = Template(template)
with open('lib/matplotlib/mpl-data/matplotlibrc', 'w') as fd:
fd.write(template % {'backend': default_backend})
fd.write(template.safe_substitute(TEMPLATE_BACKEND=default_backend))

# Build in verbose mode if requested
if setupext.options['verbose']:
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.