Error running sample wxProject.py

I just upgraded from:
$ rpm -qa | grep -i wxpy
wxPythonGTK-py2.2-2.3.3.1-1
wxPythonGTK-py2.2-devel-2.3.3.1-1

to:
$ rpm -qa | grep -i wxpy
wxPythonGTK-devel-2.4.0.4-1
wxPythonGTK-py2.2-2.4.0.4-1

I downloaded the sample code and ran some of them. This one blows up:

[scott@willy wxProject]$ python2.2 wxProject.py
wxProject.py:92: DeprecationWarning: Use Python's True instead
  splitter.SetSashPosition (180, true)
wxProject.py:94: DeprecationWarning: Use Python's True instead
  self.Show(true)
Traceback (most recent call last):
  File "wxProject.py", line 284, in ?
    app = App(0)
  File "/usr/lib/python2.2/site-packages/wxPython/wx.py", line 1809, in
__init__
    _wxStart(self.OnInit)
TypeError: OnInit should return a boolean value

Is this something wrong at my end or is there a bug in the wxPython
distribution?

Scott

Scott Chapman wrote:

I just upgraded from:
$ rpm -qa | grep -i wxpy
wxPythonGTK-py2.2-2.3.3.1-1
wxPythonGTK-py2.2-devel-2.3.3.1-1

to:
$ rpm -qa | grep -i wxpy
wxPythonGTK-devel-2.4.0.4-1
wxPythonGTK-py2.2-2.4.0.4-1

I downloaded the sample code and ran some of them. This one blows up:

[scott@willy wxProject]$ python2.2 wxProject.py
wxProject.py:92: DeprecationWarning: Use Python's True instead
  splitter.SetSashPosition (180, true)
wxProject.py:94: DeprecationWarning: Use Python's True instead
  self.Show(true)
Traceback (most recent call last):
  File "wxProject.py", line 284, in ?
    app = App(0)
  File "/usr/lib/python2.2/site-packages/wxPython/wx.py", line 1809, in
__init__
    _wxStart(self.OnInit)
TypeError: OnInit should return a boolean value

Is this something wrong at my end or is there a bug in the wxPython
distribution?

Scott

It seems that the new version of wxPython isn't backward compatible.
Boa-constructor also doesn't work any more. In cvs, you can see "wxPython
2.4.0.4 not supported yet". All my stuff doesn't work any more too. (sic)

IT's not you. the problem is the transition to the native Python "True", rather than the old wxPython "true". Robin overlooked a small issue when trying to keep it all backward compatible. The solution is to replace "true" with "True" in your wxApp OnInit function (and perhaps a few other places, though anywhere else, I only got warnings). robin is aware, and will soon be releasing a 2.4.0.5, which will fix this and a few other things.

-Chris

Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

···

On Tuesday, March 11, 2003, at 09:02 AM, Philippe Lafoucrière wrote:

wxProject.py:94: DeprecationWarning: Use Python's True instead
  self.Show(true)
Traceback (most recent call last):
  File "wxProject.py", line 284, in ?
    app = App(0)
  File "/usr/lib/python2.2/site-packages/wxPython/wx.py", line 1809, in
__init__
    _wxStart(self.OnInit)
TypeError: OnInit should return a boolean value

Is this something wrong at my end or is there a bug in the wxPython
distribution?

Scott

It seems that the new version of wxPython isn't backward compatible.
Boa-constructor also doesn't work any more. In cvs, you can see "wxPython
2.4.0.4 not supported yet". All my stuff doesn't work any more too. (sic)