From: <jd...@us...> - 2008-06-22 16:24:12
|
Revision: 5633 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5633&view=rev Author: jdh2358 Date: 2008-06-22 09:24:02 -0700 (Sun, 22 Jun 2008) Log Message: ----------- Merged revisions 5604,5625,5631 via svnmerge from https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint ........ r5604 | efiring | 2008-06-19 23:53:28 -0500 (Thu, 19 Jun 2008) | 2 lines Don't try to render a line collection with no segments ........ r5625 | dsdale | 2008-06-21 08:35:30 -0500 (Sat, 21 Jun 2008) | 2 lines improve mlab.load docstring to address bug 1901536 ........ r5631 | jdh2358 | 2008-06-22 11:15:24 -0500 (Sun, 22 Jun 2008) | 1 line changed wx backend to respect extension over gui dialog default type ........ Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Name: svnmerge-integrated - /branches/v0_91_maint:1-5573,5603 + /branches/v0_91_maint:1-5632 Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-22 16:16:20 UTC (rev 5632) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-22 16:24:02 UTC (rev 5633) @@ -94,6 +94,7 @@ cvs_id = '$Id$' + import sys, os, os.path, math, StringIO, weakref, warnings # Debugging settings here... @@ -1646,8 +1647,14 @@ filename = dlg.GetFilename() DEBUG_MSG('Save file dir:%s name:%s' % (dirname, filename), 3, self) format = exts[dlg.GetFilterIndex()] - # Explicitly pass in the selected filetype to override the - # actual extension if necessary + basename, ext = os.path.splitext(filename) + if ext.startswith('.'): + ext = ext[1:] + if ext in ('svg', 'pdf', 'ps', 'eps', 'png') and format!=ext: + #looks like they forgot to set the image type drop + #down, going with the extension. + warnings.warn('extension %s did not match the selected image type %s; going with %s'%(ext, format, ext), stacklevel=0) + format = ext try: self.canvas.print_figure( os.path.join(dirname, filename), format=format) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |