Orange Forum • View topic - cvs breakage: OWGraph.setTitle(None) fails

cvs breakage: OWGraph.setTitle(None) fails

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

cvs breakage: OWGraph.setTitle(None) fails

Postby Alon » Tue Apr 17, 2007 22:54

Hi,

This is the actual output from orange (i.e. OrangeCanvas):
File: OWGraph.py in line 218
Function name: setShowMainTitle
Code: self.setTitle(None)
Exception type:
Exception value: argument 1 of QwtPlot.setTitle() has an invalid type

I've found this bug to happen in ubuntu feisty-fawn and gentoo. I'm using a cvs orange (updated in the last hour). The problem and fix are minor - two methods in OWGraph that inherits from QwtPlot: setTitle and setAxisTitle. It seems the version of qwt I use doesn't like a title thats None. The simple solution I used was to wrap these two methods so that they do accept None. Of course another solution would be not to give the None in the first place. Anyway, the following patch will fix it (I did fix and got it to work with this approach - it broke later on other stuff I haven't fixed yet, but I didn't make a patch yet, so this is just code I'm writing now and not working tested code):

oldQwtPlot = QwtPlot
class QwtPlot(oldQwtPlot):
def setTitle(self, title):
return oldQwtPlot.setTitle(self, str(title))
def setAxisTitle(self, which, title):
return oldQwtPlot.setAxisTitle(self, which, str(title))

My qwt version:
In [2]: qwt.QWT_VERSION
Out[2]: 262656

In [3]: qwt.QWT_VERSION_STR
Out[3]: '4.2.0'

Alon

Return to Bugs