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

gui.Form.items() raises AttributeError #23

Closed
GoogleCodeExporter opened this issue Mar 28, 2015 · 1 comment
Closed

gui.Form.items() raises AttributeError #23

GoogleCodeExporter opened this issue Mar 28, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Make a gui.App() and a gui.Form().
2. Add some widgets with names: t = Table(name='mypanel').
3. print gui_form.items()

What is the expected output? What do you see instead?
Expected:
    Print the items.
Instead:
  File ".../gummworld2/world_editor.py", line 490, in __init__
    self.make_gui()
  File ".../gummworld2/world_editor.py", line 615, in make_gui
    print self.gui_form.items()
  File ".../gummworld2\gamelib\pgu\gui\form.py", line 71, in items
    return self.results().items()
  File ".../gummworld2\gamelib\pgu\gui\form.py", line 66, in results
    r[e.name] = e.value
AttributeError: Table instance has no attribute 'value'


What version of the product are you using? On what operating system?
pgu 0.14, pygame 1.9.1, Python 2.6.6, Windows 7.

Please provide any additional information below.
As a workaround I am doing:

    # Force the form to process _dirty state.
    gui_form['whatever']

    # Directly access.
    gui_form._emap.items()

I have no fix for this. It would take a significant class update. I can try it, 
but you might not like my choices. Looks like the way add() parses the 
arguments, and items() returns the info, the class may be incomplete or 
Container's use of add() is incomplete?

Original issue reported on code.google.com by stabbing...@gmail.com on 28 Jan 2011 at 3:54

@GoogleCodeExporter
Copy link
Author

This is now fixed in the repository code. The problem was in handling widgets 
that don't have a defined 'value' field (eg Table). items() should work as 
expected now.

Original comment by peter.ro...@gmail.com on 6 Mar 2011 at 9:18

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant