tdrpa.tdworker 1.2.13.9__py312-none-win_amd64.whl → 1.2.13.50__py312-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tdrpa/tdworker/__init__.pyi +2 -10
- tdrpa/tdworker/{_img.pyi → _other.pyi} +294 -0
- tdrpa/tdworker/_web.pyi +76 -229
- tdrpa/tdworker/_win.pyi +545 -0
- tdrpa/tdworker.cp312-win_amd64.pyd +0 -0
- {tdrpa_tdworker-1.2.13.9.dist-info → tdrpa_tdworker-1.2.13.50.dist-info}/METADATA +2 -2
- {tdrpa_tdworker-1.2.13.9.dist-info → tdrpa_tdworker-1.2.13.50.dist-info}/RECORD +9 -17
- tdrpa/tdworker/_clip.pyi +0 -50
- tdrpa/tdworker/_file.pyi +0 -77
- tdrpa/tdworker/_network.pyi +0 -94
- tdrpa/tdworker/_os.pyi +0 -47
- tdrpa/tdworker/_sp.pyi +0 -21
- tdrpa/tdworker/_w.pyi +0 -129
- tdrpa/tdworker/_winE.pyi +0 -228
- tdrpa/tdworker/_winK.pyi +0 -74
- tdrpa/tdworker/_winM.pyi +0 -117
- {tdrpa_tdworker-1.2.13.9.dist-info → tdrpa_tdworker-1.2.13.50.dist-info}/WHEEL +0 -0
- {tdrpa_tdworker-1.2.13.9.dist-info → tdrpa_tdworker-1.2.13.50.dist-info}/top_level.txt +0 -0
tdrpa/tdworker/_file.pyi
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
class INI:
|
2
|
-
@staticmethod
|
3
|
-
def Read(iniPath: str, sectionName: str, keyName: str, defaultValue: str = '', encoding: str = 'GBK') -> str:
|
4
|
-
"""
|
5
|
-
读键值
|
6
|
-
|
7
|
-
value = INI.Read('D:\\conf.ini','section1', 'key1', defaultValue='', encoding='GBK')
|
8
|
-
|
9
|
-
:param iniPath:[必选参数]INI 配置文件所在路径
|
10
|
-
:param sectionName:[必选参数]要访问 INI 配置文件的小节名字
|
11
|
-
:param keyName:[必选参数]要访问 INI 配置文件的键名
|
12
|
-
:param defaultValue:[可选参数]当 INI 配置文件键名不存在时,返回的默认内容。默认是空字符串
|
13
|
-
:param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
|
14
|
-
:return: 返回读取的值,字符串类型
|
15
|
-
"""
|
16
|
-
@staticmethod
|
17
|
-
def Write(iniPath: str, sectionName: str, keyName: str, value, encoding: str = 'GBK') -> None:
|
18
|
-
"""
|
19
|
-
写键值
|
20
|
-
|
21
|
-
INI.Write('D:\\conf.ini','section1', 'key1', 'value1', encoding='GBK')
|
22
|
-
|
23
|
-
:param iniPath:[必选参数]INI 配置文件所在路径
|
24
|
-
:param sectionName:[必选参数]要访问 INI 配置文件的小节名字
|
25
|
-
:param keyName:[必选参数]INI 文件中被写入的键值对中的键名,若为空字符串,则此键值对不被写入
|
26
|
-
:param value:[必选参数]INI 文件中被写入的键值对中的键值
|
27
|
-
:param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
|
28
|
-
:return: None
|
29
|
-
"""
|
30
|
-
@staticmethod
|
31
|
-
def EnumSection(iniPath: str, encoding: str = 'GBK') -> list:
|
32
|
-
"""
|
33
|
-
枚举小节
|
34
|
-
|
35
|
-
sections = INI.EnumSection('D:\\conf.ini', encoding='GBK')
|
36
|
-
|
37
|
-
:param iniPath:[必选参数]INI 配置文件所在路径
|
38
|
-
:param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
|
39
|
-
:return: 返回一个列表,列表中每个元素为一个section的名字
|
40
|
-
"""
|
41
|
-
@staticmethod
|
42
|
-
def EnumKey(iniPath: str, sectionName: str, encoding: str = 'GBK') -> list:
|
43
|
-
"""
|
44
|
-
枚举键
|
45
|
-
|
46
|
-
keys = INI.EnumKey('D:\\conf.ini', 'section1', encoding='GBK')
|
47
|
-
|
48
|
-
:param iniPath:[必选参数]INI 配置文件所在路径
|
49
|
-
:param sectionName:[必选参数]要访问 INI 配置文件的小节名字
|
50
|
-
:param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
|
51
|
-
:return: 返回一个列表,列表中每个元素为一个key的名字
|
52
|
-
"""
|
53
|
-
@staticmethod
|
54
|
-
def DeleteSection(iniPath: str, sectionName: str, encoding: str = 'GBK') -> None:
|
55
|
-
"""
|
56
|
-
删除小节
|
57
|
-
|
58
|
-
INI.DeleteSection('D:\\conf.ini','section1', encoding='GBK')
|
59
|
-
|
60
|
-
:param iniPath:[必选参数]INI 配置文件所在路径
|
61
|
-
:param sectionName:[必选参数]要访问 INI 配置文件的小节名字
|
62
|
-
:param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
|
63
|
-
:return: None
|
64
|
-
"""
|
65
|
-
@staticmethod
|
66
|
-
def DeleteKey(iniPath: str, sectionName: str, keyName: str, encoding: str = 'GBK'):
|
67
|
-
"""
|
68
|
-
删除键
|
69
|
-
|
70
|
-
INI.DeleteKey('D:\\conf.ini','section1', 'key1', encoding='GBK')
|
71
|
-
|
72
|
-
:param iniPath:[必选参数]INI 配置文件所在路径
|
73
|
-
:param sectionName:[必选参数]要访问 INI 配置文件的小节名字
|
74
|
-
:param keyName:[必选参数]要访问 INI 配置文件的键名
|
75
|
-
:param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
|
76
|
-
:return: None
|
77
|
-
"""
|
tdrpa/tdworker/_network.pyi
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
class Mail:
|
2
|
-
@staticmethod
|
3
|
-
def SendMail(user: str = '', pwd: str = '', sender: str = '', title: str = '', content: str = '', to: str | list = '', cc: str | list = None, attr: str | list = None, server: str = 'smtp.qq.com', port: int = 465, ssl: bool = True, timeout: int = 10, continueOnError: bool = False):
|
4
|
-
'''
|
5
|
-
发送邮件
|
6
|
-
|
7
|
-
Mail.SendMail(user=\'\', pwd=\'\', sender=\'\', title=\'\', content=\'\', to=\'\', cc=None, attr=None, server="smtp.qq.com", port=465, ssl=True, timeout=10, continueOnError=False)
|
8
|
-
|
9
|
-
:param user: [必选参数]邮箱登录帐号,比如普通QQ邮箱的登录帐号与邮箱地址相同
|
10
|
-
:param pwd: [必选参数]登录密码
|
11
|
-
:param sender: [必选参数]发件人邮箱地址
|
12
|
-
:param title: [必选参数]邮件的标题
|
13
|
-
:param content: [必选参数]邮件正文内容,支持HTML类型的正文内容
|
14
|
-
:param to: [必选参数]收件人邮箱地址,多个地址可用["xxx@qq.com","xxx@163.com"]列表的形式填写, 也可以是单个邮箱地址字符串
|
15
|
-
:param cc: [可选参数]抄送邮箱地址,多个地址可用["xxx@qq.com","xxx@163.com"]列表的形式填写, 也可以是单个邮箱地址字符串, None:不需要抄送,默认None
|
16
|
-
:param attr: [可选参数]邮件附件,多个附件可以用["附件一路径","附件二路径"]列表的形式填写,也可以是单个附件路径字符串, None:不需要附件,默认None
|
17
|
-
:param server: [可选参数]SMTP服务器地址,默认smtp.qq.com
|
18
|
-
:param port: [可选参数]SMTP服务器端口,常见为 25、465、587,默认465
|
19
|
-
:param ssl: [可选参数]是否使用SSL协议加密,True为使用,False为不使用,默认True
|
20
|
-
:param timeout: [可选参数]超时时间(秒),默认10
|
21
|
-
:param continueOnError: [可选参数]发生错误是否继续,True为继续,False为不继续。默认False
|
22
|
-
:return:None
|
23
|
-
'''
|
24
|
-
|
25
|
-
class HTTP:
|
26
|
-
@staticmethod
|
27
|
-
def SetCookies(cookies: dict = None) -> None:
|
28
|
-
'''
|
29
|
-
设置cookies
|
30
|
-
|
31
|
-
HTTP.SetCookies(None)
|
32
|
-
|
33
|
-
:param cookies:[可选参数]字典类型的cookies,例如:{"name":"value","name2":"value2"},默认None
|
34
|
-
:return:None
|
35
|
-
'''
|
36
|
-
@staticmethod
|
37
|
-
def SetHeaders(headers: dict = None) -> None:
|
38
|
-
'''
|
39
|
-
设置Headers
|
40
|
-
|
41
|
-
HTTP.SetHeaders(None)
|
42
|
-
|
43
|
-
:param headers:[可选参数]字典类型的请求头,例如:{"User-Agent": "Mozilla/5.0", "Accept-Language": "en-US"},默认None
|
44
|
-
:return:None
|
45
|
-
'''
|
46
|
-
@staticmethod
|
47
|
-
def Get(url: str, form: str | dict = None, delayTime: int = 60000) -> str:
|
48
|
-
'''
|
49
|
-
Get获取数据
|
50
|
-
|
51
|
-
text = HTTP.Get("", None, 60000)
|
52
|
-
|
53
|
-
:param url:[必选参数]Get页面的链接地址
|
54
|
-
:param form:[可选参数]Get时传递的表单数据,可以是字符串或字典,默认None
|
55
|
-
:param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
|
56
|
-
:return:获取的网络数据的结果
|
57
|
-
'''
|
58
|
-
@staticmethod
|
59
|
-
def Post(url: str, form: str | dict = None, delayTime: int = 60000) -> str:
|
60
|
-
'''
|
61
|
-
Post提交表单
|
62
|
-
|
63
|
-
text = HTTP.Post("", None, 60000)
|
64
|
-
|
65
|
-
:param url:[必选参数]Post页面的链接地址
|
66
|
-
:param form:[可选参数]Post时传递的表单数据,可以是字符串或字典,默认None
|
67
|
-
:param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
|
68
|
-
:return:向网页提交表单的结果
|
69
|
-
'''
|
70
|
-
@staticmethod
|
71
|
-
def PostJson(url: str, form: str | dict = None, delayTime: int = 60000) -> str:
|
72
|
-
'''
|
73
|
-
Post提交JSON表单
|
74
|
-
|
75
|
-
text = HTTP.PostJson("", None, 60000)
|
76
|
-
|
77
|
-
:param url:[必选参数]Post页面的链接地址
|
78
|
-
:param form:[可选参数]Post时传递的表单数据,可以是字符串或字典,默认None
|
79
|
-
:param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
|
80
|
-
:return:向网页提交JSON表单的结果
|
81
|
-
'''
|
82
|
-
@staticmethod
|
83
|
-
def GetFile(url: str, file: str, form: str | dict = None, delayTime: int = 60000) -> bool:
|
84
|
-
'''
|
85
|
-
Get下载文件
|
86
|
-
|
87
|
-
result = HTTP.GetFile("","",None,60000)
|
88
|
-
|
89
|
-
:param url:[必选参数]下载文件的链接地址
|
90
|
-
:param file:[必选参数]保存的文件路径
|
91
|
-
:param form:[可选参数]Get时传递的表单数据,可以是字符串或字典,默认None
|
92
|
-
:param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
|
93
|
-
:return:是否下载成功
|
94
|
-
'''
|
tdrpa/tdworker/_os.pyi
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
class App:
|
2
|
-
@staticmethod
|
3
|
-
def Kill(processName: str | int) -> bool:
|
4
|
-
"""
|
5
|
-
强制停止应用程序的运行(结束进程)
|
6
|
-
|
7
|
-
App.Kill('chrome.exe')
|
8
|
-
|
9
|
-
:param processName:[必选参数]应用程序进程名或进程PID,忽略大小写字母
|
10
|
-
:return:命令执行成功返回True,失败返回False
|
11
|
-
"""
|
12
|
-
@staticmethod
|
13
|
-
def GetStatus(processName: str | int, status: int = 0) -> bool:
|
14
|
-
"""
|
15
|
-
获取应用运行状态
|
16
|
-
|
17
|
-
App.GetStatus('chrome.exe', status=0)
|
18
|
-
|
19
|
-
:param processName:[必选参数]应用程序进程名或进程PID,忽略大小写字母
|
20
|
-
:param status:[可选参数]筛选进程状态。0:所有状态 1:运行 2:暂停 3:未响应 4:未知。默认0
|
21
|
-
:return:进程存在返回True,不存在返回False
|
22
|
-
"""
|
23
|
-
@staticmethod
|
24
|
-
def Run(exePath, waitType: int = 0, showType: int = 1, mode: int = 0):
|
25
|
-
"""
|
26
|
-
启动应用程序
|
27
|
-
|
28
|
-
App.Run('''C:\\Windows\\system32\\mspaint.exe''')
|
29
|
-
|
30
|
-
:param exePath:[必选参数]应用程序文件路径
|
31
|
-
:param waitType:[可选参数]0:不等待 1:等待应用程序准备好 2:等待应用程序执行到退出。默认0
|
32
|
-
:param showType:[可选参数]程序启动后的显示样式(不一定生效) 0:隐藏 1:默认 3:最大化 6:最小化
|
33
|
-
:param mode:[可选参数]启动模式,0:常规模式启动, 1:增强模式启动。当常规模式启动后无法拾取元素时,可尝试增强模式启动。默认0
|
34
|
-
:return:返回应用程序的PID
|
35
|
-
"""
|
36
|
-
@staticmethod
|
37
|
-
def WaitProcess(processName, waitType: str = 'open', delayTime: int = 30000) -> bool:
|
38
|
-
'''
|
39
|
-
等待应用启动或关闭
|
40
|
-
|
41
|
-
App.WaitProcess(\'chrome.exe\', waitType=\'open\', delayTime=30000)
|
42
|
-
|
43
|
-
:param processName:[必选参数]进程名称,忽略大小写字母。如:"chrome.exe"
|
44
|
-
:param waitType:[可选参数]期望应用状态。open:等待应用打开 close:等待应用关闭
|
45
|
-
:param delayTime:[可选参数]最大等待时间,默认30000毫秒(即30秒)
|
46
|
-
:return:等待时间内达到期望应用状态(开启/关闭)返回True,否则返回False
|
47
|
-
'''
|
tdrpa/tdworker/_sp.pyi
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
class PrintToScreen:
|
2
|
-
@staticmethod
|
3
|
-
def DrawText(msg: str = '', showSec: int = 0) -> None:
|
4
|
-
'''
|
5
|
-
绘制屏幕中央正上方显示的红字
|
6
|
-
|
7
|
-
PrintToScreen.DrawText(\'开始工作\', showSec=0)
|
8
|
-
|
9
|
-
:param msg:[可选参数]文字内容,默认为""
|
10
|
-
:param showSec:[可选参数]显示秒数。0:一直显示到程序结束,大于0:显示的时间,单位是秒
|
11
|
-
:return:无
|
12
|
-
'''
|
13
|
-
@staticmethod
|
14
|
-
def CleanText() -> None:
|
15
|
-
"""
|
16
|
-
清除屏幕中央正上方显示的红字
|
17
|
-
|
18
|
-
PrintToScreen.CleanText()
|
19
|
-
|
20
|
-
:return:无
|
21
|
-
"""
|
tdrpa/tdworker/_w.pyi
DELETED
@@ -1,129 +0,0 @@
|
|
1
|
-
import uiautomation as uia
|
2
|
-
|
3
|
-
class Window:
|
4
|
-
@staticmethod
|
5
|
-
def Close(target: str | uia.Control) -> None:
|
6
|
-
"""
|
7
|
-
关闭窗口
|
8
|
-
|
9
|
-
Window.Close(target)
|
10
|
-
|
11
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
12
|
-
:return: None
|
13
|
-
"""
|
14
|
-
@staticmethod
|
15
|
-
def GetActive(isReturnHwnd: bool = True) -> uia.Control | int:
|
16
|
-
"""
|
17
|
-
获取活动窗口
|
18
|
-
|
19
|
-
Window.GetActive(isReturnHwnd=True)
|
20
|
-
|
21
|
-
:param isReturnHwnd: [可选参数]是否返回窗口句柄,True时函数返回窗口句柄,False时返回窗口元素对象。默认True
|
22
|
-
:return:窗口句柄或者窗口元素对象
|
23
|
-
"""
|
24
|
-
@staticmethod
|
25
|
-
def SetActive(target: str | uia.Control) -> bool:
|
26
|
-
"""
|
27
|
-
设置活动窗口
|
28
|
-
|
29
|
-
Window.SetActive(target)
|
30
|
-
|
31
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
32
|
-
:return: bool。激活成功返回True,否则返回False
|
33
|
-
"""
|
34
|
-
@staticmethod
|
35
|
-
def Show(target: str | uia.Control, showStatus: str = 'show') -> bool:
|
36
|
-
'''
|
37
|
-
更改窗口显示状态
|
38
|
-
|
39
|
-
Window.Show(target, showStatus="show")
|
40
|
-
|
41
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
42
|
-
:param showStatus: [可选参数] 显示:\'show\' 隐藏:\'hide\' 最大化:\'max\' 最小化:\'min\' 还原:\'restore\'。默认\'show\'
|
43
|
-
:return: bool。执行成功返回True,否则返回False
|
44
|
-
'''
|
45
|
-
@staticmethod
|
46
|
-
def Exists(target: str | uia.WindowControl) -> bool:
|
47
|
-
"""
|
48
|
-
判断窗口是否存在
|
49
|
-
|
50
|
-
Window.Exists(target)
|
51
|
-
|
52
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象
|
53
|
-
:return: bool。窗口存在返回True,否则返回False
|
54
|
-
"""
|
55
|
-
@staticmethod
|
56
|
-
def GetSize(target: str | uia.Control) -> dict:
|
57
|
-
'''
|
58
|
-
获取窗口大小
|
59
|
-
|
60
|
-
Window.GetSize(target)
|
61
|
-
|
62
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
63
|
-
:return: {"height":int, "width":int, "x":int, "y":int}
|
64
|
-
'''
|
65
|
-
@staticmethod
|
66
|
-
def SetSize(target: str | uia.Control, width: int, height: int) -> None:
|
67
|
-
"""
|
68
|
-
改变窗口大小
|
69
|
-
|
70
|
-
Window.SetSize(target, 800, 600)
|
71
|
-
|
72
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
73
|
-
:param width: [必选参数]窗口宽度
|
74
|
-
:param height: [必选参数]窗口高度
|
75
|
-
:return: None
|
76
|
-
"""
|
77
|
-
@staticmethod
|
78
|
-
def Move(target: str | uia.Control, x: int, y: int) -> None:
|
79
|
-
"""
|
80
|
-
移动窗口位置
|
81
|
-
|
82
|
-
Window.Move(target, 0, 0)
|
83
|
-
|
84
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
85
|
-
:param x: [必选参数]移动到新位置的横坐标
|
86
|
-
:param y: [必选参数]移动到新位置的纵坐标
|
87
|
-
:return: None
|
88
|
-
"""
|
89
|
-
@staticmethod
|
90
|
-
def TopMost(target: str | uia.Control, isTopMost: bool = True) -> bool:
|
91
|
-
"""
|
92
|
-
窗口置顶
|
93
|
-
|
94
|
-
Window.TopMost(target, isTopMost=True)
|
95
|
-
|
96
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
97
|
-
:param isTopMost: [可选参数]是否使窗口置顶,窗口置顶:true 窗口取消置顶:false。默认True
|
98
|
-
:return: bool值,设置成功返回True,否则返回False
|
99
|
-
"""
|
100
|
-
@staticmethod
|
101
|
-
def GetClass(target: str | uia.Control) -> str:
|
102
|
-
"""
|
103
|
-
获取窗口类名
|
104
|
-
|
105
|
-
Window.GetClass(target)
|
106
|
-
|
107
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
108
|
-
:return: 窗口的类名称
|
109
|
-
"""
|
110
|
-
@staticmethod
|
111
|
-
def GetPath(target: str | uia.Control) -> str:
|
112
|
-
"""
|
113
|
-
获取窗口程序的文件路径
|
114
|
-
|
115
|
-
Window.GetPath(target)
|
116
|
-
|
117
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
118
|
-
:return: 文件绝对路径
|
119
|
-
"""
|
120
|
-
@staticmethod
|
121
|
-
def GetPID(target: str | uia.Control) -> int:
|
122
|
-
"""
|
123
|
-
获取进程PID
|
124
|
-
|
125
|
-
Window.GetPID(target)
|
126
|
-
|
127
|
-
:param target: [必选参数]tdRPA拾取器获取的目标窗口元素特征字符串或uia目标窗口元素对象,也可选取窗口内始终存在的元素。
|
128
|
-
:return: PID
|
129
|
-
"""
|
tdrpa/tdworker/_winE.pyi
DELETED
@@ -1,228 +0,0 @@
|
|
1
|
-
import uiautomation as uia
|
2
|
-
|
3
|
-
class WinElement:
|
4
|
-
@staticmethod
|
5
|
-
def FindElementByTd(tdTargetStr: str = None, anchorsElement: uia.Control = None, searchDelay: int = 10000, continueOnError: bool = False):
|
6
|
-
"""
|
7
|
-
依据tdrpa拾取器获取的元素特征码查找元素
|
8
|
-
|
9
|
-
WinElement.FindElementByTd('', anchorsElement=None, searchDelay=10000, continueOnError=False)
|
10
|
-
|
11
|
-
:param tdTargetStr: 目标元素特征码(tdrpa拾取器获取)
|
12
|
-
:param anchorsElement: 从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
13
|
-
:param searchDelay: 查找延时(豪秒)。默认10000
|
14
|
-
:param continueOnError: 错误继续执行。默认False
|
15
|
-
:return: 目标元素 or None
|
16
|
-
"""
|
17
|
-
@staticmethod
|
18
|
-
def GetChildren(target: str | uia.Control, searchType: str = 'all', searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> list | uia.Control:
|
19
|
-
'''
|
20
|
-
获取子元素
|
21
|
-
|
22
|
-
WinElement.GetChildren(target, searchType=\'all\', searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
23
|
-
|
24
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
25
|
-
:param searchType: [可选参数]搜索方式。全部子元素:"all" 首个子元素:"first" 最后一个子元素:"last"。默认"all"
|
26
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
27
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
28
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
29
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
30
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
31
|
-
:return: 目标元素对象的子元素列表 或 首个子元素 或 最后一个子元素
|
32
|
-
'''
|
33
|
-
@staticmethod
|
34
|
-
def GetParent(target: str | uia.Control, upLevels: int = 1, searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> uia.Control:
|
35
|
-
"""
|
36
|
-
获取父元素
|
37
|
-
|
38
|
-
WinElement.GetParent(target, upLevels=1, searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
39
|
-
|
40
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
41
|
-
:param upLevels: [可选参数]父元素层级,1为父元素,2为祖父元素,3为曾祖父元素,以此类推,0为当前元素的顶层窗口元素。默认1
|
42
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
43
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
44
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
45
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
46
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
47
|
-
:return: 目标元素对象的上一层父级元素 或 顶层父级元素
|
48
|
-
"""
|
49
|
-
@staticmethod
|
50
|
-
def GetSibling(target: str | uia.Control, position: str = 'next', searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> uia.Control | None:
|
51
|
-
'''
|
52
|
-
获取相邻元素
|
53
|
-
|
54
|
-
WinElement.GetSibling(target, position="next", searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
55
|
-
|
56
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
57
|
-
:param position: [可选参数]相邻位置。下一个:"next" 上一个:"previous"。默认"next"
|
58
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
59
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
60
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
61
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
62
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
63
|
-
:return: 目标元素对象的下一个相邻元素对象 或 上一个相邻元素对象,没有返回None
|
64
|
-
'''
|
65
|
-
@staticmethod
|
66
|
-
def Exists(target: str | uia.Control, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> bool:
|
67
|
-
"""
|
68
|
-
判断元素是否存在
|
69
|
-
|
70
|
-
WinElement.Exists(target, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
71
|
-
|
72
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
73
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
74
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
75
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
76
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
77
|
-
:return: bool
|
78
|
-
"""
|
79
|
-
@staticmethod
|
80
|
-
def GetCheck(target: str | uia.Control, searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> bool:
|
81
|
-
"""
|
82
|
-
获取元素勾选
|
83
|
-
|
84
|
-
WinElement.GetCheck(target, searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
85
|
-
|
86
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
87
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
88
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
89
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
90
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
91
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
92
|
-
:return: bool
|
93
|
-
"""
|
94
|
-
@staticmethod
|
95
|
-
def SetCheck(target: str | uia.Control, isCheck: bool = True, searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> bool:
|
96
|
-
"""
|
97
|
-
设置元素勾选
|
98
|
-
|
99
|
-
WinElement.SetCheck(target, isCheck=True, searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
100
|
-
|
101
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
102
|
-
:param isCheck: [可选参数]设置勾选:True 设置取消勾选:False。默认True
|
103
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
104
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
105
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
106
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
107
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
108
|
-
:return: 执行成功返回True,执行失败返回False
|
109
|
-
"""
|
110
|
-
@staticmethod
|
111
|
-
def GetSelect(target: str | uia.Control, mode: str = 'text', searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> str | int:
|
112
|
-
'''
|
113
|
-
获取元素选择
|
114
|
-
|
115
|
-
WinElement.GetSelect(target, mode=\'text\', searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
116
|
-
|
117
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
118
|
-
:param mode: [可选参数]获取文本:"text" 获取序号:“index” 获取值:“value”。默认"text"
|
119
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
120
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
121
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
122
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
123
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
124
|
-
:return: 已选项的文本 或 序号 或 值,没有则返回None
|
125
|
-
'''
|
126
|
-
@staticmethod
|
127
|
-
def SetSelect(target: str | uia.Control, option: str | int, mode: str = 'text', searchDelay: int = 10000, anchorsElement: uia.Control = None, setForeground: bool = True, cursorPosition: str = 'center', cursorOffsetX: int = 0, cursorOffsetY: int = 0, simulateType: str = 'simulate', continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> None:
|
128
|
-
'''
|
129
|
-
设置元素选择
|
130
|
-
|
131
|
-
WinElement.SetSelect(target, \'\', mode="text", searchDelay=10000, anchorsElement=None, setForeground=True, cursorPosition=\'center\', cursorOffsetX=0, cursorOffsetY=0, simulateType=\'simulate\', continueOnError=False, delayAfter=100, delayBefore=100)
|
132
|
-
|
133
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
134
|
-
:param option: [必选参数]选择选项的文本或者序号
|
135
|
-
:param mode: [可选参数]选择文本:"text" 选择序号:“index” 选择值:“value”。默认"text"
|
136
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
137
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
138
|
-
:param setForeground: [可选参数]激活窗口。默认True
|
139
|
-
:param cursorPosition: [可选参数]光标在选中项的位置。中心:"center" 左上角:"topLeft" 右上角:"topRight" 左下角:"bottomLeft" 右下角:"bottomRight"。默认"center"
|
140
|
-
:param cursorOffsetX: [可选参数]横坐标偏移。默认0
|
141
|
-
:param cursorOffsetY: [可选参数]纵坐标偏移。默认0
|
142
|
-
:param simulateType: [可选参数]鼠标点击选中项时的模式。模拟操作:"simulate" 消息操作:"message"。默认"simulate"
|
143
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
144
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
145
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
146
|
-
:return: None
|
147
|
-
'''
|
148
|
-
@staticmethod
|
149
|
-
def GetValue(target: str | uia.Control, getMethod: str = 'auto', searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> str:
|
150
|
-
'''
|
151
|
-
获取元素文本
|
152
|
-
|
153
|
-
WinElement.GetValue(target, getMethod="auto", searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
154
|
-
|
155
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
156
|
-
:param getMethod: [可选参数]获取方式。自动方式:"auto" 获得元素Name方式:"name" 获得元素Value方式:"value" 获得元素Text方式:"text"。默认"auto"
|
157
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
158
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
159
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
160
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
161
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
162
|
-
:return: 元素文本
|
163
|
-
'''
|
164
|
-
@staticmethod
|
165
|
-
def SetValue(target: str | uia.Control, value: str, searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> None:
|
166
|
-
'''
|
167
|
-
设置元素文本
|
168
|
-
|
169
|
-
WinElement.SetValue(target, "", searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
170
|
-
|
171
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
172
|
-
:param value: [必选参数]要写入元素的文本内容
|
173
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
174
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
175
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
176
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
177
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
178
|
-
:return: None
|
179
|
-
'''
|
180
|
-
@staticmethod
|
181
|
-
def GetRect(target: str | uia.Control, relativeType: str = 'parent', searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> dict:
|
182
|
-
'''
|
183
|
-
获取元素区域
|
184
|
-
|
185
|
-
WinElement.GetRect(target, relativeType="parent", searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
186
|
-
|
187
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
188
|
-
:param relativeType: [可选参数]返回元素位置是相对于哪一个坐标而言的。 相对父元素:"parent" 相对窗口客户区:"root" 相对屏幕坐标:"screen"。默认"parent"
|
189
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
190
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
191
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
192
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
193
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
194
|
-
:return: {"height" : int, "width" : int, "x" : int, "y" : int}
|
195
|
-
'''
|
196
|
-
@staticmethod
|
197
|
-
def ScreenCapture(target: str | uia.Control, filePath: str, rect: dict = None, searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> bool:
|
198
|
-
'''
|
199
|
-
元素截图
|
200
|
-
|
201
|
-
WinElement.ScreenCapture(target, \'D:/1.png\', rect=None, searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
202
|
-
|
203
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
204
|
-
:param filePath: [必选参数]图片存储的绝对路径。如 \'D:/1.png\'(支持图片保存格式:bmp、jpg、jpeg、png、gif、tif、tiff)
|
205
|
-
:param rect: [可选参数]对指定界面元素截图的范围,若传None,则截取该元素的全区域。若传{"x":int,"y":int,"width":int,"height":int},则以该元素左上角位置偏移x,y的坐标为原点,根据高宽进行截图。默认None
|
206
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
207
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
208
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
209
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
210
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
211
|
-
:return: bool(截图成功返回True,否则返回假)
|
212
|
-
'''
|
213
|
-
@staticmethod
|
214
|
-
def Wait(target: str | uia.Control, waitType: str = 'show', searchDelay: int = 10000, anchorsElement: uia.Control = None, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100) -> None:
|
215
|
-
'''
|
216
|
-
等待元素(等待元素显示或消失)
|
217
|
-
|
218
|
-
WinElement.Wait(target, waitType=\'show\', searchDelay=10000, anchorsElement=None, continueOnError=False, delayAfter=100, delayBefore=100)
|
219
|
-
|
220
|
-
:param target: [必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
|
221
|
-
:param waitType: [可选参数]等待方式。 等待显示:"show" 等待消失:"hide"。默认"show"
|
222
|
-
:param searchDelay: [可选参数]超时时间(毫秒)。默认10000
|
223
|
-
:param anchorsElement: [可选参数]锚点元素,从它开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
|
224
|
-
:param continueOnError: [可选参数]错误继续执行。默认False
|
225
|
-
:param delayAfter: [可选参数]执行后延时(毫秒)。默认100
|
226
|
-
:param delayBefore: [可选参数]执行前延时(毫秒)。默认100
|
227
|
-
:return: None
|
228
|
-
'''
|