8000 Merge branch 'v1.0.x' · matplotlib/matplotlib@2f6d96b · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f6d96b

Browse files
committed
Merge branch 'v1.0.x'
2 parents 4c02df2 + 8d86fa3 commit 2f6d96b

File tree

3 files changed

+242
-213
lines changed

3 files changed

+242
-213
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2011-03-29 Wrapped ViewVCCachedServer definition in a factory function.
2+
This class now inherits from urllib2.HTTPSHandler in order
3+
to fetch data from github, but HTTPSHandler is not defined
4+
if python was built without SSL support. - DSD
5+
16
2011-03-10 Update pytz version to 2011c, thanks to Simon Cross. - JKS
27

38
2011-03-06 Add standalone tests.py test runner script. - JKS

lib/matplotlib/backends/backend_qt4.py

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
from matplotlib.figure import Figure
1616
from matplotlib.mathtext import MathTextParser
1717
from matplotlib.widgets import SubplotTool
18-
import matplotlib.backends.qt4_editor.figureoptions as figureoptions
18+
try:
19+
import matplotlib.backends.qt4_editor.figureoptions as figureoptions
20+
except ImportError:
21+
figureoptions = None
22+
figureoptions = None
23+
24+
print figureoptions
1925

2026
try:
2127
from PyQt4 import QtCore, QtGui
@@ -429,9 +435,10 @@ def _init_toolbar(self):
429435
self.configure_subplots)
430436
a.setToolTip('Configure subplots')
431437

432-
a = self.addAction(self._icon("qt4_editor_options.svg"),
433-
'Customize', self.edit_parameters)
434-
a.setToolTip('Edit curves line and axes parameters')
438+
if figureoptions is not None:
439+
a = self.addAction(self._icon("qt4_editor_options.svg"),
440+
'Customize', self.edit_parameters)
441+
a.setToolTip('Edit curves line and axes parameters')
435442

436443
a = self.addAction(self._icon('filesave.svg'), 'Save',
437444
self.save_figure)
@@ -456,34 +463,35 @@ def _init_toolbar(self):
456463
# reference holder for subplots_adjust window
457464
self.adj_window = None
458465

459-
def edit_parameters(self):
460-
allaxes = self.canvas.figure.get_axes()
461-
if len(allaxes) == 1:
462-
axes = allaxes[0]
463-
else:
464-
titles = []
465-
for axes in allaxes:
466-
title = axes.get_title()
467-
ylabel = axes.get_ylabel()
468-
if title:
469-
text = title
470-
if ylabel:
471-
text += ": "+ylabel
472-
text += " (%s)"
473-
elif ylabel:
474-
text = "%%s (%s)" % ylabel
475-
else:
476-
text = "%s"
477-
titles.append(text % repr(axes))
478-
item, ok = QtGui.QInputDialog.getItem(self, 'Customize',
479-
'Select axes:', titles,
480-
0, False)
481-
if ok:
482-
axes = allaxes[titles.index(unicode(item))]
466+
if figureoptions is not None:
467+
def edit_parameters(self):
468+
allaxes = self.canvas.figure.get_axes()
469+
if len(allaxes) == 1:
470+
axes = allaxes[0]
483471
else:
484-
return
472+
titles = []
473+
for axes in allaxes:
474+
title = axes.get_title()
475+
ylabel = axes.get_ylabel()
476+
if title:
477+
text = title
478+
if ylabel:
479+
text += ": "+ylabel
480+
text += " (%s)"
481+
elif ylabel:
482+
text = "%%s (%s)" % ylabel
483+
else:
484+
text = "%s"
485+
titles.append(text % repr(axes))
486+
item, ok = QtGui.QInputDialog.getItem(self, 'Customize',
487+
'Select axes:', titles,
488+
0, False)
489+
if ok:
490+
axes = allaxes[titles.index(unicode(item))]
491+
else:
492+
return
485493

486-
figureoptions.figure_edit(axes, self)
494+
figureoptions.figure_edit(axes, self)
487495

488496

489497
def dynamic_update( self ):

0 commit comments

Comments
 (0)
0