isrpa 0.6__py3-none-any.whl → 0.7__py3-none-any.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.
- isrpa/OCR.py +8 -4
- isrpa/Template_Exception.py +5 -5
- isrpa/message.py +1 -1
- {isrpa-0.6.dist-info → isrpa-0.7.dist-info}/METADATA +1 -1
- isrpa-0.7.dist-info/RECORD +10 -0
- isrpa-0.6.dist-info/RECORD +0 -10
- {isrpa-0.6.dist-info → isrpa-0.7.dist-info}/WHEEL +0 -0
- {isrpa-0.6.dist-info → isrpa-0.7.dist-info}/top_level.txt +0 -0
isrpa/OCR.py
CHANGED
@@ -67,10 +67,14 @@ def OCR_from_image(img, apiKey, secretKey, code_type=8000, option='vCode'):
|
|
67
67
|
try:
|
68
68
|
result = response_data.get('result')
|
69
69
|
except Exception:
|
70
|
-
raise
|
70
|
+
raise LoginFailed
|
71
71
|
return result
|
72
72
|
|
73
|
-
|
73
|
+
|
74
74
|
if __name__ == '__main__':
|
75
|
-
|
76
|
-
|
75
|
+
img_path = r'D:\Node_example\滑块验证码.png'
|
76
|
+
apiKey = "aa9b5dc8a35c4f93a10fb53e3aebbb0b"
|
77
|
+
secretKey = "eb50c22a83bd43daad6532722c8a921a"
|
78
|
+
code_type = 9000
|
79
|
+
result = OCR_frome_image_path(img_path, apiKey, secretKey, code_type)
|
80
|
+
print(result)
|
isrpa/Template_Exception.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class LoginFailed(Exception):
|
2
2
|
"""异常:登录失败"""
|
3
3
|
|
4
4
|
def __init__(self, message="登录失败,请检查登录步骤"):
|
@@ -6,7 +6,7 @@ class 登录失败(Exception):
|
|
6
6
|
super().__init__(self.message)
|
7
7
|
|
8
8
|
|
9
|
-
class
|
9
|
+
class FileNotFound(Exception):
|
10
10
|
"""异常:文件不存在"""
|
11
11
|
|
12
12
|
def __init__(self, message="文件不存在,请检查文件路径"):
|
@@ -14,7 +14,7 @@ class 文件不存在(Exception):
|
|
14
14
|
super().__init__(self.message)
|
15
15
|
|
16
16
|
|
17
|
-
class
|
17
|
+
class Timeout(Exception):
|
18
18
|
"""异常:等待超时"""
|
19
19
|
|
20
20
|
def __init__(self, message="等待超时"):
|
@@ -22,9 +22,9 @@ class 等待超时(Exception):
|
|
22
22
|
super().__init__(self.message)
|
23
23
|
|
24
24
|
|
25
|
-
class
|
25
|
+
class InvalidArgument(Exception):
|
26
26
|
"""异常:无效参数"""
|
27
27
|
|
28
28
|
def __init__(self, message="输入参数无效"):
|
29
29
|
self.message = message
|
30
|
-
super().__init__(self.message)
|
30
|
+
super().__init__(self.message)
|
isrpa/message.py
CHANGED
@@ -139,7 +139,7 @@ def action_message(page, message="等待用户操作", button_label="确认", bu
|
|
139
139
|
try:
|
140
140
|
page.wait_for_function("window.customButtonClicked === true", timeout=time * 1000)
|
141
141
|
except Exception:
|
142
|
-
raise
|
142
|
+
raise Timeout
|
143
143
|
|
144
144
|
|
145
145
|
def info_message(page, current_action="当前执行", message="网页操作"):
|
@@ -0,0 +1,10 @@
|
|
1
|
+
isrpa/OCR.py,sha256=KADclGJtLKNsGsVJmjfmqr3BZzMmtoIA2OcKIaXUFY8,2522
|
2
|
+
isrpa/Template.py,sha256=UP1uovLvJzXEPGo_hzLrIYOu3vZP8Cf6m3G2hGzQ6XA,1958
|
3
|
+
isrpa/Template_Exception.py,sha256=an6eQ1NMB8a9R-J0yyMdwHIZcZeDtdV5f7fWKZQsZ3s,819
|
4
|
+
isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
|
5
|
+
isrpa/message.py,sha256=Glf84I6rs2shQwOG9fTV4AyoUpA2nQh1OF47EjgErok,11342
|
6
|
+
isrpa/utils.py,sha256=bmcEvxfLhrWOFGUXpBSSsGlfD8qmJ-lCm8VHoYpEPEY,50851
|
7
|
+
isrpa-0.7.dist-info/METADATA,sha256=BhO-JUWI0vGFzfCtQhfYPnnOBRx_RQ0YPy2HZz2qwWg,457
|
8
|
+
isrpa-0.7.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
9
|
+
isrpa-0.7.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
|
10
|
+
isrpa-0.7.dist-info/RECORD,,
|
isrpa-0.6.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
isrpa/OCR.py,sha256=fbBIcUiRoMVn_Yk7-I0MnuHNCtQdaKgRwIMhzGge3nc,2326
|
2
|
-
isrpa/Template.py,sha256=UP1uovLvJzXEPGo_hzLrIYOu3vZP8Cf6m3G2hGzQ6XA,1958
|
3
|
-
isrpa/Template_Exception.py,sha256=FdarwIMF8qHpcTYoEKF7Ru-pcKnt9NIoyuCSobKEphw,827
|
4
|
-
isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
|
5
|
-
isrpa/message.py,sha256=salmKkbxbVic7HlbHJQ1x9JhjjbQwJsvRa4tZ2JPY4M,11347
|
6
|
-
isrpa/utils.py,sha256=bmcEvxfLhrWOFGUXpBSSsGlfD8qmJ-lCm8VHoYpEPEY,50851
|
7
|
-
isrpa-0.6.dist-info/METADATA,sha256=DC-mWOVBff868CiIJByepZ8w2D_3Z8wU4rAId9bHIuY,457
|
8
|
-
isrpa-0.6.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
9
|
-
isrpa-0.6.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
|
10
|
-
isrpa-0.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|