Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some examples broken from not implementing _create_component #500

Closed
1 of 4 tasks
aaronayres35 opened this issue Dec 15, 2020 · 2 comments · Fixed by #508
Closed
1 of 4 tasks

Some examples broken from not implementing _create_component #500

aaronayres35 opened this issue Dec 15, 2020 · 2 comments · Fixed by #508

Comments

@aaronayres35
Copy link
Contributor

aaronayres35 commented Dec 15, 2020

The demo currently located here https://github.com/enthought/enable/blob/2b3dbb7bae5b6e7946c4cbfaf90982c746da519a/examples/enable/canvas_demo.py, but soon to be moved by #494, currently does not run.

Trying to run the demo gives the following traceback:

$ python canvas_demo.py 
Traceback (most recent call last):
  File "canvas_demo.py", line 24, in <module>
    demo = demo_main(Demo, title="Canvas example")
  File "/Users/aayres/Desktop/enable/enable/example_support.py", line 49, in demo_main
    demo_class().configure_traits()
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traits/has_traits.py", line 2015, in configure_traits
    args,
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/toolkit.py", line 233, in view_application
    context, view, kind, handler, id, scrollable, args
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/view_application.py", line 84, in view_application
    context, view, kind, handler, id, scrollable, args
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/view_application.py", line 126, in __init__
    args=self.args,
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/view.py", line 462, in ui
    ui.ui(parent, kind)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/ui.py", line 244, in ui
    self.rebuild(self, parent)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/toolkit.py", line 163, in ui_live
    ui_live.ui_live(ui, parent)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_live.py", line 43, in ui_live
    _ui_dialog(ui, parent, BaseDialog.NONMODAL)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_live.py", line 65, in _ui_dialog
    BaseDialog.display_ui(ui, parent, style)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_base.py", line 286, in display_ui
    ui.owner.init(ui, parent, style)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_live.py", line 225, in init
    self.add_contents(panel(ui), bbox)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_panel.py", line 259, in panel
    panel = _GroupPanel(content[0], ui).control
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_panel.py", line 617, in __init__
    layout = self._add_items(content, inner)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_panel.py", line 883, in _add_items
    ui, object, name, item.tooltip, None
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/editor_factory.py", line 132, in simple_editor
    description=description,
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/editor.py", line 459, in __init__
    self.old_value = getattr(self.object, self.name)
  File "/Users/aayres/Desktop/enable/enable/example_support.py", line 40, in _component_default
    return self._create_component()
  File "/Users/aayres/Desktop/enable/enable/example_support.py", line 45, in _create_component
    raise NotImplementedError
NotImplementedError

EDIT:

@aaronayres35
Copy link
Contributor Author

Note a similar traceback is seen with: https://github.com/enthought/enable/blob/7b56e5275c707e7ee5749ce4ba141240729f5a26/examples/enable/shapes/run.py

$ python run.py 
Traceback (most recent call last):
  File "run.py", line 67, in <module>
    title="Click and drag the shapes")
  File "/Users/aayres/Desktop/enable/enable/example_support.py", line 49, in demo_main
    demo_class().configure_traits()
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traits/has_traits.py", line 2015, in configure_traits
    args,
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/toolkit.py", line 233, in view_application
    context, view, kind, handler, id, scrollable, args
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/view_application.py", line 84, in view_application
    context, view, kind, handler, id, scrollable, args
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/view_application.py", line 126, in __init__
    args=self.args,
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/view.py", line 462, in ui
    ui.ui(parent, kind)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/ui.py", line 244, in ui
    self.rebuild(self, parent)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/toolkit.py", line 163, in ui_live
    ui_live.ui_live(ui, parent)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_live.py", line 43, in ui_live
    _ui_dialog(ui, parent, BaseDialog.NONMODAL)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_live.py", line 65, in _ui_dialog
    BaseDialog.display_ui(ui, parent, style)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_base.py", line 286, in display_ui
    ui.owner.init(ui, parent, style)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_live.py", line 225, in init
    self.add_contents(panel(ui), bbox)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_panel.py", line 259, in panel
    panel = _GroupPanel(content[0], ui).control
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_panel.py", line 617, in __init__
    layout = self._add_items(content, inner)
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/qt4/ui_panel.py", line 883, in _add_items
    ui, object, name, item.tooltip, None
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/editor_factory.py", line 132, in simple_editor
    description=description,
  File "/Users/aayres/.edm/envs/enable-test-3.6-null-pillow/lib/python3.6/site-packages/traitsui/editor.py", line 459, in __init__
    self.old_value = getattr(self.object, self.name)
  File "/Users/aayres/Desktop/enable/enable/example_support.py", line 40, in _component_default
    return self._create_component()
  File "/Users/aayres/Desktop/enable/enable/example_support.py", line 45, in _create_component
    raise NotImplementedError
NotImplementedError

@aaronayres35 aaronayres35 changed the title canvas_demo.py is broken Some examples broken from not implementing _create_component Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant