From: <md...@us...> - 2007-09-24 16:54:40
|
Revision: 3885 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3885&view=rev Author: mdboom Date: 2007-09-24 09:54:37 -0700 (Mon, 24 Sep 2007) Log Message: ----------- Merged revisions 3873-3884 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r3874 | jouni | 2007-09-22 02:48:49 -0400 (Sat, 22 Sep 2007) | 3 lines Replace some generator expressions by list comprehensions for Python 2.3 compatibility ........ r3879 | dsdale | 2007-09-24 08:56:38 -0400 (Mon, 24 Sep 2007) | 2 lines fix backend_qt* bug with multiple plot windows and show() ........ r3880 | dsdale | 2007-09-24 09:00:12 -0400 (Mon, 24 Sep 2007) | 2 lines backend_qt* bugfix for multiple plot windows and show() ........ r3881 | dsdale | 2007-09-24 09:01:17 -0400 (Mon, 24 Sep 2007) | 2 lines fix backend_wxagg reference in new config module ........ r3882 | dsdale | 2007-09-24 09:03:01 -0400 (Mon, 24 Sep 2007) | 3 lines modifed embedding_in_qt* examples so they can be run from ipython with -q*thread ........ r3883 | dsdale | 2007-09-24 11:11:58 -0400 (Mon, 24 Sep 2007) | 2 lines fix bug in improved support for multiple windows in backend_qt4 ........ Modified Paths: -------------- branches/transforms/CHANGELOG branches/transforms/examples/embedding_in_qt.py branches/transforms/examples/embedding_in_qt4.py branches/transforms/lib/matplotlib/backends/backend_pdf.py branches/transforms/lib/matplotlib/backends/backend_qt.py branches/transforms/lib/matplotlib/backends/backend_qt4.py branches/transforms/lib/matplotlib/config/mpltraits.py branches/transforms/lib/matplotlib/dviread.py Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-3872 + /trunk/matplotlib:1-3884 Modified: branches/transforms/CHANGELOG =================================================================== --- branches/transforms/CHANGELOG 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/CHANGELOG 2007-09-24 16:54:37 UTC (rev 3885) @@ -1,3 +1,7 @@ +2007-09-24 Applied Eike Welk's patch reported on mpl-dev on 2007-09-22 + Fixes a bug with multiple plot windows in the qt backend, + ported the changes to backend_qt4 as well - DSD + 2007-09-21 Changed cbook.reversed to yield the same result as the python reversed builtin - DSD Modified: branches/transforms/examples/embedding_in_qt.py =================================================================== --- branches/transforms/examples/embedding_in_qt.py 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/examples/embedding_in_qt.py 2007-09-24 16:54:37 UTC (rev 3885) @@ -25,7 +25,7 @@ # Note: color-intensive applications may require a different color allocation # strategy. -QApplication.setColorSpec(QApplication.NormalColor) +#QApplication.setColorSpec(QApplication.NormalColor) app = QApplication(sys.argv) class MyMplCanvas(FigureCanvas): @@ -129,12 +129,8 @@ % {"prog": progname, "version": progversion}) -def main(): - aw = ApplicationWindow() - aw.setCaption("%s" % progname) - qApp.setMainWidget(aw) - aw.show() - sys.exit(qApp.exec_loop()) - - -if __name__ == "__main__": main() +aw = ApplicationWindow() +aw.setCaption("%s" % progname) +qApp.setMainWidget(aw) +aw.show() +sys.exit(qApp.exec_loop()) Modified: branches/transforms/examples/embedding_in_qt4.py =================================================================== --- branches/transforms/examples/embedding_in_qt4.py 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/examples/embedding_in_qt4.py 2007-09-24 16:54:37 UTC (rev 3885) @@ -122,17 +122,10 @@ % {"prog": progname, "version": progversion}) -def main(): - # Note: color-intensive applications may require a different color - # allocation strategy. - QtGui.QApplication.setColorSpec(QtGui.QApplication.NormalColor) - qApp = QtGui.QApplication(sys.argv) +qApp = QtGui.QApplication(sys.argv) - aw = ApplicationWindow() - aw.setWindowTitle("%s" % progname) - aw.show() -# sys.exit(qApp.exec_()) - qApp.exec_() - - -if __name__ == "__main__": main() +aw = ApplicationWindow() +aw.setWindowTitle("%s" % progname) +aw.show() +sys.exit(qApp.exec_()) +#qApp.exec_() Modified: branches/transforms/lib/matplotlib/backends/backend_pdf.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-24 16:54:37 UTC (rev 3885) @@ -541,10 +541,10 @@ widths[ch] = afmdata.get_width_char(ch, isord=True) except KeyError: pass - not_None = (ch for ch in range(256) - if widths[ch] is not None) - firstchar = not_None.next() - lastchar = max(not_None) + not_None = [ch for ch in range(256) + if widths[ch] is not None] + firstchar = not_None[0] + lastchar = not_None[-1] widths = widths[firstchar:lastchar+1] for i,w in enumerate(widths): if w is None: widths[i] = 0 Modified: branches/transforms/lib/matplotlib/backends/backend_qt.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_qt.py 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/lib/matplotlib/backends/backend_qt.py 2007-09-24 16:54:37 UTC (rev 3885) @@ -46,11 +46,11 @@ qApp = qt.QApplication( [" "] ) qt.QObject.connect( qApp, qt.SIGNAL( "lastWindowClosed()" ), qApp, qt.SLOT( "quit()" ) ) - else: - # someone else aready created the qApp and - # we let them handle the event-loop control. - show._needmain = False + #remember that matplotlib created the qApp - will be used by show() + _create_qApp.qAppCreatedHere = True +_create_qApp.qAppCreatedHere = False + def show(): """ Show all the figures and enter the qt main loop @@ -65,13 +65,10 @@ if figManager != None: figManager.canvas.draw() - if ( show._needmain ): - qt.qApp.exec_loop() - show._needmain = False + if _create_qApp.qAppCreatedHere: + qt.qApp.exec_loop() -show._needmain = True - def new_figure_manager( num, *args, **kwargs ): """ Create a new figure manager instance Modified: branches/transforms/lib/matplotlib/backends/backend_qt4.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_qt4.py 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/lib/matplotlib/backends/backend_qt4.py 2007-09-24 16:54:37 UTC (rev 3885) @@ -46,11 +46,11 @@ qApp = QtGui.QApplication( [" "] ) QtCore.QObject.connect( qApp, QtCore.SIGNAL( "lastWindowClosed()" ), qApp, QtCore.SLOT( "quit()" ) ) - else: - # someone else aready created the qApp and - # we let them handle the event-loop control. - show._needmain = False + #remember that matplotlib created the qApp - will be used by show() + _create_qApp.qAppCreatedHere = True +_create_qApp.qAppCreatedHere = False + def show(): """ Show all the figures and enter the qt main loop @@ -65,13 +65,10 @@ if figManager != None: figManager.canvas.draw() - if ( show._needmain ): - qApp.exec_() - show._needmain = False + if _create_qApp.qAppCreatedHere: + QtGui.qApp.exec_() -show._needmain = True - def new_figure_manager( num, *args, **kwargs ): """ Create a new figure manager instance Modified: branches/transforms/lib/matplotlib/config/mpltraits.py =================================================================== --- branches/transforms/lib/matplotlib/config/mpltraits.py 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/lib/matplotlib/config/mpltraits.py 2007-09-24 16:54:37 UTC (rev 3885) @@ -29,7 +29,7 @@ 'gtkcairo': 'GTKCairo', 'qt4agg': 'Qt4Agg', 'qtagg': 'QtAgg', - 'wxagg': 'WxAgg', + 'wxagg': 'WXAgg', 'agg': 'Agg', 'cairo': 'Cairo', 'ps': 'PS', Modified: branches/transforms/lib/matplotlib/dviread.py =================================================================== --- branches/transforms/lib/matplotlib/dviread.py 2007-09-24 16:53:38 UTC (rev 3884) +++ branches/transforms/lib/matplotlib/dviread.py 2007-09-24 16:54:37 UTC (rev 3885) @@ -350,9 +350,9 @@ def _xxx(self, special): matplotlib.verbose.report( 'Dvi._xxx: encountered special: %s' - % ''.join((32 <= ord(ch) < 127) and ch - or '<%02x>' % ord(ch) - for ch in special), + % ''.join([(32 <= ord(ch) < 127) and ch + or '<%02x>' % ord(ch) + for ch in special]), 'debug') def _fnt_def(self, k, c, s, d, a, l, n): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |