|
From: <jd...@us...> - 2008-07-23 17:09:18
|
Revision: 5825
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5825&view=rev
Author: jdh2358
Date: 2008-07-23 17:09:15 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
restored interactive_bk var to backends init -- ipython shell uses it
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/__init__.py
Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-07-23 14:18:41 UTC (rev 5824)
+++ trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-07-23 17:09:15 UTC (rev 5825)
@@ -1,6 +1,8 @@
import matplotlib
+# ipython relies on interactive_bk being defined here
+from matplotlib.rcsetup import interactive_bk
__all__ = ['backend','show','draw_if_interactive',
'new_figure_manager', 'backend_version']
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-08 13:59:39
|
Revision: 6168
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6168&view=rev
Author: mdboom
Date: 2008-10-08 13:59:28 +0000 (Wed, 08 Oct 2008)
Log Message:
-----------
Addresses this Ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/278764
Display a warning when show() is called with a non-GUI backend, so that the user is not left scratching their head when running "ipython -pylab"
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/__init__.py
Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-10-08 04:07:21 UTC (rev 6167)
+++ trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-10-08 13:59:28 UTC (rev 6168)
@@ -1,5 +1,6 @@
import matplotlib
+import warnings
# ipython relies on interactive_bk being defined here
from matplotlib.rcsetup import interactive_bk
@@ -28,9 +29,15 @@
# image backends like pdf, agg or svg do not need to do anything
# for "show" or "draw_if_interactive", so if they are not defined
# by the backend, just do nothing
+ def do_nothing_show(*args, **kwargs):
+ warnings.warn("""
+Your currently selected backend, '%s' does not support show().
+Please select a GUI backend in your matplotlibrc file ('%s')
+or with matplotlib.use()""" %
+ (backend, matplotlib.matplotlib_fname()))
def do_nothing(*args, **kwargs): pass
backend_version = getattr(backend_mod,'backend_version', 'unknown')
- show = getattr(backend_mod, 'show', do_nothing)
+ show = getattr(backend_mod, 'show', do_nothing_show)
draw_if_interactive = getattr(backend_mod, 'draw_if_interactive', do_nothing)
# Additional imports which only happen for certain backends. This section
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-09 11:37:05
|
Revision: 6175
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6175&view=rev
Author: mdboom
Date: 2008-10-09 11:37:01 +0000 (Thu, 09 Oct 2008)
Log Message:
-----------
Better version of 'show' warning that only emits when show() is run directly from the python or ipython console.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/__init__.py
Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-10-09 01:19:54 UTC (rev 6174)
+++ trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-10-09 11:37:01 UTC (rev 6175)
@@ -1,5 +1,6 @@
import matplotlib
+import inspect
import warnings
# ipython relies on interactive_bk being defined here
@@ -30,11 +31,14 @@
# for "show" or "draw_if_interactive", so if they are not defined
# by the backend, just do nothing
def do_nothing_show(*args, **kwargs):
- warnings.warn("""
+ frame = inspect.currentframe()
+ fname = inspect.getframeinfo(frame.f_back)[0]
+ if fname in ('<stdin>', '<ipython console>'):
+ warnings.warn("""
Your currently selected backend, '%s' does not support show().
Please select a GUI backend in your matplotlibrc file ('%s')
or with matplotlib.use()""" %
- (backend, matplotlib.matplotlib_fname()))
+ (backend, matplotlib.matplotlib_fname()))
def do_nothing(*args, **kwargs): pass
backend_version = getattr(backend_mod,'backend_version', 'unknown')
show = getattr(backend_mod, 'show', do_nothing_show)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-10-29 17:16:09
|
Revision: 6348
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6348&view=rev
Author: mdboom
Date: 2008-10-29 17:16:02 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
Speed up do_nothing_show test for interactive use, which was dominating startup time.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/__init__.py
Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-10-29 17:15:32 UTC (rev 6347)
+++ trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-10-29 17:16:02 UTC (rev 6348)
@@ -32,7 +32,7 @@
# by the backend, just do nothing
def do_nothing_show(*args, **kwargs):
frame = inspect.currentframe()
- fname = inspect.getframeinfo(frame.f_back)[0]
+ fname = frame.f_back.f_code.co_filename
if fname in ('<stdin>', '<ipython console>'):
warnings.warn("""
Your currently selected backend, '%s' does not support show().
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|