MCPcopy
hub / github.com/cluic/wxauto / _split

Method _split

wxauto/elements.py:28–63  ·  view source on GitHub ↗
(self, MsgItem)

Source from the content-addressed store, hash-verified

26 return WARNING[text][self.language]
27
28 def _split(self, MsgItem):
29 uia.SetGlobalSearchTimeout(0)
30 MsgItemName = MsgItem.Name
31 if MsgItem.BoundingRectangle.height() == WxParam.SYS_TEXT_HEIGHT:
32 Msg = ['SYS', MsgItemName, ''.join([str(i) for i in MsgItem.GetRuntimeId()])]
33 elif MsgItem.BoundingRectangle.height() == WxParam.TIME_TEXT_HEIGHT:
34 Msg = ['Time', MsgItemName, ''.join([str(i) for i in MsgItem.GetRuntimeId()])]
35 elif MsgItem.BoundingRectangle.height() == WxParam.RECALL_TEXT_HEIGHT:
36 if '撤回' in MsgItemName:
37 Msg = ['Recall', MsgItemName, ''.join([str(i) for i in MsgItem.GetRuntimeId()])]
38 else:
39 Msg = ['SYS', MsgItemName, ''.join([str(i) for i in MsgItem.GetRuntimeId()])]
40 else:
41 Index = 1
42 User = MsgItem.ButtonControl(foundIndex=Index)
43 try:
44 while True:
45 if User.Name == '':
46 Index += 1
47 User = MsgItem.ButtonControl(foundIndex=Index)
48 else:
49 break
50 winrect = MsgItem.BoundingRectangle
51 mid = (winrect.left + winrect.right)/2
52 if User.BoundingRectangle.left < mid:
53 if MsgItem.TextControl().Exists(0.1) and MsgItem.TextControl().BoundingRectangle.top < User.BoundingRectangle.top:
54 name = (User.Name, MsgItem.TextControl().Name)
55 else:
56 name = (User.Name, User.Name)
57 else:
58 name = 'Self'
59 Msg = [name, MsgItemName, ''.join([str(i) for i in MsgItem.GetRuntimeId()])]
60 except:
61 Msg = ['SYS', MsgItemName, ''.join([str(i) for i in MsgItem.GetRuntimeId()])]
62 uia.SetGlobalSearchTimeout(10.0)
63 return ParseMessage(Msg, MsgItem, self)
64
65 def _getmsgs(self, msgitems, savepic=False, savefile=False, savevoice=False):
66 msgs = []

Callers 1

_getmsgsMethod · 0.95

Calls 6

ParseMessageFunction · 0.85
heightMethod · 0.80
GetRuntimeIdMethod · 0.80
ButtonControlMethod · 0.80
ExistsMethod · 0.80
TextControlMethod · 0.80

Tested by

no test coverage detected