From 1eed6c8a46c776bbeedeed077a5501381332ccd4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 5 Jul 2007 14:13:21 +0000 Subject: [PATCH] Display version information about the toolkit being tested. svn path=/trunk/matplotlib/; revision=3457 --- unit/memleak_gui.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/unit/memleak_gui.py b/unit/memleak_gui.py index dd828192f873..d4a2176f3d44 100644 --- a/unit/memleak_gui.py +++ b/unit/memleak_gui.py @@ -53,7 +53,7 @@ for i in range(indEnd+1): fig = pylab.figure() - #fig.savefig('test') # This seems to just slow down the testing. + fig.savefig('test') # This seems to just slow down the testing. fig.clf() pylab.close(fig) gc.collect() @@ -75,6 +75,28 @@ if i > indStart: print '# Backend %(backend)s, toolbar %(toolbar)s' % matplotlib.rcParams + backend = options.backend.lower() + if backend.startswith("gtk"): + import gtk + print "# pygtk version: %s, gtk version: %s" % \ + (gtk.pygtk_version, gtk.gtk_version) + elif backend.startswith("qt4"): + import PyQt4.pyqtconfig + print "# PyQt4 version: %s, Qt version %x" % \ + (PyQt4.pyqtconfig.Configuration().pyqt_version_str, + PyQt4.pyqtconfig.Configuration().qt_version) + elif backend.startswith("qt"): + import pyqtconfig + print "# pyqt version: %s, qt version: %x" % \ + (pyqtconfig.Configuration().pyqt_version_str, + pyqtconfig.Configuration().qt_version) + elif backend.startswith("wx"): + import wx + print "# wxPython version: %s" % wx.__version__ + elif backend.startswith("tk"): + import Tkinter + print "# Tkinter version: %s, Tk version: %s, Tcl version: %s" % (Tkinter.__version__, Tkinter.TkVersion, Tkinter.TclVersion) + print '# Averaging over loops %d to %d' % (indStart, indEnd) print '# Memory went from %dk to %dk' % (start, end) print '# Average memory consumed per loop: %1.4fk bytes\n' % ((end-start)/float(indEnd-indStart))