Just upgraded to wx 2.8

Thank you guys for your help on this one. I got through it by going
through the tedious task of writing regular expressions to upgrade all
of our code to post-wx 2.4 operability.

I think I have one last regular expression change to undo, unless
someone thinks it's not a big deal... All of my Boa-generated UIs now
have identifiers in the wx namespace, e.g:

[wx.ID_WXDIALOG1, wx.ID_WXDIALOG1BNCOPY, wx.ID_WXDIALOG1BTNOK,
wx.ID_WXDIALOG1STATICBOX1, wx.ID_WXDIALOG1STATICBOX2,
wx.ID_WXDIALOG1STATICTEXT4, wx.ID_WXDIALOG1STBUILDINFO,
wx.ID_WXDIALOG1STHARDWARE,
] = [wx.NewId() for _init_ctrls in range(8)]

Obviously, you can see that this is the result of the case sensitive
regex 'wx[A-Z]+' basically.

So, Any problem leaving those around? I figured that by using the
wx.NewID() method, collisions would not occur unless one of the dialogs
again tried to reference its components by ID, which none do, since they
have instance variables after creation.

Thanks again for your help!

- Aaron Rubin

ยทยทยท

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, January 31, 2007 1:43 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Just upgraded to wx 2.8

Aaron Rubin wrote:
> I am using py2exe (version 0.6.6) along with Python 2.4 and
wxPython
> 2.8. I was using wxPython 2.6 before.
>
> I can run my application just fine from Wing IDE, but when
I build it
> using py2exe, I get the following error
>
> AttributeError: 'module' object has no attribute 'build'
>
> This happens on the line of code:
>
> from wx import *
>
> I have noticed that the module 'build' is relatively new, so maybe
> something is cached somewhere?
>
> Any idears? Thanks!

You have two choices:

1. Don't use "from wx import *" as has already been
mentioned. It is trying to import everything in the
wx.__all__ list even if you don't use it, and py2exe is not
including those things that you don't use so it is not
finding it in the bundled modules at runtime. By not doing
an "import *" you will also save the memory needed to load
about 3400 names/references into each of your modules' dictionaries.

2. Force py2exe to include the wx.build package, and anything
else that it complains about after that.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org

Hi Aaron,

Aaron Rubin wrote:

Thank you guys for your help on this one. I got through it by going
through the tedious task of writing regular expressions to upgrade all
of our code to post-wx 2.4 operability.
  

Pity that the upgrader did not work for you.

I think I have one last regular expression change to undo, unless
someone thinks it's not a big deal... All of my Boa-generated UIs now
have identifiers in the wx namespace, e.g:

[wx.ID_WXDIALOG1, wx.ID_WXDIALOG1BNCOPY, wx.ID_WXDIALOG1BTNOK,
wx.ID_WXDIALOG1STATICBOX1, wx.ID_WXDIALOG1STATICBOX2,
wx.ID_WXDIALOG1STATICTEXT4, wx.ID_WXDIALOG1STBUILDINFO,
wx.ID_WXDIALOG1STHARDWARE,
] = [wx.NewId() for _init_ctrls in range(8)]

That should look something like this if you want to stay compatible with Boa.

[wxID_PANELTFIRST, wxID_PANELTFIRSTFIRSTIMP, wxID_PANELTFIRSTREMARKSFIRSTIMP,
wxID_PANELTFIRSTSTFIRSTIMP, wxID_PANELTFIRSTSTREMARKSFIRSTIMP,
] = [wx.NewId() for _init_ctrls in range(5)]

But anyhow I don't think it is a good idea to pollute the wx namespace with all that, unlikely that you get a conflict but who knows.

Werner