Python
2.3.4 (#53, Oct 18 2004, 20:35:07) [MSC v.1200 32 bit (Intel)]
wxPython 2.5.3.1, Boa Constructor 0.4.0-pre
Multiversion install, wxPython 2.5 is default, wxPython
2.4.2.4-msw-ansi is the other version
Steps
to create the error:
In Boa’s Editor, select a variable name, right-click on selection,
select “BRM - Rename”.
The following traceback is generated:
00:32:01: Traceback (most recent call
last):
00:32:01: File
“C:\Python23\Lib\site-packages\wx-2.5.3-msw-ansi\wxPython\tools\cvsfiles\boa\Plug-ins\BicycleRepairMan.plug-in.py”,
line 256, in OnRename
00:32:01: newname = wx.wxGetTextFromUser(‘Rename to:’, ‘Rename’,
sel)
00:32:01: AttributeError: ‘module’ object has no attribute
‘wxGetTextFromUser’
I think I previously went about trying to fix these bugs the wrong way,
by renaming items like “wxGetTextFromUser” to “GetTextFromUser”
in Plug-ins\BicycleRepairMan.plug-in.py. Then I realized that Boa does
not look like it’s rewritten to use the new wx namespace, but rather it
seeks to use the old 2.4 namespace under 2.5. So I think the right way
to fix the problem is by writing the wx import statement differently.
I tried to rewrite it like the imports in Boa.py, but that didn’t
work. I’ve read the MultiVersionInstalls wiki page, but haven’t been
able to figure out how to apply its recommendations to BRM. I tried
each of the following, and all produced startup errors or the above
error:
from
wxPython import wx # this was the original line
···
–
from
wxPython import *
–
import
wx
–
import
wxversion
wxversion.select(‘2.4’)
import wx
–
import wxversion
wxversion.select(‘2.4’)
from wxPython import wx
–
import
wxversion
wxversion.select(‘2.5’)
import wx
–
import wxversion
wxversion.select(‘2.5’)
from wxPython import wx
What am I doing wrong?
Tim Black