python-matplotlib/0001-matplotlibrc-path-search-fix.patch

44 lines
1.5 KiB
Diff
Raw Normal View History

From 27351b482a702cab3305368294936b531c9fc649 Mon Sep 17 00:00:00 2001
2017-10-15 18:16:56 -04:00
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 27 Sep 2017 19:35:59 -0400
Subject: [PATCH 1/4] matplotlibrc path search fix
2017-10-15 18:16:56 -04:00
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
2021-02-19 05:46:28 -05:00
lib/matplotlib/__init__.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
2017-10-15 18:16:56 -04:00
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index fd78e6f94f..5eae4b50e2 100644
2017-10-15 18:16:56 -04:00
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -540,7 +540,8 @@ def get_cachedir():
2021-02-19 05:46:28 -05:00
@_logged_cached('matplotlib data path: %s')
def get_data_path():
"""Return the path to Matplotlib data."""
- return str(Path(__file__).with_name("mpl-data"))
+ return str(Path(__file__).parent.parent.parent.parent.parent /
+ 'share/matplotlib/mpl-data')
2020-03-03 23:05:13 -05:00
2018-08-17 17:37:11 -04:00
2021-02-19 05:46:28 -05:00
def matplotlib_fname():
@@ -560,6 +561,7 @@ def matplotlib_fname():
2019-05-31 01:44:54 -04:00
is not defined)
- On other platforms,
2020-03-03 23:05:13 -05:00
- ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
2020-06-29 20:38:52 -04:00
+ - ``/etc/matplotlibrc``
- Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
exist.
"""
@@ -578,6 +580,7 @@ def matplotlib_fname():
2017-09-27 01:29:13 -04:00
yield matplotlibrc
yield os.path.join(matplotlibrc, 'matplotlibrc')
2018-08-17 17:37:11 -04:00
yield os.path.join(get_configdir(), 'matplotlibrc')
2017-09-27 01:29:13 -04:00
+ yield '/etc/matplotlibrc'
2021-02-19 05:46:28 -05:00
yield os.path.join(get_data_path(), 'matplotlibrc')
2017-09-27 01:29:13 -04:00
for fname in gen_candidates():
2017-10-15 18:16:56 -04:00
--
2022-08-12 03:23:30 -04:00
2.36.1
2017-10-15 18:16:56 -04:00