tdrpa.tdworker 1.2.13.2__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.
Files changed (101) hide show
  1. tdrpa/_tdxlwings/__init__.py +193 -0
  2. tdrpa/_tdxlwings/__pycache__/__init__.cpython-311.pyc +0 -0
  3. tdrpa/_tdxlwings/__pycache__/__init__.cpython-38.pyc +0 -0
  4. tdrpa/_tdxlwings/__pycache__/_win32patch.cpython-311.pyc +0 -0
  5. tdrpa/_tdxlwings/__pycache__/_win32patch.cpython-38.pyc +0 -0
  6. tdrpa/_tdxlwings/__pycache__/_xlwindows.cpython-311.pyc +0 -0
  7. tdrpa/_tdxlwings/__pycache__/_xlwindows.cpython-38.pyc +0 -0
  8. tdrpa/_tdxlwings/__pycache__/apps.cpython-311.pyc +0 -0
  9. tdrpa/_tdxlwings/__pycache__/apps.cpython-38.pyc +0 -0
  10. tdrpa/_tdxlwings/__pycache__/base_classes.cpython-311.pyc +0 -0
  11. tdrpa/_tdxlwings/__pycache__/base_classes.cpython-38.pyc +0 -0
  12. tdrpa/_tdxlwings/__pycache__/com_server.cpython-311.pyc +0 -0
  13. tdrpa/_tdxlwings/__pycache__/com_server.cpython-38.pyc +0 -0
  14. tdrpa/_tdxlwings/__pycache__/constants.cpython-311.pyc +0 -0
  15. tdrpa/_tdxlwings/__pycache__/constants.cpython-38.pyc +0 -0
  16. tdrpa/_tdxlwings/__pycache__/expansion.cpython-311.pyc +0 -0
  17. tdrpa/_tdxlwings/__pycache__/expansion.cpython-38.pyc +0 -0
  18. tdrpa/_tdxlwings/__pycache__/main.cpython-311.pyc +0 -0
  19. tdrpa/_tdxlwings/__pycache__/main.cpython-38.pyc +0 -0
  20. tdrpa/_tdxlwings/__pycache__/udfs.cpython-311.pyc +0 -0
  21. tdrpa/_tdxlwings/__pycache__/udfs.cpython-38.pyc +0 -0
  22. tdrpa/_tdxlwings/__pycache__/utils.cpython-311.pyc +0 -0
  23. tdrpa/_tdxlwings/__pycache__/utils.cpython-38.pyc +0 -0
  24. tdrpa/_tdxlwings/_win32patch.py +90 -0
  25. tdrpa/_tdxlwings/_xlmac.py +2240 -0
  26. tdrpa/_tdxlwings/_xlwindows.py +2518 -0
  27. tdrpa/_tdxlwings/addin/Dictionary.cls +474 -0
  28. tdrpa/_tdxlwings/addin/IWebAuthenticator.cls +71 -0
  29. tdrpa/_tdxlwings/addin/WebClient.cls +772 -0
  30. tdrpa/_tdxlwings/addin/WebHelpers.bas +3203 -0
  31. tdrpa/_tdxlwings/addin/WebRequest.cls +875 -0
  32. tdrpa/_tdxlwings/addin/WebResponse.cls +453 -0
  33. tdrpa/_tdxlwings/addin/xlwings.xlam +0 -0
  34. tdrpa/_tdxlwings/apps.py +35 -0
  35. tdrpa/_tdxlwings/base_classes.py +1092 -0
  36. tdrpa/_tdxlwings/cli.py +1306 -0
  37. tdrpa/_tdxlwings/com_server.py +385 -0
  38. tdrpa/_tdxlwings/constants.py +3080 -0
  39. tdrpa/_tdxlwings/conversion/__init__.py +103 -0
  40. tdrpa/_tdxlwings/conversion/framework.py +147 -0
  41. tdrpa/_tdxlwings/conversion/numpy_conv.py +34 -0
  42. tdrpa/_tdxlwings/conversion/pandas_conv.py +184 -0
  43. tdrpa/_tdxlwings/conversion/standard.py +321 -0
  44. tdrpa/_tdxlwings/expansion.py +83 -0
  45. tdrpa/_tdxlwings/ext/__init__.py +3 -0
  46. tdrpa/_tdxlwings/ext/sql.py +73 -0
  47. tdrpa/_tdxlwings/html/xlwings-alert.html +71 -0
  48. tdrpa/_tdxlwings/js/xlwings.js +577 -0
  49. tdrpa/_tdxlwings/js/xlwings.ts +729 -0
  50. tdrpa/_tdxlwings/mac_dict.py +6399 -0
  51. tdrpa/_tdxlwings/main.py +5205 -0
  52. tdrpa/_tdxlwings/mistune/__init__.py +63 -0
  53. tdrpa/_tdxlwings/mistune/block_parser.py +366 -0
  54. tdrpa/_tdxlwings/mistune/inline_parser.py +216 -0
  55. tdrpa/_tdxlwings/mistune/markdown.py +84 -0
  56. tdrpa/_tdxlwings/mistune/renderers.py +220 -0
  57. tdrpa/_tdxlwings/mistune/scanner.py +121 -0
  58. tdrpa/_tdxlwings/mistune/util.py +41 -0
  59. tdrpa/_tdxlwings/pro/__init__.py +40 -0
  60. tdrpa/_tdxlwings/pro/_xlcalamine.py +536 -0
  61. tdrpa/_tdxlwings/pro/_xlofficejs.py +146 -0
  62. tdrpa/_tdxlwings/pro/_xlremote.py +1293 -0
  63. tdrpa/_tdxlwings/pro/custom_functions_code.js +150 -0
  64. tdrpa/_tdxlwings/pro/embedded_code.py +60 -0
  65. tdrpa/_tdxlwings/pro/udfs_officejs.py +549 -0
  66. tdrpa/_tdxlwings/pro/utils.py +199 -0
  67. tdrpa/_tdxlwings/quickstart.xlsm +0 -0
  68. tdrpa/_tdxlwings/quickstart_addin.xlam +0 -0
  69. tdrpa/_tdxlwings/quickstart_addin_ribbon.xlam +0 -0
  70. tdrpa/_tdxlwings/quickstart_fastapi/main.py +47 -0
  71. tdrpa/_tdxlwings/quickstart_fastapi/requirements.txt +3 -0
  72. tdrpa/_tdxlwings/quickstart_standalone.xlsm +0 -0
  73. tdrpa/_tdxlwings/reports.py +12 -0
  74. tdrpa/_tdxlwings/rest/__init__.py +1 -0
  75. tdrpa/_tdxlwings/rest/api.py +368 -0
  76. tdrpa/_tdxlwings/rest/serializers.py +103 -0
  77. tdrpa/_tdxlwings/server.py +14 -0
  78. tdrpa/_tdxlwings/udfs.py +775 -0
  79. tdrpa/_tdxlwings/utils.py +777 -0
  80. tdrpa/_tdxlwings/xlwings-0.31.6.applescript +30 -0
  81. tdrpa/_tdxlwings/xlwings.bas +2061 -0
  82. tdrpa/_tdxlwings/xlwings_custom_addin.bas +2042 -0
  83. tdrpa/_tdxlwings/xlwingslib.cp38-win_amd64.pyd +0 -0
  84. tdrpa/tdworker/__init__.pyi +12 -0
  85. tdrpa/tdworker/_clip.pyi +50 -0
  86. tdrpa/tdworker/_excel.pyi +743 -0
  87. tdrpa/tdworker/_file.pyi +77 -0
  88. tdrpa/tdworker/_img.pyi +226 -0
  89. tdrpa/tdworker/_network.pyi +94 -0
  90. tdrpa/tdworker/_os.pyi +47 -0
  91. tdrpa/tdworker/_sp.pyi +21 -0
  92. tdrpa/tdworker/_w.pyi +129 -0
  93. tdrpa/tdworker/_web.pyi +995 -0
  94. tdrpa/tdworker/_winE.pyi +228 -0
  95. tdrpa/tdworker/_winK.pyi +74 -0
  96. tdrpa/tdworker/_winM.pyi +117 -0
  97. tdrpa/tdworker.cp312-win_amd64.pyd +0 -0
  98. tdrpa_tdworker-1.2.13.2.dist-info/METADATA +38 -0
  99. tdrpa_tdworker-1.2.13.2.dist-info/RECORD +101 -0
  100. tdrpa_tdworker-1.2.13.2.dist-info/WHEEL +5 -0
  101. tdrpa_tdworker-1.2.13.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,77 @@
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
+ """
@@ -0,0 +1,226 @@
1
+ import uiautomation as uia
2
+ from _typeshed import Incomplete
3
+
4
+ class Image:
5
+ @staticmethod
6
+ 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:
7
+ '''
8
+ 判断图像是否存在
9
+
10
+ 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)
11
+
12
+ :param imagePath:[必选参数]要查找的图片路径
13
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
14
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
15
+ :param rect:[可选参数]需要查找的范围,程序会在控件这个范围内进行图片识别,如果范围传递为 None,则进行控件矩形区域范围内的图片识别,如果范围传递为 {"x":10,"y":5,"width":200,"height":100},则进行控件矩形区域范围内以左上角向右偏移10像素、向下偏移5像素为起点,向右侧200,向下100的范围内的图片识别。默认None
16
+ :param accuracy:[可选参数]查找图片时使用的相似度,相似度范围从 0.5 - 1.0,表示 50% - 100% 相似。默认0.9
17
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
18
+ :param continueOnError:[可选参数]错误继续执行。默认False
19
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
20
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
21
+ :param setForeground:[可选参数]激活窗口。默认True
22
+ :param matchType:[可选参数]指定查找图像的匹配方式,\'GrayMatch\':“灰度匹配”速度快,但在极端情况下可能会匹配失败,\'ColorMatch\':“彩色匹配”相对“灰度匹配”更精准但匹配速度稍慢。默认\'GrayMatch\'
23
+ :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
24
+ :return:存在返回True,不存在返回False
25
+ '''
26
+ @staticmethod
27
+ 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:
28
+ '''
29
+ 查找图像
30
+
31
+ 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")
32
+
33
+ :param imagePath:[必选参数]要查找的图片路径
34
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
35
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
36
+ :param rect:[可选参数]需要查找的范围,程序会在控件这个范围内进行图片识别,如果范围传递为 None,则进行控件矩形区域范围内的图片识别,如果范围传递为 {"x":10,"y":5,"width":200,"height":100},则进行控件矩形区域范围内以左上角向右偏移10像素、向下偏移5像素为起点,向右侧200,向下100的范围内的图片识别。默认None
37
+ :param accuracy:[可选参数]查找图片时使用的相似度,相似度范围从 0.5 - 1.0,表示 50% - 100% 相似。默认0.9
38
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
39
+ :param continueOnError:[可选参数]错误继续执行。默认False
40
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
41
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
42
+ :param setForeground:[可选参数]激活窗口。默认True
43
+ :param matchType:[可选参数]指定查找图像的匹配方式,\'GrayMatch\':“灰度匹配”速度快,但在极端情况下可能会匹配失败,\'ColorMatch\':“彩色匹配”相对“灰度匹配”更精准但匹配速度稍慢。默认\'GrayMatch\'
44
+ :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
45
+ :param iSerialNo:[可选参数]指定图像匹配到多个目标时的序号,序号为从1开始的正整数,在屏幕上从左到右从上到下依次递增,匹配到最靠近屏幕左上角的目标序号为1,如果是0,返回所有匹配图像的坐标。默认为0
46
+ :param returnPosition:[可选参数]\'center\':返回图片中心坐标,\'topLeft\':返回图片左上角坐标,\'topRight\':返回图片右上角坐标,\'bottomLeft\':返回图片左下角坐标,\'bottomRight\':返回图片右下角坐标。默认\'center\'
47
+ :return:返回图像的坐标,iSerialNo为0时,返回list,如[{\'x\':100, \'y\':100}, {\'x\':300,\'y\':300}],iSerialNo大于0时,返回dict,如{\'x\':100, \'y\':100},匹配不到时返回None
48
+ '''
49
+ @staticmethod
50
+ 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):
51
+ '''
52
+ 点击图像
53
+
54
+ 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,
55
+ setForeground=True, cursorPosition=\'center\', cursorOffsetX=0, cursorOffsetY=0, keyModifiers=None, simulateType=\'simulate\', moveSmoothly=False, matchType=\'GrayMatch\', backgroundPic=False, iSerialNo=1)
56
+
57
+ :param imagePath:[必选参数]要查找的图片路径
58
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
59
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
60
+ :param rect:[可选参数]需要查找的范围,程序会在控件这个范围内进行图片识别,如果范围传递为 None,则进行控件矩形区域范围内的图片识别,如果范围传递为 {"x":10,"y":5,"width":200,"height":100},则进行控件矩形区域范围内以左上角向右偏移10像素、向下偏移5像素为起点,向右侧200,向下100的范围内的图片识别。默认None
61
+ :param accuracy:[可选参数]查找图片时使用的相似度,相似度范围从 0.5 - 1.0,表示 50% - 100% 相似。默认0.9
62
+ :param button:[可选参数]鼠标点击。鼠标左键:"left" 鼠标右键:"right" 鼠标中键:"middle"。默认"left"
63
+ :param clickType:[可选参数]点击类型。单击:"click" 双击:"dbclick" 按下:"down" 弹起:"up"。默认"click"
64
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
65
+ :param continueOnError:[可选参数]错误继续执行。默认False
66
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认100
67
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
68
+ :param setForeground:[可选参数]激活窗口。默认True
69
+ :param cursorPosition:[可选参数]光标位置。中心:"center" 左上角:"topLeft" 右上角:"topRight" 左下角:"bottomLeft" 右下角:"bottomRight"。默认"center"
70
+ :param cursorOffsetX:[可选参数]横坐标偏移。默认0
71
+ :param cursorOffsetY:[可选参数]纵坐标偏移。默认0
72
+ :param keyModifiers:[可选参数]辅助按键["Alt","Ctrl","Shift","Win"]可多选。默认None
73
+ :param simulateType:[可选参数]操作类型。模拟操作:"simulate" 消息操作:"message"。默认"simulate"
74
+ :param moveSmoothly:[可选参数]是否平滑移动鼠标。默认False
75
+ :param matchType:[可选参数]指定查找图像的匹配方式,\'GrayMatch\':“灰度匹配”速度快,但在极端情况下可能会匹配失败,\'ColorMatch\':“彩色匹配”相对“灰度匹配”更精准但匹配速度稍慢。默认\'GrayMatch\'
76
+ :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。注意:当simulateType为message时,该字段设置为True才会生效
77
+ :param iSerialNo:[可选参数]指定图像匹配到多个目标时的序号,序号为从1开始的正整数,在屏幕上从左到右从上到下依次递增,匹配到最靠近屏幕左上角的目标序号为1,如果是0,匹配所有图片(即点击所有匹配到的图片)。默认为1
78
+ :return:None
79
+ '''
80
+ @staticmethod
81
+ 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):
82
+ '''
83
+ 鼠标移动到图像上
84
+
85
+ Image.Hover(\'d:\\test.jpg\', target, anchorsElement=None, rect=None, accuracy=0.9, searchDelay=10000, continueOnError=False, delayAfter=100, delayBefore=100,
86
+ setForeground=True, cursorPosition=\'center\', cursorOffsetX=0, cursorOffsetY=0, keyModifiers=None, moveSmoothly=False, matchType=\'GrayMatch\', backgroundPic=False, iSerialNo=1)
87
+
88
+ :param imagePath:[必选参数]要查找的图片路径
89
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
90
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
91
+ :param rect:[可选参数]需要查找的范围,程序会在控件这个范围内进行图片识别,如果范围传递为 None,则进行控件矩形区域范围内的图片识别,如果范围传递为 {"x":10,"y":5,"width":200,"height":100},则进行控件矩形区域范围内以左上角向右偏移10像素、向下偏移5像素为起点,向右侧200,向下100的范围内的图片识别。默认None
92
+ :param accuracy:[可选参数]查找图片时使用的相似度,相似度范围从 0.5 - 1.0,表示 50% - 100% 相似。默认0.9
93
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
94
+ :param continueOnError:[可选参数]错误继续执行。默认False
95
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认100
96
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
97
+ :param setForeground:[可选参数]激活窗口。默认True
98
+ :param cursorPosition:[可选参数]光标位置。中心:"center" 左上角:"topLeft" 右上角:"topRight" 左下角:"bottomLeft" 右下角:"bottomRight"。默认"center"
99
+ :param cursorOffsetX:[可选参数]横坐标偏移。默认0
100
+ :param cursorOffsetY:[可选参数]纵坐标偏移。默认0
101
+ :param keyModifiers:[可选参数]辅助按键["Alt","Ctrl","Shift","Win"]可多选。默认None
102
+ :param moveSmoothly:[可选参数]是否平滑移动鼠标。默认False
103
+ :param matchType:[可选参数]指定查找图像的匹配方式,\'GrayMatch\':“灰度匹配”速度快,但在极端情况下可能会匹配失败,\'ColorMatch\':“彩色匹配”相对“灰度匹配”更精准但匹配速度稍慢。默认\'GrayMatch\'
104
+ :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
105
+ :param iSerialNo:[可选参数]指定图像匹配到多个目标时的序号,序号为从1开始的正整数,在屏幕上从左到右从上到下依次递增,匹配到最靠近屏幕左上角的目标序号为1,如果是0,匹配所有图片(即鼠标将移动经过所有匹配到的图片)。默认为1
106
+ :return:None
107
+ '''
108
+ @staticmethod
109
+ 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):
110
+ '''
111
+ 等待图像显示或消失
112
+
113
+ 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)
114
+
115
+ :param imagePath:[必选参数]要查找的图片路径
116
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
117
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
118
+ :param rect:[可选参数]需要查找的范围,程序会在控件这个范围内进行图片识别,如果范围传递为 None,则进行控件矩形区域范围内的图片识别,如果范围传递为 {"x":10,"y":5,"width":200,"height":100},则进行控件矩形区域范围内以左上角向右偏移10像素、向下偏移5像素为起点,向右侧200,向下100的范围内的图片识别。默认None
119
+ :param accuracy:[可选参数]查找图片时使用的相似度,相似度范围从 0.5 - 1.0,表示 50% - 100% 相似。默认0.9
120
+ :param waitType:[可选参数]等待方式。 等待显示:"show" 等待消失:"hide"。默认"show"
121
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
122
+ :param continueOnError:[可选参数]错误继续执行。默认False
123
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
124
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
125
+ :param setForeground:[可选参数]激活窗口。默认True
126
+ :param matchType:[可选参数]指定查找图像的匹配方式,\'GrayMatch\':“灰度匹配”速度快,但在极端情况下可能会匹配失败,\'ColorMatch\':“彩色匹配”相对“灰度匹配”更精准但匹配速度稍慢。默认\'GrayMatch\'
127
+ :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
128
+ :return:None
129
+ '''
130
+ @staticmethod
131
+ 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):
132
+ '''
133
+ 目标内指定位置比色
134
+
135
+ Image.ComColor(\'FF0000\', target, anchorsElement=None, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, beginPosition=\'center\', positionOffsetX=0, positionOffsetY=0, backgroundPic=False)
136
+
137
+ :param color:[必选参数]指定位置是否为此颜色,十六进制颜色,RGB色值,例如:"FF0000",支持偏色,如"FF0000-101010"
138
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
139
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
140
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
141
+ :param continueOnError:[可选参数]错误继续执行。默认False
142
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
143
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
144
+ :param setForeground:[可选参数]激活窗口。默认True
145
+ :param beginPosition:[可选参数]起始位置。center:中心, topLeft:左上角, topRight:右上角, bottomLeft:左下角, bottomRight:右下角。默认"center"
146
+ :param positionOffsetX:[可选参数]横坐标偏移。默认0
147
+ :param positionOffsetY:[可选参数]纵坐标偏移。默认0
148
+ :param backgroundPic:[可选参数]是否后台识图片(指定位置的颜色与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
149
+ :return:匹配返回True,不匹配返回False
150
+ '''
151
+ @staticmethod
152
+ 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):
153
+ '''
154
+ 获取目标指定位置的颜色值(16进制RGB字符)
155
+
156
+ Image.GetColor(target, anchorsElement=None, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, beginPosition=\'center\', positionOffsetX=0, positionOffsetY=0, backgroundPic=False)
157
+
158
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
159
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
160
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
161
+ :param continueOnError:[可选参数]错误继续执行。默认False
162
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
163
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
164
+ :param setForeground:[可选参数]激活窗口。默认True
165
+ :param beginPosition:[可选参数]起始位置。中心:"center" 左上角:"topLeft" 右上角:"topRight" 左下角:"bottomLeft" 右下角:"bottomRight"。默认"center"
166
+ :param positionOffsetX:[可选参数]横坐标偏移。默认0
167
+ :param positionOffsetY:[可选参数]纵坐标偏移。默认0
168
+ :param backgroundPic:[可选参数]是否后台识图片(图片需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
169
+ :return:返回颜色值(16进制的RGB字符),如"FF0000"
170
+ '''
171
+ @staticmethod
172
+ 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'):
173
+ '''
174
+ 查找颜色
175
+
176
+ Image.FindColor(\'FF0000\', target, anchorsElement=None, rect=None, searchDelay=10000, continueOnError=False, delayAfter=0, delayBefore=100, setForeground=True, backgroundPic=False, returnNum=\'first\', relativeType=\'screen\')
177
+
178
+ :param colors: [必选参数]需要查找的颜色值字符串,十六进制颜色,支持偏色,支持同时多个颜色,例如 "FF0000" 或 "FF0000-101010" 或 "FF0000-101010|0000FF-101010"
179
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
180
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
181
+ :param rect:[可选参数]需要查找的范围,程序会在控件这个范围内进行颜色识别,如果范围传递为 None,则进行控件矩形区域范围内的颜色识别,如果范围传递为 {"x":10,"y":5,"width":200,"height":100},则进行控件矩形区域范围内以左上角向右偏移10像素、向下偏移5像素为起点,向右侧200,向下100的范围内的颜色识别。默认None
182
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
183
+ :param continueOnError:[可选参数]错误继续执行。默认False
184
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
185
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
186
+ :param setForeground:[可选参数]激活窗口。默认True
187
+ :param backgroundPic:[可选参数]是否后台识图片(颜色需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
188
+ :param returnNum:[可选参数]坐标返回数量。first:返回找到的第一个颜色坐标, all:返回找到的所有颜色坐标。默认first,查找顺序是从上到下,从左到右。
189
+ :param relativeType:[可选参数]查找坐标相对类型。screen:返回相对屏幕的坐标,以屏幕左上角0,0为坐标原点。 image:返回相对查找范围的坐标,以查找范围的左上角0,0为坐标原点。默认screen
190
+ :return:返回颜色的坐标,当returnNum为first时,返回如[50 100], 当returnNum为all时,返回如[[50 100],[50,101],[51,100]...], 找不到时返回None
191
+ '''
192
+ @staticmethod
193
+ 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'):
194
+ '''
195
+ 多点找色
196
+
197
+ 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\')
198
+
199
+ :param colorDes:[必选参数]多点颜色描述,如"40b7ff-101010,-16|-14|58c0ff-101010,-17|5|4ebbff-101010,17|-3|26adff-101010,17|15|42b7ff-101010", 解释:以40b7ff-101010颜色为锚点,符合向左偏移16像素,向上偏移14像素,且颜色符合58c0ff-101010,向...向...且颜色符合...等等。推荐使用<大漠综合工具>获取颜色描述
200
+ :param target:[必选参数]tdRPA拾取器获取的目标元素特征字符串或uia目标元素对象
201
+ :param anchorsElement:[可选参数]从哪个元素开始找,不传则从桌面顶级元素开始找(有值可提高查找速度)。默认None
202
+ :param rect:[可选参数]需要查找的范围,程序会在控件这个范围内进行多点找色,如果范围传递为 None,则进行控件矩形区域范围内的多点找色,如果范围传递为 {"x":10,"y":5,"width":200,"height":100},则进行控件矩形区域范围内以左上角向右偏移10像素、向下偏移5像素为起点,向右侧200,向下100的范围内的多点找色。默认None
203
+ :param accuracy:[可选参数]多点找色时使用的相似度,相似度范围从 0.5 - 1.0,表示 50% - 100% 相似。默认1.0
204
+ :param searchDelay:[可选参数]超时时间(毫秒)。默认10000
205
+ :param continueOnError:[可选参数]错误继续执行。默认False
206
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认0
207
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
208
+ :param setForeground:[可选参数]激活窗口。默认True
209
+ :param backgroundPic:[可选参数]是否后台识图片(颜色描述需与查找范围在同一窗口)。True为后台识别图片,False为前台识别图片。默认False。
210
+ :param relativeType:[可选参数]查找坐标相对类型。screen:返回相对屏幕的坐标,以屏幕左上角0,0为坐标原点。 image:返回相对查找范围的坐标,以查找范围的左上角0,0为坐标原点。默认screen
211
+ :return:返回找到的坐标,如{"x":int, "y":int}。找不到返回None
212
+ '''
213
+ @staticmethod
214
+ def CaptureScreen(filePath: str, rect: dict | None = None, continueOnError: bool = False, delayAfter: int = 300, delayBefore: int = 100):
215
+ '''
216
+ 屏幕截图
217
+
218
+ Image.CaptureScreen("E:/1.png", rect=None, continueOnError=False, delayAfter=300, delayBefore=100)
219
+
220
+ :param filePath:[必选参数]保存的图片路径,如"E:/1.png"
221
+ :param rect:[可选参数]需要截取的范围。{"x": int, "y": int, "width": int, "height": int}:程序会在屏幕这个范围内进行截图。如果范围传递为 None,则进行屏幕截图
222
+ :param continueOnError:[可选参数]错误继续执行。
223
+ :param delayAfter:[可选参数]执行后延时(毫秒)。默认300
224
+ :param delayBefore:[可选参数]执行前延时(毫秒)。默认100
225
+ :return:None
226
+ '''
@@ -0,0 +1,94 @@
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 ADDED
@@ -0,0 +1,47 @@
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 ADDED
@@ -0,0 +1,21 @@
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 ADDED
@@ -0,0 +1,129 @@
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
+ """