On Thu, 2006-09-28 at 16:47 +0800, Yan Tian wrote:
Hi all,
I have a question of _inbox.doAction('activate')_ in script of evolution
application.
In the 'Mail Folder Tree', expand the 'On this Computer' table cell,
there is 'Inbox' table cell. Expand the account_name table cell, there
is 'Inbox' table cell too. Code as below:
inbox = evo.findChildren(dogtail.predicate.GenericPredicate("Inbox",
roleName="table cell"), recursive=True)
I tried to handle the 'Inbox' table cell of account_name. But the
account_name, 'On this Computer', 'Inbox' of account_name, 'Inbox' of
'On this Computer' had the same ancestor 'Mail Folder Tree' table cell.
I used findAncerstor() method. But cann't find valuable roleName to
differentiate the two widget.
Did anyone meet with the same question and how to deal with it? Thanks.
I believe you can do the search in two stages, with something like this,
given accountName:
accountNode = evo.findChildren(dogtail.predicate.GenericPredicate(accountName, roleName="table cell"), recursive=True)
myAccountInbox = accountNode.findChildren(dogtail.predicate.GenericPredicate("Inbox", roleName="table cell"), recursive=True)
(note the different starting point for the second search)
onThisComputerNode = evo.findChildren(dogtail.predicate.GenericPredicate("On This Computer", roleName="table cell"), recursive=True)
onThisComputerInbox = onThisComputerNode.findChildren(dogtail.predicate.GenericPredicate("Inbox", roleName="table cell"), recursive=True)