From: <ef...@us...> - 2008-06-09 17:14:42
|
Revision: 5435 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5435&view=rev Author: efiring Date: 2008-06-09 10:13:29 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Try again to make temporary fix for backend case-sensitivity Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/backends/__init__.py trunk/matplotlib/lib/matplotlib/pyplot.py Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2008-06-09 17:07:33 UTC (rev 5434) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-06-09 17:13:29 UTC (rev 5435) @@ -772,7 +772,10 @@ rcParams['cairo.format'] = validate_cairo_format(be_parts[1]) def get_backend(): - return rcParams['backend'].lower() + # Validation is needed because the rcParams entry might have + # been set directly rather than via "use()". + return validate_backend(rcParams['backend']) + #return rcParams['backend'].lower() def interactive(b): """ Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-06-09 17:07:33 UTC (rev 5434) +++ trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-06-09 17:13:29 UTC (rev 5435) @@ -1,19 +1,21 @@ import matplotlib from matplotlib.rcsetup import interactive_bk +from matplotlib.rcsetup import non_interactive_bk +from matplotlib.rcsetup import all_backends from matplotlib.rcsetup import validate_backend __all__ = ['backend','show','draw_if_interactive', 'new_figure_manager', 'backend_version'] -backend = matplotlib.get_backend() # makes sure it is lower case -validate_backend(backend) +backend = matplotlib.get_backend() # validates, to match all_backends def pylab_setup(): 'return new_figure_manager, draw_if_interactive and show for pylab' # Import the requested backend into a generic module object backend_name = 'backend_'+backend + backend_name = backend_name.lower() # until we banish mixed case backend_mod = __import__('matplotlib.backends.'+backend_name, globals(),locals(),[backend_name]) @@ -36,7 +38,7 @@ # Additional imports which only happen for certain backends. This section # should probably disappear once all backends are uniform. - if backend in ['wx','wxagg']: + if backend.lower() in ['wx','wxagg']: Toolbar = backend_mod.Toolbar __all__.append('Toolbar') Modified: trunk/matplotlib/lib/matplotlib/pyplot.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyplot.py 2008-06-09 17:07:33 UTC (rev 5434) +++ trunk/matplotlib/lib/matplotlib/pyplot.py 2008-06-09 17:13:29 UTC (rev 5435) @@ -185,7 +185,7 @@ figManager = _pylab_helpers.Gcf.get_fig_manager(num) if figManager is None: - if get_backend()=='PS': dpi = 72 + if get_backend().lower() == 'ps': dpi = 72 figManager = new_figure_manager(num, figsize=figsize, dpi=dpi, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |