[Twisted-Python] removing unsupported reactors in twisted 2.6: qt,

Robert Gravina robert at gravina.com
Mon Sep 25 11:12:32 EDT 2006


> Hi Glyph. I have recently added a post to the wxpython list to see if
> other folks can make themselves available to assist with this effort.
>
> http://lists.wxwidgets.org/cgi-bin/ezmlm-cgi?11:mss: 
> 55602:200609:hafkbkhbehmbhikjmmaf
>

I'll be extremely embarrassed if I was wrong about the errors with  
2.7 :) All I did was run my (currently working on 2.6.3.3) code with  
2.7, noticed an error on startup, and reverted to 2.6.3.3.

Update: I reinstalled the version for my platform (Mac OS X, python  
2.4 unicode PPC - actually I now have both versions installed) and  
wrote a simple script and got this traceback. It would seem the  
problem might just be that wxreactor is using a depreciated way to  
use wxPython (i.e. was wxSOMETHING now is wx.SOMETHING), thanks to  
the helpful depreciation warning.

*** My script ***
import wxversion
#I have both 2.6.3.3 and 2.7 installed. Change this to 2.6.3.3 and  
the example works
wxversion.select("2.7")
from twisted.internet import wxreactor
wxreactor.install()
import wx

class MyApp(wx.App):
     def OnInit(self):
         frame = wx.Frame(None, -1, "Hello wxPython world")
         frame.Show(True)
         self.SetTopWindow(frame)
         return True

if __name__ == "__main__":
     app = MyApp(False)
     app.MainLoop()

*** The traceback: ***
moko:~/sp rgravina$ pythonw wxtest.py
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/twisted/internet/wxreactor.py:37: DeprecationWarning: The  
wxPython compatibility package is no longer automatically generated  
or activly maintained.  Please switch to the wx package as soon as  
possible.
   from wxPython.wx import wxApp, wxCallAfter, wxEventLoop, wxFrame,  
NULL
Traceback (most recent call last):
   File "wxtest.py", line 4, in ?
     from twisted.internet import wxreactor
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/twisted/internet/wxreactor.py", line 37, in ?
     from wxPython.wx import wxApp, wxCallAfter, wxEventLoop,  
wxFrame, NULL
   File "//Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/wx-2.7.0-mac-unicode/wxPython/__init__.py",  
line 15, in ?
     import _wx
   File "//Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/wx-2.7.0-mac-unicode/wxPython/_wx.py", line  
7, in ?
     from _controls import *
   File "//Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/wx-2.7.0-mac-unicode/wxPython/_controls.py",  
line 441, in ?
     wxFRAME_EX_CONTEXTHELP = wx._controls.FRAME_EX_CONTEXTHELP
AttributeError: 'module' object has no attribute 'FRAME_EX_CONTEXTHELP'

Robert




More information about the Twisted-Python mailing list