Revision: 8141 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8141&view=rev Author: mdehoon Date: 2010-02-18 14:54:30 +0000 (Thu, 18 Feb 2010)
Log Message: ----------- Make the save_figure methods consistent with the base class signature. Fix a call to save_figure in backend_bases.py. This bug caused the keypress_demo.py example to fail on all backends except those based on GTK. The bug was reported by David Arnold on the mailing list on February 14, 2010. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py trunk/matplotlib/lib/matplotlib/backends/backend_qt.py trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-02-17 15:25:38 UTC (rev 8140) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-02-18 14:54:30 UTC (rev 8141) @@ -1923,7 +1923,7 @@ self.canvas.toolbar.zoom() # saving current figure (default key 's') elif event.key in save_keys: - self.canvas.toolbar.save_figure(self.canvas.toolbar) + self.canvas.toolbar.save_figure() if event.inaxes is None: return Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-02-17 15:25:38 UTC (rev 8140) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-02-18 14:54:30 UTC (rev 8141) @@ -653,7 +653,7 @@ filetypes=self.canvas.get_supported_filetypes(), default_filetype=self.canvas.get_default_filetype()) - def save_figure(self, button): + def save_figure(self, *args): fname, format = self.get_filechooser().get_filename_from_user() if fname: try: @@ -908,7 +908,7 @@ filetypes=self.canvas.get_supported_filetypes(), default_filetype=self.canvas.get_default_filetype()) - def save_figure(self, button): + def save_figure(self, *args): fname, format = self.get_filechooser().get_filename_from_user() if fname: try: Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-02-17 15:25:38 UTC (rev 8140) +++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-02-18 14:54:30 UTC (rev 8141) @@ -392,7 +392,7 @@ axes[i].yaxis.zoom(direction) self.canvas.invalidate() - def save_figure(self): + def save_figure(self, *args): filename = _macosx.choose_save_file('Save the figure') if filename is None: # Cancel return @@ -416,7 +416,7 @@ def set_cursor(self, cursor): _macosx.set_cursor(cursor) - def save_figure(self): + def save_figure(self, *args): filename = _macosx.choose_save_file('Save the figure') if filename is None: # Cancel return Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2010-02-17 15:25:38 UTC (rev 8140) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2010-02-18 14:54:30 UTC (rev 8141) @@ -422,7 +422,7 @@ def _get_canvas(self, fig): return FigureCanvasQT(fig) - def save_figure( self ): + def save_figure(self, *args): filetypes = self.canvas.get_supported_filetypes_grouped() sorted_filetypes = filetypes.items() sorted_filetypes.sort() Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2010-02-17 15:25:38 UTC (rev 8140) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2010-02-18 14:54:30 UTC (rev 8141) @@ -431,7 +431,7 @@ def _get_canvas(self, fig): return FigureCanvasQT(fig) - def save_figure( self ): + def save_figure(self, *args): filetypes = self.canvas.get_supported_filetypes_grouped() sorted_filetypes = filetypes.items() sorted_filetypes.sort() Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-02-17 15:25:38 UTC (rev 8140) +++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-02-18 14:54:30 UTC (rev 8141) @@ -576,7 +576,7 @@ a.yaxis.zoom(direction) self.canvas.draw() - def save_figure(self): + def save_figure(self, *args): fs = FileDialog.SaveFileDialog(master=self.window, title='Save the figure') try: @@ -703,7 +703,7 @@ canvas.show() canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) - def save_figure(self): + def save_figure(self, *args): from tkFileDialog import asksaveasfilename from tkMessageBox import showerror filetypes = self.canvas.get_supported_filetypes().copy() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins