GNOME Bugzilla – Bug 344157
object.dump() output includes function names that cannot be executed
Last modified: 2006-07-14 15:38:29 UTC
Please describe the problem: This may be a user error, but something funny is going on here. Using the dump() function on an object such as a GUI button returns a list of functions - some of which are not executable for the button. Corresponding dir(Button) output does not include these function names. For example, selecting the 'Open' button in gedit returns a list of these functions: press release click But, dir (Button) does not return press or release. This seems broken - shouldn't the press/release functions always be available for a button? Steps to reproduce: Here's a series of commands entered into the Python interpreter that recreate the problem: >>> gedit = tree.root.application ('gedit') >>> theButton = gedit.button('Open') >>> dir (theButton) ['_Node__accessible', '_Node__action', '_Node__component', '_Node__hideChildren', '_Node__nodeIsIdentifiable', '_Node__text', '__doc__', '__getattr__', '__init__', '__module__', '__setattr__', '__str__', 'addSelection', 'blink', 'button', 'child', 'childLabelled', 'childNamed', 'click', 'contained', 'debugName', 'doAction', 'dump', 'findAncestor', 'findChild', 'findChildren', 'getAbsoluteSearchPath', 'getLogString', 'getNSelections', 'getRelativeSearch', 'getUserVisibleStrings', 'grabFocus', 'menu', 'menuItem', 'rawClick', 'rawType', 'removeSelection', 'satisfies', 'setSelection', 'tab', 'textentry', 'typeText'] >>> theButton.dump() {"Open" button} press release click >>> theButton.click() click on {"Open" button} 1 >>> theButton.press() Traceback (most recent call last):
+ Trace 68703
else: raise AttributeError, attr
Actual results: Expected results: Does this happen every time? Other information:
The output of Node.dump() wasn't intended to produce anything directly mappable to the output of dir() - it was written as a way to list the capabilities of the underlying Accessible objects. It's very outdated at this point, and I've been thinking of ripping it out. I just wonder if anyone at all is using it.