When using the select() function, the provided path cannot necessarily be used for a subsequent select() (or getattr(), etc) and will not properly select any items.
This appears to arise because the XPATH index syntax is slightly different than the path_to syntax use different semantics.
Specifically, the current to_path syntax uses the index of the element in the child widgets list.
|
def path_to(widget): |
|
from kivy.core.window import Window |
|
root = Window |
|
if widget.parent is root or widget.parent == widget or not widget.parent: |
|
return "/{}".format(widget.__class__.__name__) |
|
return "{}/{}[{}]".format( |
|
path_to(widget.parent), widget.__class__.__name__, |
|
widget.parent.children.index(widget)) |
However, the XPATH syntax uses the index into the list of previously filtered items. This means that if any items are filtered out, the index used by XPATH and the index into the Kivy child list are no longer equivalent.
When using the
select()function, the provided path cannot necessarily be used for a subsequentselect()(orgetattr(), etc) and will not properly select any items.This appears to arise because the XPATH index syntax is slightly different than the
path_tosyntax use different semantics.Specifically, the current
to_pathsyntax uses the index of the element in the child widgets list.telenium/telenium/mods/telenium_client.py
Lines 107 to 114 in 52e30ba
However, the XPATH syntax uses the index into the list of previously filtered items. This means that if any items are filtered out, the index used by XPATH and the index into the Kivy child list are no longer equivalent.