获取好友列表
(self)
| 611 | self.ContactBox.SendKeys(keyword) |
| 612 | |
| 613 | def GetAllFriends(self): |
| 614 | """获取好友列表""" |
| 615 | wxlog.debug("获取好友列表") |
| 616 | self._show() |
| 617 | contacts_list = [] |
| 618 | while True: |
| 619 | contact_ele_list = self.ContactBox.ListControl().GetChildren() |
| 620 | for ele in contact_ele_list: |
| 621 | contacts_info = { |
| 622 | 'nickname': ele.TextControl().Name, |
| 623 | 'remark': ele.ButtonControl(foundIndex=2).Name, |
| 624 | 'tags': ele.ButtonControl(foundIndex=3).Name.split(','), |
| 625 | } |
| 626 | if contacts_info.get('remark') in ('添加备注', ''): |
| 627 | contacts_info['remark'] = None |
| 628 | if contacts_info.get('tags') in (['添加标签'], ['']): |
| 629 | contacts_info['tags'] = None |
| 630 | if contacts_info not in contacts_list: |
| 631 | contacts_list.append(contacts_info) |
| 632 | bottom = self.ContactBox.ListControl().GetChildren()[-1].BoundingRectangle.top |
| 633 | self.ContactBox.WheelDown(wheelTimes=5, waitTime=0.1) |
| 634 | if bottom == self.ContactBox.ListControl().GetChildren()[-1].BoundingRectangle.top: |
| 635 | return contacts_list |
| 636 | |
| 637 | def Close(self): |
| 638 | """关闭联系人窗口""" |
no test coverage detected