MaaFw 4.5.5__py3-none-manylinux2014_x86_64.whl → 5.4.0__py3-none-manylinux2014_x86_64.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/agent_server.py +221 -3
- maa/agent_client.py +170 -2
- maa/bin/libMaaAdbControlUnit.so +0 -0
- maa/bin/libMaaAgentClient.so +0 -0
- maa/bin/libMaaAgentServer.so +0 -0
- maa/bin/libMaaCustomControlUnit.so +0 -0
- maa/bin/libMaaFramework.so +0 -0
- maa/bin/libMaaToolkit.so +0 -0
- maa/bin/libMaaUtils.so +0 -0
- maa/bin/libc++.so.1 +0 -0
- maa/bin/libc++abi.so.1 +0 -0
- maa/bin/libfastdeploy_ppocr.so +0 -0
- maa/bin/libonnxruntime.so.1 +0 -0
- maa/bin/libopencv_world4.so.411 +0 -0
- maa/bin/libunwind.so.1 +0 -0
- maa/bin/plugins/libMaaPluginDemo.so +0 -0
- maa/buffer.py +168 -0
- maa/context.py +402 -10
- maa/controller.py +611 -36
- maa/custom_action.py +40 -0
- maa/custom_recognition.py +57 -5
- maa/define.py +432 -16
- maa/event_sink.py +103 -0
- maa/job.py +77 -1
- maa/library.py +118 -50
- maa/pipeline.py +509 -0
- maa/resource.py +430 -21
- maa/tasker.py +630 -75
- maa/toolkit.py +52 -91
- {maafw-4.5.5.dist-info → maafw-5.4.0.dist-info}/METADATA +89 -44
- maafw-5.4.0.dist-info/RECORD +35 -0
- {maafw-4.5.5.dist-info → maafw-5.4.0.dist-info}/WHEEL +1 -1
- maa/bin/libMaaDbgControlUnit.so +0 -0
- maa/notification_handler.py +0 -199
- maafw-4.5.5.dist-info/RECORD +0 -34
- {maafw-4.5.5.dist-info → maafw-5.4.0.dist-info}/licenses/LICENSE.md +0 -0
maa/notification_handler.py
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import ctypes
|
|
2
|
-
import json
|
|
3
|
-
from abc import ABC
|
|
4
|
-
from typing import Optional, Tuple, Any
|
|
5
|
-
from enum import IntEnum
|
|
6
|
-
from dataclasses import dataclass
|
|
7
|
-
|
|
8
|
-
from .define import MaaNotificationCallback
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# class NotificationEvent(IntEnum):
|
|
12
|
-
# ResourceLoading = 1
|
|
13
|
-
# ControllerAction = 2
|
|
14
|
-
# TaskerTask = 3
|
|
15
|
-
# TaskNextList = 4
|
|
16
|
-
# TaskRecognition = 5
|
|
17
|
-
# TaskAction = 6
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class NotificationType(IntEnum):
|
|
21
|
-
Unknown = 0
|
|
22
|
-
Starting = 1
|
|
23
|
-
Succeeded = 2
|
|
24
|
-
Failed = 3
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class NotificationHandler(ABC):
|
|
28
|
-
|
|
29
|
-
@dataclass
|
|
30
|
-
class ResourceLoadingDetail:
|
|
31
|
-
res_id: int
|
|
32
|
-
hash: str
|
|
33
|
-
path: str
|
|
34
|
-
|
|
35
|
-
def on_resource_loading(
|
|
36
|
-
self, noti_type: NotificationType, detail: ResourceLoadingDetail
|
|
37
|
-
):
|
|
38
|
-
pass
|
|
39
|
-
|
|
40
|
-
@dataclass
|
|
41
|
-
class ControllerActionDetail:
|
|
42
|
-
ctrl_id: int
|
|
43
|
-
uuid: str
|
|
44
|
-
action: str
|
|
45
|
-
param: dict
|
|
46
|
-
|
|
47
|
-
def on_controller_action(
|
|
48
|
-
self, noti_type: NotificationType, detail: ControllerActionDetail
|
|
49
|
-
):
|
|
50
|
-
pass
|
|
51
|
-
|
|
52
|
-
@dataclass
|
|
53
|
-
class TaskerTaskDetail:
|
|
54
|
-
task_id: int
|
|
55
|
-
entry: str
|
|
56
|
-
uuid: str
|
|
57
|
-
hash: str
|
|
58
|
-
|
|
59
|
-
def on_tasker_task(self, noti_type: NotificationType, detail: TaskerTaskDetail):
|
|
60
|
-
pass
|
|
61
|
-
|
|
62
|
-
@dataclass
|
|
63
|
-
class NodeNextListDetail:
|
|
64
|
-
task_id: int
|
|
65
|
-
name: str
|
|
66
|
-
next_list: list[str]
|
|
67
|
-
focus: Any
|
|
68
|
-
|
|
69
|
-
def on_node_next_list(
|
|
70
|
-
self, noti_type: NotificationType, detail: NodeNextListDetail
|
|
71
|
-
):
|
|
72
|
-
pass
|
|
73
|
-
|
|
74
|
-
@dataclass
|
|
75
|
-
class NodeRecognitionDetail:
|
|
76
|
-
task_id: int
|
|
77
|
-
reco_id: int
|
|
78
|
-
name: str
|
|
79
|
-
focus: Any
|
|
80
|
-
|
|
81
|
-
def on_node_recognition(
|
|
82
|
-
self, noti_type: NotificationType, detail: NodeRecognitionDetail
|
|
83
|
-
):
|
|
84
|
-
pass
|
|
85
|
-
|
|
86
|
-
@dataclass
|
|
87
|
-
class NodeActionDetail:
|
|
88
|
-
task_id: int
|
|
89
|
-
node_id: int
|
|
90
|
-
name: str
|
|
91
|
-
focus: Any
|
|
92
|
-
|
|
93
|
-
def on_node_action(self, noti_type: NotificationType, detail: NodeActionDetail):
|
|
94
|
-
pass
|
|
95
|
-
|
|
96
|
-
def on_unknown_notification(self, msg: str, details: dict):
|
|
97
|
-
pass
|
|
98
|
-
|
|
99
|
-
def on_raw_notification(self, msg: str, details: dict):
|
|
100
|
-
|
|
101
|
-
noti_type = NotificationHandler._notification_type(msg)
|
|
102
|
-
|
|
103
|
-
if msg.startswith("Resource.Loading"):
|
|
104
|
-
detail = self.ResourceLoadingDetail(
|
|
105
|
-
res_id=details["res_id"],
|
|
106
|
-
hash=details["hash"],
|
|
107
|
-
path=details["path"],
|
|
108
|
-
)
|
|
109
|
-
self.on_resource_loading(noti_type, detail)
|
|
110
|
-
|
|
111
|
-
elif msg.startswith("Controller.Action"):
|
|
112
|
-
detail = self.ControllerActionDetail(
|
|
113
|
-
ctrl_id=details["ctrl_id"],
|
|
114
|
-
uuid=details["uuid"],
|
|
115
|
-
action=details["action"],
|
|
116
|
-
param=details["param"],
|
|
117
|
-
)
|
|
118
|
-
self.on_controller_action(noti_type, detail)
|
|
119
|
-
|
|
120
|
-
elif msg.startswith("Tasker.Task"):
|
|
121
|
-
detail = self.TaskerTaskDetail(
|
|
122
|
-
task_id=details["task_id"],
|
|
123
|
-
entry=details["entry"],
|
|
124
|
-
uuid=details["uuid"],
|
|
125
|
-
hash=details["hash"],
|
|
126
|
-
)
|
|
127
|
-
self.on_tasker_task(noti_type, detail)
|
|
128
|
-
|
|
129
|
-
elif msg.startswith("Node.NextList"):
|
|
130
|
-
detail = self.NodeNextListDetail(
|
|
131
|
-
task_id=details["task_id"],
|
|
132
|
-
name=details["name"],
|
|
133
|
-
next_list=details["list"],
|
|
134
|
-
focus=details["focus"],
|
|
135
|
-
)
|
|
136
|
-
self.on_node_next_list(noti_type, detail)
|
|
137
|
-
|
|
138
|
-
elif msg.startswith("Node.Recognition"):
|
|
139
|
-
detail = self.NodeRecognitionDetail(
|
|
140
|
-
task_id=details["task_id"],
|
|
141
|
-
reco_id=details["reco_id"],
|
|
142
|
-
name=details["name"],
|
|
143
|
-
focus=details["focus"],
|
|
144
|
-
)
|
|
145
|
-
self.on_node_recognition(noti_type, detail)
|
|
146
|
-
|
|
147
|
-
elif msg.startswith("Node.Action"):
|
|
148
|
-
detail = self.NodeActionDetail(
|
|
149
|
-
task_id=details["task_id"],
|
|
150
|
-
node_id=details["node_id"],
|
|
151
|
-
name=details["name"],
|
|
152
|
-
focus=details["focus"],
|
|
153
|
-
)
|
|
154
|
-
self.on_node_action(noti_type, detail)
|
|
155
|
-
|
|
156
|
-
else:
|
|
157
|
-
self.on_unknown_notification(msg, details)
|
|
158
|
-
|
|
159
|
-
@property
|
|
160
|
-
def c_callback(self) -> MaaNotificationCallback:
|
|
161
|
-
return self._c_notification_agent
|
|
162
|
-
|
|
163
|
-
@property
|
|
164
|
-
def c_callback_arg(self) -> ctypes.c_void_p:
|
|
165
|
-
return ctypes.c_void_p.from_buffer(ctypes.py_object(self))
|
|
166
|
-
|
|
167
|
-
@staticmethod
|
|
168
|
-
def _gen_c_param(
|
|
169
|
-
handler: Optional["NotificationHandler"],
|
|
170
|
-
) -> Tuple[MaaNotificationCallback, ctypes.c_void_p]:
|
|
171
|
-
if handler:
|
|
172
|
-
return handler.c_callback, handler.c_callback_arg
|
|
173
|
-
else:
|
|
174
|
-
return NotificationHandler._c_notification_agent, ctypes.c_void_p()
|
|
175
|
-
|
|
176
|
-
@staticmethod
|
|
177
|
-
def _notification_type(message: str) -> NotificationType:
|
|
178
|
-
if message.endswith(".Starting"):
|
|
179
|
-
return NotificationType.Starting
|
|
180
|
-
elif message.endswith(".Succeeded"):
|
|
181
|
-
return NotificationType.Succeeded
|
|
182
|
-
elif message.endswith(".Failed"):
|
|
183
|
-
return NotificationType.Failed
|
|
184
|
-
else:
|
|
185
|
-
return NotificationType.Unknown
|
|
186
|
-
|
|
187
|
-
@staticmethod
|
|
188
|
-
@MaaNotificationCallback
|
|
189
|
-
def _c_notification_agent(
|
|
190
|
-
msg: ctypes.c_char_p,
|
|
191
|
-
details_json: ctypes.c_char_p,
|
|
192
|
-
callback_arg: ctypes.c_void_p,
|
|
193
|
-
):
|
|
194
|
-
if not callback_arg:
|
|
195
|
-
return
|
|
196
|
-
|
|
197
|
-
self: NotificationHandler = ctypes.cast(callback_arg, ctypes.py_object).value
|
|
198
|
-
|
|
199
|
-
self.on_raw_notification(msg.decode(), json.loads(details_json.decode()))
|
maafw-4.5.5.dist-info/RECORD
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
maa/__init__.py,sha256=t2Z9yJWrSZfH16xYN67bKpiPEHDf7iaiw4wi0PjmU8U,250
|
|
2
|
-
maa/agent_client.py,sha256=qx1-3VGp97JB_UMlbkvK-O_GTigbdqD6U4gGKi2yQW4,4049
|
|
3
|
-
maa/buffer.py,sha256=XFr1MnWt-xmZkhQ_2ZzGfiqSJJwmphY4U07EEzMNYQc,16544
|
|
4
|
-
maa/context.py,sha256=dYCvRNqq2iCL8lIyp2TkZorGB5KNI34L3pGzlpdL7co,6454
|
|
5
|
-
maa/controller.py,sha256=pyVPwRnpGcGCoWAa2FOPBvwIY5jY2kqmRtd-V16bPyU,24507
|
|
6
|
-
maa/custom_action.py,sha256=honGd28UaKWzApYBHO9_Cka8hPfzZUy6HBUfIdfQiaU,2554
|
|
7
|
-
maa/custom_recognition.py,sha256=nfNgPKq9a6t2eoXwKMJRvZMXTh31Jn0JfxUMsfGI33Y,3384
|
|
8
|
-
maa/define.py,sha256=EHTbELEAf4vXuCLyNM6Xhp9MM6iigSA6b9QE3m-B3DE,13643
|
|
9
|
-
maa/job.py,sha256=MUI5T2X9ON9c7Dl6yo_0pp8Ulpn25XOD_uEdGm2k-TA,1231
|
|
10
|
-
maa/library.py,sha256=u6gbEHDV3I0y69-ZoBo1p6-bAtP4jqSQa4FICuzaw3U,3961
|
|
11
|
-
maa/notification_handler.py,sha256=dpbIEKTqCvW9mj6am49Fd9ntoM39OCadhOGrvkmhyyI,5502
|
|
12
|
-
maa/resource.py,sha256=sCGAK1FFjZCaf01t_FPdtl4pMDQsybhEjmafp9XfITA,12222
|
|
13
|
-
maa/tasker.py,sha256=8eGK83RhsVXh1Px2_eHhUBd6epaubIGDN0FG4soi4xM,14232
|
|
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.so,sha256=u8GjxFKnEgLaadJH-SfnsRa1a9-kUTgrphsHHzyGpMc,807568
|
|
18
|
-
maa/bin/libMaaAgentClient.so,sha256=UQ12sWRtavNLAL2jDi5SCkEDeZ3SXyh-4poJMAkz3LI,1963056
|
|
19
|
-
maa/bin/libMaaAgentServer.so,sha256=9uRnGQz8oRCPAc5KIbPG70qiikV28Kt2XRcXk57A0V0,1996888
|
|
20
|
-
maa/bin/libMaaCustomControlUnit.so,sha256=LnqzQikgFJCzo12w-VeVyfTGjk7zFR5bODwRgzG2eck,196448
|
|
21
|
-
maa/bin/libMaaDbgControlUnit.so,sha256=kRR753b9axu2eLL9fGa7Wihe2KE2BaoCGr38Fqf6L54,387408
|
|
22
|
-
maa/bin/libMaaFramework.so,sha256=g9Rb6Z3YtxasGv3Vg6OI0V0uQP7juJfANXBrq-_TFpM,3268752
|
|
23
|
-
maa/bin/libMaaToolkit.so,sha256=gtjcoOb2tjF8Ri4qGvKPiO9jaDvvuvkpmTK6IgRl7uw,1255848
|
|
24
|
-
maa/bin/libMaaUtils.so,sha256=x2bjesFIz9vSdGicg6gNM414SeTIeXvj-cCz4fCVIRQ,700512
|
|
25
|
-
maa/bin/libc++.so.1,sha256=VBRNSEJEpV1qPB25f6tMuCVbxhVZ-38YF8jU3xX5KXQ,1324528
|
|
26
|
-
maa/bin/libc++abi.so.1,sha256=Ftv8RvYQzF7Xo9j6S_CqmKxJ6I7LxdVxCh3lBV1Waig,401640
|
|
27
|
-
maa/bin/libfastdeploy_ppocr.so,sha256=MWnvN6OxvRf4wqf-J3tCcdmvhJwr805U1H2GBdtfwuM,7008160
|
|
28
|
-
maa/bin/libonnxruntime.so.1,sha256=MinP7Ya1F-9CTL7rco74aYMaydanbvUhNHJluEHOCZc,19104624
|
|
29
|
-
maa/bin/libopencv_world4.so.411,sha256=AcbDkSrrqdAFL9aaanst2MdjncQKXMm1NCCjRzkVwhw,14751664
|
|
30
|
-
maa/bin/libunwind.so.1,sha256=m_I4uMxz9WBbggB5eCvZPJO63vim2MWFhw9nYG7vdgI,60040
|
|
31
|
-
maafw-4.5.5.dist-info/licenses/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
|
|
32
|
-
maafw-4.5.5.dist-info/METADATA,sha256=Jp-6D2WC4-2VSOLFixgPAfQXK-Dim4tc4a_FOASUNZQ,24481
|
|
33
|
-
maafw-4.5.5.dist-info/WHEEL,sha256=ElIck4UKS1gfqi_USxboIISULsrnySUDnW4muwHK3us,104
|
|
34
|
-
maafw-4.5.5.dist-info/RECORD,,
|
|
File without changes
|