Comment 1 for bug 1259327

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Hi Chris,

Thanks for your report. However, the AP documentation explicitly states that object ordering is not guaranteed. If you want your objects ordered in a particular way, you need to sort them based on some object attribute. The reason is simple: object are in a tree, and most (if not all?) UI toolkits don't guarantee an order between sibling widgets. If Qt and Gtk can't guarantee us a widget order, we can't provide that guarantee to our users.

At the same time, there are good reasons to order the object list by id: it makes several operations in autopilot itself much faster.

So, I'm not sure of the exact details of the problem you're having, but if you have a list of objects (as returned by select_many or children()) called 'my_list', you should be able to use the built-in python sorting methods to get it in the order you want.

I'm setting this to 'won't fix', since, at this point, changing this would complicate matters elsewhere, and it's explicitly documented that you can't rely on the order of returned objects.

Hit me up on IRC if you need any more information.

Cheers,