Danny Shevitz | 16 Jul 00:45

Re: probable bug in @on_trait_change with delegated lists


> I'm not sure why this is happening though...

I have determined that my code worked with rev 18437 and failed with rev 18438.

After trapping, I was expecting to see the app work in the earlier version and
drag and drop fail in the later version, but that is not what happened. In fact
the app aborts immediately in rev 18438. The gui never even opens. Then in rev
18441 the app opens but my drag and drop fails in the way documented. So to
summarize (revs):
18437 is good
18438 app fails to run
18441 app runs but @on_trait_change('object.delegate_list*') fails.

The traceback at rev 18438 is:

Traceback (most recent call last):
  File "D:\logicModels\code\logicModels\ELMTree2.py", line 28, in <module>
    ui = the_app.configure_traits(view = app_view, handler=AppHandler(model=the_
app))
  File "d:\enthought\checkouts\traits_3.0.0b1\enthought\traits\has_traits.py", l
ine 2396, in configure_traits
    kind, handler, id, scrollable, args )
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\to
olkit.py", line 197, in view_application
    id, scrollable, args )
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\vi
ew_application.py", line 73, in view_application
    scrollable, args ).ui.result
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\vi
ew_application.py", line 116, in __init__
    super( ViewApplication, self ).__init__()
  File "C:\Python25\lib\site-packages\wxpython-2.8.4.0.0009_s-py2.5-win32.egg\wx
\_core.py", line 7857, in __init__
    wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
  File "C:\Python25\lib\site-packages\wxpython-2.8.4.0.0009_s-py2.5-win32.egg\wx
\_core.py", line 7757, in __init__
    self._BootstrapApp()
  File "C:\Python25\lib\site-packages\wxpython-2.8.4.0.0009_s-py2.5-win32.egg\wx
\_core.py", line 7354, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\vi
ew_application.py", line 132, in OnInit
    args       = self.args )
  File "d:\enthought\checkouts\traits_3.0.0b1\enthought\traits\ui\view.py", line
 480, in ui
    ui.ui( parent, kind )
  File "d:\enthought\checkouts\traits_3.0.0b1\enthought\traits\ui\ui.py", line 2
40, in ui
    self.rebuild( self, parent )
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\to
olkit.py", line 132, in ui_live
    ui_live.ui_live( ui, parent )
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\ui
_live.py", line 63, in ui_live
    ui_dialog( ui, parent, NONMODAL )
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\ui
_live.py", line 82, in ui_dialog
    ui.owner.init( ui, parent, style )
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\ui
_live.py", line 265, in init
    self.add_menubar()
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\traits\ui\wx\ui
_base.py", line 196, in add_menubar
    menubar.create_menu_bar( self.control, self ) )
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\pyface\ui\wx\ac
tion\menu_bar_manager.py", line 49, in create_menu_bar
    menu = item.create_menu(parent, controller)
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\pyface\ui\wx\ac
tion\menu_manager.py", line 58, in create_menu
    return _Menu(self, parent, controller)
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\pyface\ui\wx\ac
tion\menu_manager.py", line 107, in __init__
    self.refresh()
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\pyface\ui\wx\ac
tion\menu_manager.py", line 143, in refresh
    parent, group, previous_non_empty_group
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\pyface\ui\wx\ac
tion\menu_manager.py", line 195, in _add_group
    item.add_to_menu(parent, self, self._controller)
  File "d:\enthought\checkouts\traitsgui_3.0.0b1\enthought\pyface\action\action_
item.py", line 96, in add_to_menu
    wrapper = _MenuItem(parent, menu, self, controller)
  File "d:\enthought\checkouts\traitsbackendwx_3.0.0b1\enthought\pyface\ui\wx\ac
tion\action_item.py", line 68, in __init__
    self.item = item
  File "d:\enthought\checkouts\traits_3.0.0b1\enthought\traits\has_traits.py", l
ine 3296, in __prefix_trait__
    _add_event_handlers( trait, cls, handlers )
  File "d:\enthought\checkouts\traits_3.0.0b1\enthought\traits\has_traits.py", l
ine 398, in _add_event_handlers
    events = trait.event
AttributeError: type object 'Python' has no attribute 'event'

Gmane