tdrpa.tdworker 1.2.13.61__py312-none-win_amd64.whl → 1.2.13.63__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.
@@ -1,4 +1,4 @@
1
1
  from ._excel import Excel as Excel
2
- from ._other import App as App, Clipboard as Clipboard, HTTP as HTTP, INI as INI, Image as Image, Mail as Mail, PrintToScreen as PrintToScreen
2
+ from ._other import App as App, Clipboard as Clipboard, Dialog as Dialog, HTTP as HTTP, INI as INI, Image as Image, Mail as Mail, PrintToScreen as PrintToScreen, retry as retry
3
3
  from ._web import Web as Web, WebPW as WebPW
4
4
  from ._win import WinElement as WinElement, WinKeyboard as WinKeyboard, WinMouse as WinMouse, Window as Window
tdrpa/tdworker/_other.pyi CHANGED
@@ -1,5 +1,4 @@
1
1
  import uiautomation as uia
2
- from _typeshed import Incomplete
3
2
 
4
3
  class Clipboard:
5
4
  @staticmethod
@@ -13,49 +12,49 @@ class Clipboard:
13
12
  """
14
13
  @staticmethod
15
14
  def SaveImage(savePath: str):
16
- '''
15
+ """
17
16
  保存剪贴板图像
18
17
 
19
18
  Clipboard.SaveImage(savePath)
20
19
 
21
20
  :param savePath:[必选参数]要将剪贴板的图像保存到的文件路径,如"D:\\1.png"
22
21
  :return:图像保存成功返回True,保存失败返回False
23
- '''
22
+ """
24
23
  @staticmethod
25
24
  def SetFile(paths: str | list):
26
- '''
25
+ """
27
26
  文件设置到剪贴板
28
27
 
29
28
  Clipboard.SetFile(paths)
30
29
 
31
30
  :param paths:[必选参数]文件的路径,单个文件用字符串类型,如"D:\x01.txt",多个文件用 list 类型,其中每个元素用字符串,如["D:\x01.txt", "D:\x01.png"]
32
31
  :return:成功返回True,失败返回False
33
- '''
32
+ """
34
33
  @staticmethod
35
34
  def SetImage(picPath):
36
- '''
35
+ """
37
36
  图片设置到剪贴板
38
37
 
39
38
  Clipboard.SetImage(picPath)
40
39
 
41
40
  :param picPath:[必选参数]要放入剪贴板的图片路径,如"D:\\1.png"
42
41
  :return:成功返回True,失败返回False
43
- '''
42
+ """
44
43
  @staticmethod
45
44
  def SetText(content: str = ''):
46
- '''
45
+ """
47
46
  设置剪贴板文本
48
47
 
49
48
  Clipboard.SetText(\'\')
50
49
 
51
50
  :param content:[必选参数]新的剪贴板文本内容,默认""
52
51
  :return:成功返回True,失败返回False
53
- '''
52
+ """
54
53
 
55
54
  class PrintToScreen:
56
55
  @staticmethod
57
56
  def DrawText(msg: str = '', showSec: int = 0) -> None:
58
- '''
57
+ """
59
58
  绘制屏幕中央正上方显示的红字
60
59
 
61
60
  PrintToScreen.DrawText(\'开始工作\', showSec=0)
@@ -63,7 +62,7 @@ class PrintToScreen:
63
62
  :param msg:[可选参数]文字内容,默认为""
64
63
  :param showSec:[可选参数]显示秒数。0:一直显示到程序结束,大于0:显示的时间,单位是秒
65
64
  :return:无
66
- '''
65
+ """
67
66
  @staticmethod
68
67
  def CleanText() -> None:
69
68
  """
@@ -74,10 +73,95 @@ class PrintToScreen:
74
73
  :return:无
75
74
  """
76
75
 
76
+ class Dialog:
77
+ @staticmethod
78
+ def Notify(title: str, message: str) -> None:
79
+ """
80
+ 显示通知弹框
81
+
82
+ Dialog.Notify('提示', '这是一个消息框')
83
+
84
+ :param title:[必选参数]弹框标题
85
+ :param message:[必选参数]弹框内容
86
+ :return: 无
87
+ """
88
+ @staticmethod
89
+ def InputBox(title: str, prompt: str, default: str = '') -> str | None:
90
+ """
91
+ 弹出输入对话框,返回用户在对话框中输入的内容
92
+
93
+ Dialog.InputBox('输入', '请输入内容:', '你好')
94
+
95
+ :param title:[必选参数]弹框标题
96
+ :param prompt:[必选参数]弹框内容
97
+ :param default:[可选参数]输入框默认文本
98
+ :return: 点确定按钮,返回用户输入的内容,点取消或关闭返回None
99
+ """
100
+ @staticmethod
101
+ def PasswordBox(title: str, prompt: str) -> str | None:
102
+ """
103
+ 弹出密码输入对话框,返回用户在对话框中输入的内容
104
+
105
+ Dialog.PasswordBox('密码输入', '请输入密码:')
106
+
107
+ :param title:[必选参数]弹框标题
108
+ :param prompt:[必选参数]弹框内容
109
+ :return: 点确定按钮,返回用户输入的密码,点取消或关闭返回None
110
+ """
111
+ @staticmethod
112
+ def IntBox(title: str, prompt: str, default: str = '', minvalue: int = None, maxvalue: int = None, error_message: str = '请输入一个有效的整数!') -> int | None:
113
+ """
114
+ 弹出整数输入对话框,返回用户在对话框中输入的整数
115
+
116
+ Dialog.IntBox('输入', '请输入整数:', '100')
117
+
118
+ :param title:[必选参数]弹框标题
119
+ :param prompt:[必选参数]弹框内容
120
+ :param default:[可选参数]输入框默认文本
121
+ :param minvalue:[可选参数]最小值,默认None
122
+ :param maxvalue:[可选参数]最大值,默认None
123
+ :param error_message:[可选参数]输入非整数时提示的消息
124
+ :return: 点确定按钮,返回用户输入的整数,点取消或关闭返回None
125
+ """
126
+ @staticmethod
127
+ def YnBox(title: str, message: str) -> bool:
128
+ """
129
+ 弹出确认对话框,返回用户的确认结果
130
+
131
+ Dialog.YnBox('确认', '是否确认?')
132
+
133
+ :param title:[必选参数]弹框标题
134
+ :param message:[必选参数]弹框内容
135
+ :return: 点是返回True,点否或关闭返回False
136
+ """
137
+ @staticmethod
138
+ def MultenterBox(title: str, prompts: list) -> dict:
139
+ """
140
+ 弹出多行输入对话框,返回用户在对话框中输入的内容
141
+
142
+ Dialog.MultenterBox('输入', ['请输入姓名:', '请输入年龄:'])
143
+
144
+ :param title:[必选参数]弹框标题
145
+ :param prompts:[必选参数]弹框内容,例如['请输入姓名:', '请输入年龄:']
146
+ :return: 点确定按钮,返回用户输入的内容,格式为字典,键为字段内容,值为用户输入的内容,关闭返回{}
147
+ """
148
+ @staticmethod
149
+ def MultchoiceBox(title: str, prompt: str, choices: list) -> list:
150
+ """
151
+ 弹出多选框,返回用户选择的内容
152
+
153
+ Dialog.MultchoiceBox('选择', '请选择:', ['选项1', '选项2'])
154
+
155
+ :param title:[必选参数]弹框标题
156
+ :param prompt:[必选参数]弹框内容
157
+ :param choices:[必选参数]选项内容,例如['选项1', '选项2']
158
+ :return: 点确定按钮,返回用户选择的内容,格式为列表,关闭返回[]
159
+ """
160
+
77
161
  class INI:
78
162
  @staticmethod
79
163
  def Read(iniPath: str, sectionName: str, keyName: str, defaultValue: str = '', encoding: str = 'GBK') -> str:
80
- '''
164
+ """
81
165
  读键值
82
166
 
83
167
  value = INI.Read(\'D:\\conf.ini\',\'section1\', \'key1\', defaultValue=\'\', encoding=\'GBK\')
@@ -88,10 +172,10 @@ class INI:
88
172
  :param defaultValue:[可选参数]当 INI 配置文件键名不存在时,返回的默认内容。默认是空字符串
89
173
  :param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
90
174
  :return: 返回读取的值,字符串类型
91
- '''
175
+ """
92
176
  @staticmethod
93
177
  def Write(iniPath: str, sectionName: str, keyName: str, value, encoding: str = 'GBK') -> None:
94
- '''
178
+ """
95
179
  写键值
96
180
 
97
181
  INI.Write(\'D:\\conf.ini\',\'section1\', \'key1\', \'value1\', encoding=\'GBK\')
@@ -102,10 +186,10 @@ class INI:
102
186
  :param value:[必选参数]INI 文件中被写入的键值对中的键值
103
187
  :param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
104
188
  :return: None
105
- '''
189
+ """
106
190
  @staticmethod
107
191
  def EnumSection(iniPath: str, encoding: str = 'GBK') -> list:
108
- '''
192
+ """
109
193
  枚举小节
110
194
 
111
195
  sections = INI.EnumSection(\'D:\\conf.ini\', encoding=\'GBK\')
@@ -113,10 +197,10 @@ class INI:
113
197
  :param iniPath:[必选参数]INI 配置文件所在路径
114
198
  :param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
115
199
  :return: 返回一个列表,列表中每个元素为一个section的名字
116
- '''
200
+ """
117
201
  @staticmethod
118
202
  def EnumKey(iniPath: str, sectionName: str, encoding: str = 'GBK') -> list:
119
- '''
203
+ """
120
204
  枚举键
121
205
 
122
206
  keys = INI.EnumKey(\'D:\\conf.ini\', \'section1\', encoding=\'GBK\')
@@ -125,10 +209,10 @@ class INI:
125
209
  :param sectionName:[必选参数]要访问 INI 配置文件的小节名字
126
210
  :param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
127
211
  :return: 返回一个列表,列表中每个元素为一个key的名字
128
- '''
212
+ """
129
213
  @staticmethod
130
214
  def DeleteSection(iniPath: str, sectionName: str, encoding: str = 'GBK') -> None:
131
- '''
215
+ """
132
216
  删除小节
133
217
 
134
218
  INI.DeleteSection(\'D:\\conf.ini\',\'section1\', encoding=\'GBK\')
@@ -137,10 +221,10 @@ class INI:
137
221
  :param sectionName:[必选参数]要访问 INI 配置文件的小节名字
138
222
  :param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
139
223
  :return: None
140
- '''
224
+ """
141
225
  @staticmethod
142
- def DeleteKey(iniPath: str, sectionName: str, keyName: str, encoding: str = 'GBK'):
143
- '''
226
+ def DeleteKey(iniPath: str, sectionName: str, keyName: str, encoding: str = 'GBK') -> None:
227
+ """
144
228
  删除键
145
229
 
146
230
  INI.DeleteKey(\'D:\\conf.ini\',\'section1\', \'key1\', encoding=\'GBK\')
@@ -150,7 +234,7 @@ class INI:
150
234
  :param keyName:[必选参数]要访问 INI 配置文件的键名
151
235
  :param encoding:[可选参数]文件编码,常用"GBK", "UTF8"等。默认 GBK
152
236
  :return: None
153
- '''
237
+ """
154
238
 
155
239
  class App:
156
240
  @staticmethod
@@ -179,7 +263,7 @@ class App:
179
263
  """
180
264
  启动应用程序
181
265
 
182
- App.Run('''C:\\Windows\\system32\\mspaint.exe''')
266
+ App.Run("C:\\Windows\\system32\\mspaint.exe")
183
267
 
184
268
  :param exePath:[必选参数]应用程序文件路径
185
269
  :param waitType:[可选参数]0:不等待 1:等待应用程序准备好 2:等待应用程序执行到退出。默认0
@@ -189,7 +273,7 @@ class App:
189
273
  """
190
274
  @staticmethod
191
275
  def WaitProcess(processName, waitType: str = 'open', delayTime: int = 30000) -> bool:
192
- '''
276
+ """
193
277
  等待应用启动或关闭
194
278
 
195
279
  App.WaitProcess(\'chrome.exe\', waitType=\'open\', delayTime=30000)
@@ -198,12 +282,12 @@ class App:
198
282
  :param waitType:[可选参数]期望应用状态。open:等待应用打开 close:等待应用关闭
199
283
  :param delayTime:[可选参数]最大等待时间,默认30000毫秒(即30秒)
200
284
  :return:等待时间内达到期望应用状态(开启/关闭)返回True,否则返回False
201
- '''
285
+ """
202
286
 
203
287
  class Image:
204
288
  @staticmethod
205
289
  def Exists(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: float = 0.9, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, matchType: str = 'GrayMatch', backgroundPic: bool = False) -> bool:
206
- '''
290
+ """
207
291
  判断图像是否存在
208
292
 
209
293
  Image.Exists(\'d:\\test.jpg\', target, anchorsElement=None, rect=None, accuracy=0.9, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, matchType=\'GrayMatch\', backgroundPic=False)
@@ -221,13 +305,13 @@ class Image:
221
305
  :param matchType:[可选参数]指定查找图像的匹配方式,\'GrayMatch\':“灰度匹配”速度快,但在极端情况下可能会匹配失败,\'ColorMatch\':“彩色匹配”相对“灰度匹配”更精准但匹配速度稍慢。默认\'GrayMatch\'
222
306
  :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
223
307
  :return:存在返回True,不存在返回False
224
- '''
308
+ """
225
309
  @staticmethod
226
- def Find(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: int | float = 0.9, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, matchType: str = 'GrayMatch', backgroundPic: bool = False, iSerialNo: int = 0, returnPosition: str = 'center') -> dict | list | None:
227
- '''
310
+ def FindPic(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: int | float = 0.9, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, matchType: str = 'GrayMatch', backgroundPic: bool = False, iSerialNo: int = 0, returnPosition: str = 'center') -> dict | list | None:
311
+ """
228
312
  查找图像
229
313
 
230
- Image.Find(\'d:\\test.jpg\', target, anchorsElement=None, rect=None, accuracy=0.9, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, matchType=\'GrayMatch\', backgroundPic=False, iSerialNo=0, returnPosition="center")
314
+ Image.FindPic(\'d:\\test.jpg\', target, anchorsElement=None, rect=None, accuracy=0.9, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, matchType=\'GrayMatch\', backgroundPic=False, iSerialNo=0, returnPosition="center")
231
315
 
232
316
  :param imagePath:[必选参数]要查找的图片路径
233
317
  :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
@@ -244,10 +328,10 @@ class Image:
244
328
  :param iSerialNo:[可选参数]指定图像匹配到多个目标时的序号,序号为从1开始的正整数,在屏幕上从左到右从上到下依次递增,匹配到最靠近屏幕左上角的目标序号为1,如果是0,返回所有匹配图像的坐标。默认为0
245
329
  :param returnPosition:[可选参数]\'center\':返回图片中心坐标,\'topLeft\':返回图片左上角坐标,\'topRight\':返回图片右上角坐标,\'bottomLeft\':返回图片左下角坐标,\'bottomRight\':返回图片右下角坐标。默认\'center\'
246
330
  :return:返回图像的坐标,iSerialNo为0时,返回list,如[{\'x\':100, \'y\':100}, {\'x\':300,\'y\':300}],iSerialNo大于0时,返回dict,如{\'x\':100, \'y\':100},匹配不到时返回None
247
- '''
331
+ """
248
332
  @staticmethod
249
- def Click(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: float = 0.9, button: str = 'left', clickType: str = 'click', searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100, setForeground: bool = True, cursorPosition: str = 'center', cursorOffsetX: int = 0, cursorOffsetY: int = 0, keyModifiers: list = None, simulateType: str = 'simulate', moveSmoothly: bool = False, matchType: str = 'GrayMatch', backgroundPic: bool = False, iSerialNo: int = 1):
250
- '''
333
+ def Click(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: float = 0.9, button: str = 'left', clickType: str = 'click', searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100, setForeground: bool = True, cursorPosition: str = 'center', cursorOffsetX: int = 0, cursorOffsetY: int = 0, keyModifiers: list = None, simulateType: str = 'simulate', moveSmoothly: bool = False, matchType: str = 'GrayMatch', backgroundPic: bool = False, iSerialNo: int = 1) -> None:
334
+ """
251
335
  点击图像
252
336
 
253
337
  Image.Click(\'d:\\test.jpg\', target, anchorsElement=None, rect=None, accuracy=0.9, button=\'left\', clickType=\'click\', searchDelay=10000, continueOnError=False, delayAfter=100, delayBefore=100,
@@ -275,10 +359,10 @@ class Image:
275
359
  :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。注意:当simulateType为message时,该字段设置为True才会生效
276
360
  :param iSerialNo:[可选参数]指定图像匹配到多个目标时的序号,序号为从1开始的正整数,在屏幕上从左到右从上到下依次递增,匹配到最靠近屏幕左上角的目标序号为1,如果是0,匹配所有图片(即点击所有匹配到的图片)。默认为1
277
361
  :return:None
278
- '''
362
+ """
279
363
  @staticmethod
280
- def Hover(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: float = 0.9, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100, setForeground: bool = True, cursorPosition: str = 'center', cursorOffsetX: int = 0, cursorOffsetY: int = 0, keyModifiers: list = None, moveSmoothly: bool = False, matchType: str = 'GrayMatch', backgroundPic: bool = False, iSerialNo: int = 1):
281
- '''
364
+ def Hover(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: float = 0.9, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 100, delayBefore: int = 100, setForeground: bool = True, cursorPosition: str = 'center', cursorOffsetX: int = 0, cursorOffsetY: int = 0, keyModifiers: list = None, moveSmoothly: bool = False, matchType: str = 'GrayMatch', backgroundPic: bool = False, iSerialNo: int = 1) -> None:
365
+ """
282
366
  鼠标移动到图像上
283
367
 
284
368
  Image.Hover(\'d:\\test.jpg\', target, anchorsElement=None, rect=None, accuracy=0.9, searchDelay=10000, continueOnError=False, delayAfter=100, delayBefore=100,
@@ -303,10 +387,10 @@ class Image:
303
387
  :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
304
388
  :param iSerialNo:[可选参数]指定图像匹配到多个目标时的序号,序号为从1开始的正整数,在屏幕上从左到右从上到下依次递增,匹配到最靠近屏幕左上角的目标序号为1,如果是0,匹配所有图片(即鼠标将移动经过所有匹配到的图片)。默认为1
305
389
  :return:None
306
- '''
390
+ """
307
391
  @staticmethod
308
- def Wait(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: float = 0.9, waitType: str = 'show', searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, matchType: str = 'GrayMatch', backgroundPic: bool = False):
309
- '''
392
+ def Wait(imagePath: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: float = 0.9, waitType: str = 'show', searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, matchType: str = 'GrayMatch', backgroundPic: bool = False) -> None:
393
+ """
310
394
  等待图像显示或消失
311
395
 
312
396
  Image.Wait(\'d:\\test.jpg\', target, anchorsElement=None, rect=None, accuracy=0.9, waitType="show", searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, matchType=\'GrayMatch\', backgroundPic=False)
@@ -325,10 +409,10 @@ class Image:
325
409
  :param matchType:[可选参数]指定查找图像的匹配方式,\'GrayMatch\':“灰度匹配”速度快,但在极端情况下可能会匹配失败,\'ColorMatch\':“彩色匹配”相对“灰度匹配”更精准但匹配速度稍慢。默认\'GrayMatch\'
326
410
  :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
327
411
  :return:None
328
- '''
412
+ """
329
413
  @staticmethod
330
- def ComColor(color: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, beginPosition: str = 'center', positionOffsetX: int = 0, positionOffsetY: int = 0, backgroundPic: bool = False):
331
- '''
414
+ def ComColor(color: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, beginPosition: str = 'center', positionOffsetX: int = 0, positionOffsetY: int = 0, backgroundPic: bool = False) -> bool:
415
+ """
332
416
  目标内指定位置比色
333
417
 
334
418
  Image.ComColor(\'FF0000\', target, anchorsElement=None, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, beginPosition=\'center\', positionOffsetX=0, positionOffsetY=0, backgroundPic=False)
@@ -346,10 +430,10 @@ class Image:
346
430
  :param positionOffsetY:[可选参数]纵坐标偏移。默认0
347
431
  :param backgroundPic:[可选参数]是否后台识图片(指定位置的颜色与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
348
432
  :return:匹配返回True,不匹配返回False
349
- '''
433
+ """
350
434
  @staticmethod
351
- def GetColor(target, anchorsElement: Incomplete | None = None, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, beginPosition: str = 'center', positionOffsetX: int = 0, positionOffsetY: int = 0, backgroundPic: bool = False):
352
- '''
435
+ def GetColor(target, anchorsElement: uia.Control | None = None, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, beginPosition: str = 'center', positionOffsetX: int = 0, positionOffsetY: int = 0, backgroundPic: bool = False) -> str:
436
+ """
353
437
  获取目标指定位置的颜色值(16进制RGB字符)
354
438
 
355
439
  Image.GetColor(target, anchorsElement=None, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, beginPosition=\'center\', positionOffsetX=0, positionOffsetY=0, backgroundPic=False)
@@ -366,13 +450,13 @@ class Image:
366
450
  :param positionOffsetY:[可选参数]纵坐标偏移。默认0
367
451
  :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
368
452
  :return:返回颜色值(16进制的RGB字符),如"FF0000"
369
- '''
453
+ """
370
454
  @staticmethod
371
- def FindColor(colors: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, backgroundPic: bool = False, returnNum: str = 'first', relativeType: str = 'screen'):
372
- '''
455
+ def FindColor(colors: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, backgroundPic: bool = False, searchOrder: str = 'topLeft', relativeType: str = 'screen') -> list | None:
456
+ """
373
457
  查找颜色
374
458
 
375
- Image.FindColor(\'FF0000\', target, anchorsElement=None, rect=None, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, backgroundPic=False, returnNum=\'first\', relativeType=\'screen\')
459
+ Image.FindColor(\'FF0000\', target, anchorsElement=None, rect=None, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, backgroundPic=False, searchOrder=\'topLeft\', relativeType=\'screen\')
376
460
 
377
461
  :param colors: [必选参数]需要查找的颜色值字符串,十六进制颜色,支持偏色,支持同时多个颜色,例如 "FF0000" 或 "FF0000-101010" 或 "FF0000-101010|0000FF-101010"
378
462
  :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
@@ -383,14 +467,17 @@ class Image:
383
467
  :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
384
468
  :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
385
469
  :param setForeground:[可选参数]激活窗口。默认True
386
- :param backgroundPic:[可选参数]是否后台识图片(颜色需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
387
- :param returnNum:[可选参数]坐标返回数量。first:返回找到的第一个颜色坐标, all:返回找到的所有颜色坐标。默认first,查找顺序是从上到下,从左到右。
470
+ :param backgroundPic:[可选参数]是否后台识图片(颜色需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
471
+ :param searchOrder:[可选参数]搜索顺序,除“all”以外,其余方式返回首个匹配的颜色坐标,可组合使用,返回多个匹配坐标。
472
+ topLeft:从上到下由左至右,leftTop:从左到右由上至下,topRight:从上到下由右至左,rightTop:从右到左由上至下,
473
+ bottomLeft:从下到上由左至右,leftBottom:从左到右由下至上,bottomRight:从下到上由右至左,rightBottom:从右到左由下至上,
474
+ all:返回找到的所有颜色坐标。默认topLeft。
388
475
  :param relativeType:[可选参数]查找坐标相对类型。screen:返回相对屏幕的坐标,以屏幕左上角0,0为坐标原点。 image:返回相对查找范围的坐标,以查找范围的左上角0,0为坐标原点。默认screen
389
- :return:返回颜色的坐标,当returnNum为first时,返回如[50 100], 当returnNum为all时,返回如[[50 100],[50,101],[51,100]...], 找不到时返回None
390
- '''
476
+ :return:返回按照搜索顺序匹配到的颜色坐标, 匹配不到时返回None
477
+ """
391
478
  @staticmethod
392
- def FindMultColor(colorDes: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: int | float = 1.0, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, backgroundPic: bool = False, relativeType: str = 'screen'):
393
- '''
479
+ def FindMultColor(colorDes: str, target: str | uia.Control, anchorsElement: uia.Control | None = None, rect: dict | None = None, accuracy: int | float = 1.0, searchDelay: int = 10000, continueOnError: bool = False, delayAfter: int = 0, delayBefore: int = 100, setForeground: bool = True, backgroundPic: bool = False, relativeType: str = 'screen') -> dict | None:
480
+ """
394
481
  多点找色
395
482
 
396
483
  Image.FindMultColor(colorDes, target, anchorsElement=None, rect=None, accuracy=1.0, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, backgroundPic=False, relativeType=\'screen\')
@@ -408,10 +495,10 @@ class Image:
408
495
  :param backgroundPic:[可选参数]是否后台识图片(颜色描述需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
409
496
  :param relativeType:[可选参数]查找坐标相对类型。screen:返回相对屏幕的坐标,以屏幕左上角0,0为坐标原点。 image:返回相对查找范围的坐标,以查找范围的左上角0,0为坐标原点。默认screen
410
497
  :return:返回找到的坐标,如{"x":int, "y":int}。找不到返回None
411
- '''
498
+ """
412
499
  @staticmethod
413
- def CaptureScreen(filePath: str, rect: dict | None = None, continueOnError: bool = False, delayAfter: int = 300, delayBefore: int = 100):
414
- '''
500
+ def CaptureScreen(filePath: str, rect: dict | None = None, continueOnError: bool = False, delayAfter: int = 300, delayBefore: int = 100) -> None:
501
+ """
415
502
  屏幕截图
416
503
 
417
504
  Image.CaptureScreen("E:/1.png", rect=None, continueOnError=False, delayAfter=300, delayBefore=100)
@@ -422,12 +509,12 @@ class Image:
422
509
  :param delayAfter:[可选参数]执行后延时(毫秒)。默认300
423
510
  :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
424
511
  :return:None
425
- '''
512
+ """
426
513
 
427
514
  class Mail:
428
515
  @staticmethod
429
- 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):
430
- '''
516
+ 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) -> None:
517
+ """
431
518
  发送邮件
432
519
 
433
520
  Mail.SendMail(user=\'\', pwd=\'\', sender=\'\', title=\'\', content=\'\', to=\'\', cc=None, attr=None, server="smtp.qq.com", port=465, ssl=True, timeout=10, continueOnError=False)
@@ -446,32 +533,32 @@ class Mail:
446
533
  :param timeout: [可选参数]超时时间(秒),默认10
447
534
  :param continueOnError: [可选参数]发生错误是否继续,True为继续,False为不继续。默认False
448
535
  :return:None
449
- '''
536
+ """
450
537
 
451
538
  class HTTP:
452
539
  @staticmethod
453
540
  def SetCookies(cookies: dict = None) -> None:
454
- '''
541
+ """
455
542
  设置cookies
456
543
 
457
544
  HTTP.SetCookies(None)
458
545
 
459
546
  :param cookies:[可选参数]字典类型的cookies,例如:{"name":"value","name2":"value2"},默认None
460
547
  :return:None
461
- '''
548
+ """
462
549
  @staticmethod
463
550
  def SetHeaders(headers: dict = None) -> None:
464
- '''
551
+ """
465
552
  设置Headers
466
553
 
467
554
  HTTP.SetHeaders(None)
468
555
 
469
556
  :param headers:[可选参数]字典类型的请求头,例如:{"User-Agent": "Mozilla/5.0", "Accept-Language": "en-US"},默认None
470
557
  :return:None
471
- '''
558
+ """
472
559
  @staticmethod
473
560
  def Get(url: str, form: str | dict = None, delayTime: int = 60000) -> str:
474
- '''
561
+ """
475
562
  Get获取数据
476
563
 
477
564
  text = HTTP.Get("", None, 60000)
@@ -480,10 +567,10 @@ class HTTP:
480
567
  :param form:[可选参数]Get时传递的表单数据,可以是字符串或字典,默认None
481
568
  :param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
482
569
  :return:获取的网络数据的结果
483
- '''
570
+ """
484
571
  @staticmethod
485
572
  def Post(url: str, form: str | dict = None, delayTime: int = 60000) -> str:
486
- '''
573
+ """
487
574
  Post提交表单
488
575
 
489
576
  text = HTTP.Post("", None, 60000)
@@ -492,10 +579,10 @@ class HTTP:
492
579
  :param form:[可选参数]Post时传递的表单数据,可以是字符串或字典,默认None
493
580
  :param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
494
581
  :return:向网页提交表单的结果
495
- '''
582
+ """
496
583
  @staticmethod
497
584
  def PostJson(url: str, form: str | dict = None, delayTime: int = 60000) -> str:
498
- '''
585
+ """
499
586
  Post提交JSON表单
500
587
 
501
588
  text = HTTP.PostJson("", None, 60000)
@@ -504,10 +591,10 @@ class HTTP:
504
591
  :param form:[可选参数]Post时传递的表单数据,可以是字符串或字典,默认None
505
592
  :param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
506
593
  :return:向网页提交JSON表单的结果
507
- '''
594
+ """
508
595
  @staticmethod
509
596
  def GetFile(url: str, file: str, form: str | dict = None, delayTime: int = 60000) -> bool:
510
- '''
597
+ """
511
598
  Get下载文件
512
599
 
513
600
  result = HTTP.GetFile("","",None,60000)
@@ -517,12 +604,13 @@ class HTTP:
517
604
  :param form:[可选参数]Get时传递的表单数据,可以是字符串或字典,默认None
518
605
  :param delayTime:[可选参数]超时时间,单位毫秒,默认60000毫秒
519
606
  :return:是否下载成功
520
- '''
521
-
607
+ """
608
+
522
609
  def retry(num: int = 2, delay: int | float = None, wait: int | float = None):
523
610
  """
524
611
  重试装饰器
612
+
525
613
  :param num:[可选参数]重试次数,数字代表尝试次数,None:不限尝试次数。默认2次
526
614
  :param delay:[可选参数]重试延时秒数(超过此秒数重试不了),默认None
527
615
  :param wait:[可选参数]重试间隔秒数,默认None
528
- """
616
+ """
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tdrpa.tdworker
3
- Version: 1.2.13.61
3
+ Version: 1.2.13.63
4
4
  Summary: tdworker for tdrpa developers. supports python3.8+, windows x64
5
5
  Home-page: https://gitee.com/tdworker/command/wikis
6
6
  Author: vx:RPA_CREATOR
@@ -10,7 +10,7 @@ Keywords: rpa,RPA,tdRPA,tdworker,rpaworker,worker,uiautomation,uia,creator,windo
10
10
  Platform: Windows Only
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Operating System :: Microsoft :: Windows
13
- Requires-Dist: tdrpa.tdcore>=1.2.21
13
+ Requires-Dist: tdrpa.tdcore>=1.2.22
14
14
  Requires-Dist: pywin32
15
15
  Requires-Dist: pyperclip
16
16
  Requires-Dist: WMI
@@ -1,4 +1,4 @@
1
- tdrpa/tdworker.cp312-win_amd64.pyd,sha256=wxpMcg75A47xb9V72cSX4pg1IMCiFcNkqH5f9BTJH1s,4448256
1
+ tdrpa/tdworker.cp312-win_amd64.pyd,sha256=oAddKX-hcGul39-N-mPGi7BvwbZw563RMfRS4KJZxJc,4643840
2
2
  tdrpa/_tdxlwings/__init__.py,sha256=mxmqGWQ7xFb6e1GqkKEBfMQtZ8YyO4kAcPOvcJnD_2k,4424
3
3
  tdrpa/_tdxlwings/_win32patch.py,sha256=_IxTfvj663osTXh8b1S-A_N4PthS9gEWFLjpY4V0iUA,3443
4
4
  tdrpa/_tdxlwings/_xlmac.py,sha256=23OusKchbqglFi1s909tbB9fIwoFj6Yny4GiYrsnx5s,68521
@@ -82,12 +82,12 @@ tdrpa/_tdxlwings/quickstart_fastapi/requirements.txt,sha256=y3pL1maFFVyROPGnd2YD
82
82
  tdrpa/_tdxlwings/rest/__init__.py,sha256=Dk7m0qKA9yIswBm_66Vw1MHmiiYRmqZ3egAUIMjUjts,41
83
83
  tdrpa/_tdxlwings/rest/api.py,sha256=yfv1VkTpjQOzxLh4aMnZQsh8wTRHg34KkyipKDa_w4g,12885
84
84
  tdrpa/_tdxlwings/rest/serializers.py,sha256=ztMzL_EgbhAb3rSbfWFE2A9uyOykoZbkSoDHPeKXzGg,2885
85
- tdrpa/tdworker/__init__.pyi,sha256=SduurI_bQlVhaYqqASK1WjfgBdbupOrdMnK4eOTdxeo,336
85
+ tdrpa/tdworker/__init__.pyi,sha256=WN0PZBusMdAWbN8tAW5tQrxR-DgOL1US1no2Yjx4D-U,370
86
86
  tdrpa/tdworker/_excel.pyi,sha256=ZTtS3A4bW-vlZEGRZm3FtvG9zRU-n_aWRj1W1xLoBbM,67332
87
- tdrpa/tdworker/_other.pyi,sha256=8hG3J3YNjHNfWWR-pD6vSNJ9uPw32lgSzZpkkQTwUk8,39538
87
+ tdrpa/tdworker/_other.pyi,sha256=IzmaAOBJavdLrzNmxwSfeKxJvUTYrhxLczN32wKLoSk,43535
88
88
  tdrpa/tdworker/_web.pyi,sha256=8NDI7COti61cdJSnUjJpogZazKw9dfuc3J923k4KX0k,69739
89
89
  tdrpa/tdworker/_win.pyi,sha256=bNF_mMn0Cc8tA1nMAX555EtL0f5HCy08AEHsRM1TAP8,36049
90
- tdrpa_tdworker-1.2.13.61.dist-info/METADATA,sha256=pfvMgvJc7NlLIhZrLPE4B8XQLGqiU4qDYLQ-10ggWwY,1164
91
- tdrpa_tdworker-1.2.13.61.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
92
- tdrpa_tdworker-1.2.13.61.dist-info/top_level.txt,sha256=S9UoqmC_cyGqKbGsBkLQPEeQLbDrWD0SRwbxPpQpyyU,6
93
- tdrpa_tdworker-1.2.13.61.dist-info/RECORD,,
90
+ tdrpa_tdworker-1.2.13.63.dist-info/METADATA,sha256=gylL0-GOI_zI3g0t7N9kmpFsfB7YmRmobX9TFU404fQ,1164
91
+ tdrpa_tdworker-1.2.13.63.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
92
+ tdrpa_tdworker-1.2.13.63.dist-info/top_level.txt,sha256=S9UoqmC_cyGqKbGsBkLQPEeQLbDrWD0SRwbxPpQpyyU,6
93
+ tdrpa_tdworker-1.2.13.63.dist-info/RECORD,,