MaaFw 4.1.1__py3-none-macosx_13_0_arm64.whl → 4.2.0__py3-none-macosx_13_0_arm64.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.

Potentially problematic release.


This version of MaaFw might be problematic. Click here for more details.

maa/agent_client.py CHANGED
@@ -9,10 +9,17 @@ from .buffer import StringBuffer
9
9
  class AgentClient:
10
10
  _handle: MaaAgentClientHandle
11
11
 
12
- def __init__(self):
12
+ def __init__(self, identifier: Optional[str] = None):
13
13
  self._set_api_properties()
14
14
 
15
- self._handle = Library.agent_client().MaaAgentClientCreate()
15
+ if identifier:
16
+ id_buffer = StringBuffer()
17
+ id_buffer.set(identifier)
18
+ id_buffer_handle = id_buffer._handle
19
+ else:
20
+ id_buffer_handle = None
21
+
22
+ self._handle = Library.agent_client().MaaAgentClientCreateV2(id_buffer_handle)
16
23
  if not self._handle:
17
24
  raise RuntimeError("Failed to create agent client.")
18
25
 
@@ -20,6 +27,15 @@ class AgentClient:
20
27
  if self._handle:
21
28
  Library.agent_client().MaaAgentClientDestroy(self._handle)
22
29
 
30
+ def identifier(self) -> Optional[str]:
31
+ id_buffer = StringBuffer()
32
+ if not Library.agent_client().MaaAgentClientIdentifier(
33
+ self._handle, id_buffer._handle
34
+ ):
35
+ return None
36
+
37
+ return id_buffer.get()
38
+
23
39
  def bind(self, resource: Resource) -> bool:
24
40
  # avoid gc
25
41
  self._resource = resource
@@ -30,26 +46,15 @@ class AgentClient:
30
46
  )
31
47
  )
32
48
 
33
- def create_socket(self, identifier: str = "") -> Optional[str]:
34
- id_buffer = StringBuffer()
35
- id_buffer.set(identifier)
36
-
37
- ret = bool(
38
- Library.agent_client().MaaAgentClientCreateSocket(
39
- self._handle, id_buffer._handle
40
- )
41
- )
42
- if not ret:
43
- return None
44
-
45
- return id_buffer.get()
46
-
47
49
  def connect(self) -> bool:
48
50
  return bool(Library.agent_client().MaaAgentClientConnect(self._handle))
49
51
 
50
52
  def disconnect(self) -> bool:
51
53
  return bool(Library.agent_client().MaaAgentClientDisconnect(self._handle))
52
54
 
55
+ def connected(self) -> bool:
56
+ return bool(Library.agent_client().MaaAgentClientConnected(self._handle))
57
+
53
58
  _api_properties_initialized: bool = False
54
59
 
55
60
  @staticmethod
@@ -62,8 +67,16 @@ class AgentClient:
62
67
 
63
68
  AgentClient._api_properties_initialized = True
64
69
 
65
- Library.agent_client().MaaAgentClientCreate.restype = MaaAgentClientHandle
66
- Library.agent_client().MaaAgentClientCreate.argtypes = []
70
+ Library.agent_client().MaaAgentClientCreateV2.restype = MaaAgentClientHandle
71
+ Library.agent_client().MaaAgentClientCreateV2.argtypes = [
72
+ MaaStringBufferHandle,
73
+ ]
74
+
75
+ Library.agent_client().MaaAgentClientIdentifier.restype = MaaBool
76
+ Library.agent_client().MaaAgentClientIdentifier.argtypes = [
77
+ MaaAgentClientHandle,
78
+ MaaStringBufferHandle,
79
+ ]
67
80
 
68
81
  Library.agent_client().MaaAgentClientDestroy.restype = None
69
82
  Library.agent_client().MaaAgentClientDestroy.argtypes = [MaaAgentClientHandle]
@@ -74,12 +87,6 @@ class AgentClient:
74
87
  MaaResourceHandle,
75
88
  ]
76
89
 
77
- Library.agent_client().MaaAgentClientCreateSocket.restype = MaaBool
78
- Library.agent_client().MaaAgentClientCreateSocket.argtypes = [
79
- MaaAgentClientHandle,
80
- MaaStringBufferHandle,
81
- ]
82
-
83
90
  Library.agent_client().MaaAgentClientConnect.restype = MaaBool
84
91
  Library.agent_client().MaaAgentClientConnect.argtypes = [
85
92
  MaaAgentClientHandle,
@@ -89,3 +96,8 @@ class AgentClient:
89
96
  Library.agent_client().MaaAgentClientDisconnect.argtypes = [
90
97
  MaaAgentClientHandle,
91
98
  ]
99
+
100
+ Library.agent_client().MaaAgentClientConnected.restype = MaaBool
101
+ Library.agent_client().MaaAgentClientConnected.argtypes = [
102
+ MaaAgentClientHandle,
103
+ ]
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
maa/bin/libMaaUtils.dylib CHANGED
Binary file
Binary file
Binary file
Binary file
maa/resource.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import ctypes
2
2
  import pathlib
3
+ import json
3
4
  from typing import Any, Optional, Union
4
5
 
5
6
  from .notification_handler import NotificationHandler
@@ -49,6 +50,24 @@ class Resource:
49
50
  )
50
51
  return Job(resid, self._status, self._wait)
51
52
 
53
+ def override_pipeline(self, pipeline_override: Dict) -> bool:
54
+ return bool(
55
+ Library.framework().MaaResourceOverridePipeline(
56
+ self._handle,
57
+ json.dumps(pipeline_override, ensure_ascii=False).encode(),
58
+ )
59
+ )
60
+
61
+ def override_next(self, name: str, next_list: List[str]) -> bool:
62
+ list_buffer = StringListBuffer()
63
+ list_buffer.set(next_list)
64
+
65
+ return bool(
66
+ Library.framework().MaaResourceOverrideNext(
67
+ self._handle, name.encode(), list_buffer._handle
68
+ )
69
+ )
70
+
52
71
  @property
53
72
  def loaded(self) -> bool:
54
73
  return bool(Library.framework().MaaResourceLoaded(self._handle))
@@ -264,6 +283,19 @@ class Resource:
264
283
  Library.framework().MaaResourceClear.restype = MaaBool
265
284
  Library.framework().MaaResourceClear.argtypes = [MaaResourceHandle]
266
285
 
286
+ Library.framework().MaaResourceOverridePipeline.restype = MaaBool
287
+ Library.framework().MaaResourceOverridePipeline.argtypes = [
288
+ MaaResourceHandle,
289
+ ctypes.c_char_p,
290
+ ]
291
+
292
+ Library.framework().MaaResourceOverrideNext.restype = MaaBool
293
+ Library.framework().MaaResourceOverrideNext.argtypes = [
294
+ MaaResourceHandle,
295
+ ctypes.c_char_p,
296
+ MaaStringBufferHandle,
297
+ ]
298
+
267
299
  Library.framework().MaaResourceGetHash.restype = MaaBool
268
300
  Library.framework().MaaResourceGetHash.argtypes = [
269
301
  MaaResourceHandle,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MaaFw
3
- Version: 4.1.1
3
+ Version: 4.2.0
4
4
  Summary: An automation black-box testing framework based on image recognition
5
5
  Project-URL: Homepage, https://github.com/MaaXYZ/MaaFramework
6
6
  Author: MaaXYZ
@@ -0,0 +1,30 @@
1
+ maa/__init__.py,sha256=t2Z9yJWrSZfH16xYN67bKpiPEHDf7iaiw4wi0PjmU8U,250
2
+ maa/agent_client.py,sha256=_3FDk9YBhqhSL8WzkyPbs5W5y2uLJ5iaosW48N1xWkw,3337
3
+ maa/buffer.py,sha256=XFr1MnWt-xmZkhQ_2ZzGfiqSJJwmphY4U07EEzMNYQc,16544
4
+ maa/context.py,sha256=hOxo7GArAmdBwMGHPqM1I2rtNE5N6WR1QwPOLxZgSvU,5754
5
+ maa/controller.py,sha256=V9ALn24vQX-mWngZbuapBcv-_HNHCtUwHXa3Em2X13s,22517
6
+ maa/custom_action.py,sha256=V-kJ-5ahcImnzrZBbAH_RJqoiQ7RjBT39ffdSOi9_c4,2495
7
+ maa/custom_recognition.py,sha256=P8Kfh4PWoQXyw7loE-9zv_VCD2HUcE6qkIXCK_Ye9a4,3372
8
+ maa/define.py,sha256=qec4GQkYi6AtorJ1ix880Fz67bpZULJOV3VpZEDd2Es,13341
9
+ maa/job.py,sha256=MUI5T2X9ON9c7Dl6yo_0pp8Ulpn25XOD_uEdGm2k-TA,1231
10
+ maa/library.py,sha256=9af7ncHUk33N5JcacaAk87JLKkP3atu-J8wf-CvfYhw,3891
11
+ maa/notification_handler.py,sha256=LFJY6YqF9fJSkRsvpmj6ZL5DexMN_cEOj-HmpWpB9o0,5442
12
+ maa/resource.py,sha256=gjcYnhaLzR11jM9nd-QfUeVEsBDgJkubOQ3YiMZN5ic,11529
13
+ maa/tasker.py,sha256=cAkYW8Mu5rAgsPlSGacTjJ830sF2yFtvlmXRvIJt-A4,14811
14
+ maa/toolkit.py,sha256=H7P58dPLKzEm_aZMsDJ98IaMZnTE-hcFgK8MKnN0F6g,11381
15
+ maa/agent/__init__.py,sha256=K4vyyD6YgLR6PEQl86t4oKP4eViCdNr3Br94dNk8YjM,257
16
+ maa/agent/agent_server.py,sha256=e0yE_ffWJlTPydJbYLK9OhCM5fVVlZQIcvEQMjB5V68,3636
17
+ maa/bin/libMaaAdbControlUnit.dylib,sha256=1JXBNSsQja-BM3xwQ3nh8gTlpVaUf8FsdTM6bzhswbs,722712
18
+ maa/bin/libMaaAgentClient.dylib,sha256=u1wF_cZsEW7Ma_mdiziy7i92LpFxXjYawLiOh3RZ96E,1402792
19
+ maa/bin/libMaaAgentServer.dylib,sha256=S1TxhgzEfhW8lp5dkw4lXv0qnnw5mbPDPmr90uLQXYE,1665624
20
+ maa/bin/libMaaDbgControlUnit.dylib,sha256=JkaZYtCbApcdXvjab9DugQ78KTnGF0ajsJRnkI0dr_8,353560
21
+ maa/bin/libMaaFramework.dylib,sha256=xfK01wS0m-pMz2qyGyQQy6BWSKhJ653iMORLmCtO8ow,2338344
22
+ maa/bin/libMaaToolkit.dylib,sha256=_7xmva73TjzDjKnMBGO8kj5hKr1LLPaUPRqVyp0K4BA,918800
23
+ maa/bin/libMaaUtils.dylib,sha256=-T1mzUBx0hqm8NILgRsub7i-guGhOhpmqpTKwOPvXrQ,540480
24
+ maa/bin/libfastdeploy_ppocr.dylib,sha256=HAneULevDZ_uuI-rAYJ18hiV9ERkojA05u2M1jIXt_c,4588632
25
+ maa/bin/libonnxruntime.1.19.2.dylib,sha256=12pPNEJbyCk7FN7wR2-ijm_yH5IbD7h81z3NUiK32OU,17341832
26
+ maa/bin/libopencv_world4.4.8.0.dylib,sha256=a258ojx3MPVIJEUopsaDnLVInfUHh12qjsIM_8j5P_s,13193344
27
+ maafw-4.2.0.dist-info/licenses/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
28
+ maafw-4.2.0.dist-info/METADATA,sha256=bCdtl_eUewt7RMm48Exp1jtt07LJnjSfmI-HUg2QsOU,21231
29
+ maafw-4.2.0.dist-info/WHEEL,sha256=SqRtGdpuogbgKRVwFY1Ga4NP7T5_9qclWQUlsSHr8Hw,101
30
+ maafw-4.2.0.dist-info/RECORD,,
maa/bin/libc++.1.dylib DELETED
Binary file
maa/bin/libc++abi.1.dylib DELETED
Binary file
maa/bin/libunwind.1.dylib DELETED
Binary file
@@ -1,33 +0,0 @@
1
- maa/__init__.py,sha256=t2Z9yJWrSZfH16xYN67bKpiPEHDf7iaiw4wi0PjmU8U,250
2
- maa/agent_client.py,sha256=MGjwVCM_Y60O2pJJn5iCxh0ymg-ebOWlDw2euSaZSu0,2855
3
- maa/buffer.py,sha256=XFr1MnWt-xmZkhQ_2ZzGfiqSJJwmphY4U07EEzMNYQc,16544
4
- maa/context.py,sha256=hOxo7GArAmdBwMGHPqM1I2rtNE5N6WR1QwPOLxZgSvU,5754
5
- maa/controller.py,sha256=V9ALn24vQX-mWngZbuapBcv-_HNHCtUwHXa3Em2X13s,22517
6
- maa/custom_action.py,sha256=V-kJ-5ahcImnzrZBbAH_RJqoiQ7RjBT39ffdSOi9_c4,2495
7
- maa/custom_recognition.py,sha256=P8Kfh4PWoQXyw7loE-9zv_VCD2HUcE6qkIXCK_Ye9a4,3372
8
- maa/define.py,sha256=qec4GQkYi6AtorJ1ix880Fz67bpZULJOV3VpZEDd2Es,13341
9
- maa/job.py,sha256=MUI5T2X9ON9c7Dl6yo_0pp8Ulpn25XOD_uEdGm2k-TA,1231
10
- maa/library.py,sha256=9af7ncHUk33N5JcacaAk87JLKkP3atu-J8wf-CvfYhw,3891
11
- maa/notification_handler.py,sha256=LFJY6YqF9fJSkRsvpmj6ZL5DexMN_cEOj-HmpWpB9o0,5442
12
- maa/resource.py,sha256=1dRadrja3qgyU8-tIL5C8P-YaZyH-uHKEbysxKIAj_U,10468
13
- maa/tasker.py,sha256=cAkYW8Mu5rAgsPlSGacTjJ830sF2yFtvlmXRvIJt-A4,14811
14
- maa/toolkit.py,sha256=H7P58dPLKzEm_aZMsDJ98IaMZnTE-hcFgK8MKnN0F6g,11381
15
- maa/agent/__init__.py,sha256=K4vyyD6YgLR6PEQl86t4oKP4eViCdNr3Br94dNk8YjM,257
16
- maa/agent/agent_server.py,sha256=e0yE_ffWJlTPydJbYLK9OhCM5fVVlZQIcvEQMjB5V68,3636
17
- maa/bin/libMaaAdbControlUnit.dylib,sha256=3omrXZ3LPz5fzMTrE0FsFaD4BT2Q0naYkOS2ZUKrEtc,756192
18
- maa/bin/libMaaAgentClient.dylib,sha256=BEMDM1gdZt0kbM9V65Wi530KSxmQ9ciNHqzBQKAWl4I,1531104
19
- maa/bin/libMaaAgentServer.dylib,sha256=GH4pB8WopVh6ZA-KKiqHa0P6IZJprU9_97-RHJifcsI,1704496
20
- maa/bin/libMaaDbgControlUnit.dylib,sha256=e1cojOYhPAkomSs0abXvytDLrh80Yp-GO6vR5CXyfk8,390320
21
- maa/bin/libMaaFramework.dylib,sha256=q9iPbcuaapNrh9pxm5naHfMjMqVrP2uOin1QTb3XUF8,2355200
22
- maa/bin/libMaaToolkit.dylib,sha256=TMly3K0UCbuxB0S7mTw3P0EHNiDs0b2vsg381H7THbk,992016
23
- maa/bin/libMaaUtils.dylib,sha256=6rKDNwd84f59ROU6iod8WrtCkvfXczWIb_7WWSbCm0U,577424
24
- maa/bin/libc++.1.dylib,sha256=87iDZynWoWGqCH1zUXVtOHcbDfzxELR0g4gEJelCww0,1152800
25
- maa/bin/libc++abi.1.dylib,sha256=kyitJ_Wxcww03gLCt9GCQem3gu09294Svh_-VMPLs0U,368288
26
- maa/bin/libfastdeploy_ppocr.dylib,sha256=Y7j-9roLd1CrfESEYbsO48MLRVOHiQZ0RHtkmwuTWeQ,4606768
27
- maa/bin/libonnxruntime.1.19.2.dylib,sha256=BGXAmUNxe9WOxZNUl-GHge3begS9EVYS3L5wnOyUMkc,17359936
28
- maa/bin/libopencv_world4.4.8.0.dylib,sha256=SxL2FZyQCyFqwE3cubrGcdBN9M3uZQFD9DQ4x0Tr5HU,13211472
29
- maa/bin/libunwind.1.dylib,sha256=h7_pW5cVGaH0tIk3o69oCc7MffvySuya21iqeovqXwk,110528
30
- maafw-4.1.1.dist-info/licenses/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
31
- maafw-4.1.1.dist-info/METADATA,sha256=nA2mFCnuy8tTbYRvltba0k3nUrD8T2fQumG_oyH1QnE,21231
32
- maafw-4.1.1.dist-info/WHEEL,sha256=SqRtGdpuogbgKRVwFY1Ga4NP7T5_9qclWQUlsSHr8Hw,101
33
- maafw-4.1.1.dist-info/RECORD,,
File without changes