8000 Merged revisions 3873-3884 via svnmerge from · matplotlib/matplotlib@84f10e1 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 84f10e1

Browse files
committed
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 ........ svn path=/branches/transforms/; revision=3885
1 parent f58454f commit 84f10e1

File tree

8 files changed

+36
-49
lines changed

8 files changed

+36
-49
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2007-09-24 Applied Eike Welk's patch reported on mpl-dev on 2007-09-22
2+
Fixes a bug with multiple plot windows in the qt backend,
3+
ported the changes to backend_qt4 as well - DSD
4+
15
2007-09-21 Changed cbook.reversed to yield the same result as the
26
python reversed builtin - DSD
37

examples/embedding_in_qt.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# Note: color-intensive applications may require a different color allocation
2727
# strategy.
28-
QApplication.setColorSpec(QApplication.NormalColor)
28+
#QApplication.setColorSpec(QApplication.NormalColor)
2929
app = QApplication(sys.argv)
3030

3131
class MyMplCanvas(FigureCanvas):
@@ -129,12 +129,8 @@ def about(self):
129129
% {"prog": progname, "version": progversion})
130130

131131

132-
def main():
133-
aw = ApplicationWindow()
134-
aw.setCaption("%s" % progname)
135-
qApp.setMainWidget(aw)
136-
aw.show()
137-
sys.exit(qApp.exec_loop())
138-
139-
140-
if __name__ == "__main__": main()
132+
aw = ApplicationWindow()
133+
aw.setCaption("%s" % progname)
134+
qApp.setMainWidget(aw)
135+
aw.show()
136+
sys.exit(qApp.exec_loop())

examples/embedding_in_qt4.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,10 @@ def about(self):
122122
% {"prog": progname, "version": progversion})
123123

124124

125-
def main():
126-
# Note: color-intensive applications may require a different color
127-
# allocation strategy.
128-
QtGui.QApplication.setColorSpec(QtGui.QApplication.NormalColor)
129-
qApp = QtGui.QApplication(sys.argv)
125+
qApp = QtGui.QApplication(sys.argv)
130126

131-
aw = ApplicationWindow()
132-
aw.setWindowTitle("%s" % progname)
133-
aw.show()
134-
# sys.exit(qApp.exec_())
135-
qApp.exec_()
136-
137-
138-
if __name__ == "__main__": main()
127+
aw = ApplicationWindow()
128+
aw.setWindowTitle("%s" % progname)
129+
aw.show()
130+
sys.exit(qApp.exec_())
131+
#qApp.exec_()

lib/matplotlib/backends/backend_pdf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,10 @@ def embedType1(self, filename, fontinfo):
541541
widths[ch] = afmdata.get_width_char(ch, isord=True)
542542
except KeyError:
543543
pass
544-
not_None = (ch for ch in range(256)
545-
if widths[ch] is not None)
546-
firstchar = not_None.next()
547-
lastchar = max(not_None)
544+
not_None = [ch for ch in range(256)
545+
if widths[ch] is not None]
546+
firstchar = not_None[0]
547+
lastchar = not_None[-1]
548548
widths = widths[firstchar:lastchar+1]
549549
for i,w in enumerate(widths):
550550
if w is None: widths[i] = 0

lib/matplotlib/backends/backend_qt.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ def _create_qApp():
4646
qApp = qt.QApplication( [" "] )
4747
qt.QObject.connect( qApp, qt.SIGNAL( "lastWindowClosed()" ),
4848
qApp, qt.SLOT( "quit()" ) )
49-
else:
50-
# someone else aready created the qApp and
51-
# we let them handle the event-loop control.
52-
show._needmain = False
49+
#remember that matplotlib created the qApp - will be used by show()
50+
_create_qApp.qAppCreatedHere = True
51+
52+
_create_qApp.qAppCreatedHere = False
5353

5454
def show():
5555
"""
@@ -65,11 +65,8 @@ def show():
6565
if figManager != None:
6666
figManager.canvas.draw()
6767

68-
if ( show._needmain ):
69-
qt.qApp.exec_loop()
70-
show._needmain = False
71-
72-
show._needmain = True
68+
if _create_qApp.qAppCreatedHere:
69+
qt.qApp.exec_loop()
7370

7471

7572
def new_figure_manager( num, *args, **kwargs ):

lib/matplotlib/backends/backend_qt4.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ def _create_qApp():
4646
qApp = QtGui.QApplication( [" "] )
4747
QtCore.QObject.connect( qApp, QtCore.SIGNAL( "lastWindowClosed()" ),
4848
qApp, QtCore.SLOT( "quit()" ) )
49-
F438 else:
50-
# someone else aready created the qApp and
51-
# we let them handle the event-loop control.
52-
show._needmain = False
49+
#remember that matplotlib created the qApp - will be used by show()
50+
_create_qApp.qAppCreatedHere = True
51+
52+
_create_qApp.qAppCreatedHere = False
5353

5454
def show():
5555
"""
@@ -65,11 +65,8 @@ def show():
6565
if figManager != None:
6666
figManager.canvas.draw()
6767

68-
if ( show._needmain ):
69-
qApp.exec_()
70-
show._needmain = False
71-
72-
show._needmain = True
68+
if _create_qApp.qAppCreatedHere:
69+
QtGui.qApp.exec_()
7370

7471

7572
def new_figure_manager( num, *args, **kwargs ):

lib/matplotlib/config/mpltraits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class BackendHandler(T.TraitHandler):
2929
'gtkcairo': 'GTKCairo',
3030
'qt4agg': 'Qt4Agg',
3131
'qtagg': 'QtAgg',
32-
'wxagg': 'WxAgg',
32+
'wxagg': 'WXAgg',
3333
'agg': 'Agg',
3434
'cairo': 'Cairo',
3535
'ps': 'PS',

lib/matplotlib/dviread.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ def _fnt_num(self, k):
350350
def _xxx(self, special):
351351
matplotlib.verbose.report(
352352
'Dvi._xxx: encountered special: %s'
353-
% ''.join((32 <= ord(ch) < 127) and ch
354-
or '<%02x>' % ord(ch)
355-
for ch in special),
353+
% ''.join([(32 <= ord(ch) < 127) and ch
354+
or '<%02x>' % ord(ch)
355+
for ch in special]),
356356
'debug')
357357

358358
def _fnt_def(self, k, c, s, d, a, l, n):

0 commit comments

Comments
 (0)
0