From c6a709826e311de992dc61fb3f71b824586c035b Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Fri, 28 Sep 2018 08:39:51 -0700 Subject: [PATCH] Backport PR #12322: Fix the docs build. --- doc/api/backend_wxagg_api.rst | 10 ++++++---- doc/sphinxext/mock_gui_toolkits.py | 15 --------------- lib/matplotlib/figure.py | 13 +++++-------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/doc/api/backend_wxagg_api.rst b/doc/api/backend_wxagg_api.rst index 67c5a00be546..9005cfdfea80 100644 --- a/doc/api/backend_wxagg_api.rst +++ b/doc/api/backend_wxagg_api.rst @@ -2,7 +2,9 @@ :mod:`matplotlib.backends.backend_wxagg` ======================================== -.. automodule:: matplotlib.backends.backend_wxagg - :members: - :undoc-members: - :show-inheritance: +**NOTE** Not included, to avoid adding a dependency to building the docs. + +.. .. automodule:: matplotlib.backends.backend_wxagg +.. :members: +.. :undoc-members: +.. :show-inheritance: diff --git a/doc/sphinxext/mock_gui_toolkits.py b/doc/sphinxext/mock_gui_toolkits.py index a7be59a940c5..a3eee4dea61a 100644 --- a/doc/sphinxext/mock_gui_toolkits.py +++ b/doc/sphinxext/mock_gui_toolkits.py @@ -6,23 +6,8 @@ class MyCairoCffi(MagicMock): __name__ = "cairocffi" -class MyWX(MagicMock): - class Panel(object): - pass - - class ToolBar(object): - pass - - class Frame(object): - pass - - class StatusBar(object): - pass - - def setup(app): sys.modules.update( cairocffi=MyCairoCffi(), - wx=MyWX(), ) return {'parallel_read_safe': True, 'parallel_write_safe': True} diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 487cc812d2f8..baed622914bc 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -18,7 +18,7 @@ import numpy as np from matplotlib import rcParams -from matplotlib import docstring +from matplotlib import backends, docstring from matplotlib import __version__ as _mpl_version from matplotlib import get_backend @@ -421,12 +421,8 @@ def show(self, warn=True): Parameters ---------- warn : bool - If ``True``, issue warning when called on a non-GUI backend - - Notes - ----- - For non-GUI backends, this does nothing, in which case a warning will - be issued if *warn* is ``True`` (default). + If ``True`` and we are not running headless (i.e. on Linux with an + unset DISPLAY), issue warning when called on a non-GUI backend. """ try: manager = getattr(self.canvas, 'manager') @@ -442,7 +438,8 @@ def show(self, warn=True): return except NonGuiException: pass - if warn: + if (backends._get_running_interactive_framework() != "headless" + and warn): warnings.warn('Matplotlib is currently using %s, which is a ' 'non-GUI backend, so cannot show the figure.' % get_backend()) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy