GNOME Bugzilla – Bug 752928
pyatspi2's Text.getDefaultAttributeSet() calls non-existent Atspi.Text.get_default_attribute_set()
Last modified: 2019-03-27 20:11:03 UTC
Pyatspi.Text.getDefaultAttributeSet() calls Atspi.Text.get_default_attribute_set(self.obj) (See: https://git.gnome.org/browse/pyatspi2/tree/pyatspi/text.py#n301) But Atspi.Text.get_default_attribute_set() does not seem to exist: https://git.gnome.org/browse/at-spi2-core/tree/atspi/atspi-text.c There is an atspi_text_get_default_attributes() which is called by the deprecated pyatspi.Text.getDefaultAttributes().
I don't remember for sure why getDefaultAttributes is listed as deprecated. It seems that I added that comment during an unrelated refactor. However, the C function (atspi_text_get_default_attributes) returns a GHashTable, corresponding to the dictionary that is returned over D-Bus. The pyatspi getDefaultAttributes function returns an array of string=value strings for historical reasons, but we thought that a dictionary was the natural type to use when creating the spec for the D-Bus interface, for this function and similar GetAttributes functions. Anyway, I'm thinking that getDefaultAttributeSet to be repurposed to call atspi_text_get_default_attributes but return a dictionary, rather than converting it to an array of string+value pairs. Does this make sense to you?
Makes sense to me. First thing I do with the arrays is convert them to dictionaries. ;)
Fix pushed to master as commit 3b0d34.