MaaFw 4.4.0b1__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.

@@ -1,197 +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
-
46
- def on_controller_action(
47
- self, noti_type: NotificationType, detail: ControllerActionDetail
48
- ):
49
- pass
50
-
51
- @dataclass
52
- class TaskerTaskDetail:
53
- task_id: int
54
- entry: str
55
- uuid: str
56
- hash: str
57
-
58
- def on_tasker_task(self, noti_type: NotificationType, detail: TaskerTaskDetail):
59
- pass
60
-
61
- @dataclass
62
- class NodeNextListDetail:
63
- task_id: int
64
- name: str
65
- next_list: list[str]
66
- focus: Any
67
-
68
- def on_node_next_list(
69
- self, noti_type: NotificationType, detail: NodeNextListDetail
70
- ):
71
- pass
72
-
73
- @dataclass
74
- class NodeRecognitionDetail:
75
- task_id: int
76
- reco_id: int
77
- name: str
78
- focus: Any
79
-
80
- def on_node_recognition(
81
- self, noti_type: NotificationType, detail: NodeRecognitionDetail
82
- ):
83
- pass
84
-
85
- @dataclass
86
- class NodeActionDetail:
87
- task_id: int
88
- node_id: int
89
- name: str
90
- focus: Any
91
-
92
- def on_node_action(self, noti_type: NotificationType, detail: NodeActionDetail):
93
- pass
94
-
95
- def on_unknown_notification(self, msg: str, details: dict):
96
- pass
97
-
98
- def on_raw_notification(self, msg: str, details: dict):
99
-
100
- noti_type = NotificationHandler._notification_type(msg)
101
-
102
- if msg.startswith("Resource.Loading"):
103
- detail = self.ResourceLoadingDetail(
104
- res_id=details["res_id"],
105
- hash=details["hash"],
106
- path=details["path"],
107
- )
108
- self.on_resource_loading(noti_type, detail)
109
-
110
- elif msg.startswith("Controller.Action"):
111
- detail = self.ControllerActionDetail(
112
- ctrl_id=details["ctrl_id"],
113
- uuid=details["uuid"],
114
- action=details["action"],
115
- )
116
- self.on_controller_action(noti_type, detail)
117
-
118
- elif msg.startswith("Tasker.Task"):
119
- detail = self.TaskerTaskDetail(
120
- task_id=details["task_id"],
121
- entry=details["entry"],
122
- uuid=details["uuid"],
123
- hash=details["hash"],
124
- )
125
- self.on_tasker_task(noti_type, detail)
126
-
127
- elif msg.startswith("Node.NextList"):
128
- detail = self.NodeNextListDetail(
129
- task_id=details["task_id"],
130
- name=details["name"],
131
- next_list=details["list"],
132
- focus=details["focus"],
133
- )
134
- self.on_node_next_list(noti_type, detail)
135
-
136
- elif msg.startswith("Node.Recognition"):
137
- detail = self.NodeRecognitionDetail(
138
- task_id=details["task_id"],
139
- reco_id=details["reco_id"],
140
- name=details["name"],
141
- focus=details["focus"],
142
- )
143
- self.on_node_recognition(noti_type, detail)
144
-
145
- elif msg.startswith("Node.Action"):
146
- detail = self.NodeActionDetail(
147
- task_id=details["task_id"],
148
- node_id=details["node_id"],
149
- name=details["name"],
150
- focus=details["focus"],
151
- )
152
- self.on_node_action(noti_type, detail)
153
-
154
- else:
155
- self.on_unknown_notification(msg, details)
156
-
157
- @property
158
- def c_callback(self) -> MaaNotificationCallback:
159
- return self._c_notification_agent
160
-
161
- @property
162
- def c_callback_arg(self) -> ctypes.c_void_p:
163
- return ctypes.c_void_p.from_buffer(ctypes.py_object(self))
164
-
165
- @staticmethod
166
- def _gen_c_param(
167
- handler: Optional["NotificationHandler"],
168
- ) -> Tuple[MaaNotificationCallback, ctypes.c_void_p]:
169
- if handler:
170
- return handler.c_callback, handler.c_callback_arg
171
- else:
172
- return NotificationHandler._c_notification_agent, ctypes.c_void_p()
173
-
174
- @staticmethod
175
- def _notification_type(message: str) -> NotificationType:
176
- if message.endswith(".Starting"):
177
- return NotificationType.Starting
178
- elif message.endswith(".Succeeded"):
179
- return NotificationType.Succeeded
180
- elif message.endswith(".Failed"):
181
- return NotificationType.Failed
182
- else:
183
- return NotificationType.Unknown
184
-
185
- @staticmethod
186
- @MaaNotificationCallback
187
- def _c_notification_agent(
188
- msg: ctypes.c_char_p,
189
- details_json: ctypes.c_char_p,
190
- callback_arg: ctypes.c_void_p,
191
- ):
192
- if not callback_arg:
193
- return
194
-
195
- self: NotificationHandler = ctypes.cast(callback_arg, ctypes.py_object).value
196
-
197
- self.on_raw_notification(msg.decode(), json.loads(details_json.decode()))
@@ -1,30 +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=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=u6gbEHDV3I0y69-ZoBo1p6-bAtP4jqSQa4FICuzaw3U,3961
11
- maa/notification_handler.py,sha256=LFJY6YqF9fJSkRsvpmj6ZL5DexMN_cEOj-HmpWpB9o0,5442
12
- maa/resource.py,sha256=sCGAK1FFjZCaf01t_FPdtl4pMDQsybhEjmafp9XfITA,12222
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.so,sha256=4BnmzuJGdRkfkU_TMCvhk2htH79JnObvl81hjnzhi2A,16838632
18
- maa/bin/libMaaAgentClient.so,sha256=WUDdNOBF4mT56z_10BNykrILb4wCV_ePsDsMWHk-VQs,8432200
19
- maa/bin/libMaaAgentServer.so,sha256=MnFfAOo97Gmdep3563KJnNrP3tRWQuN2GarkgLsRyQw,15617416
20
- maa/bin/libMaaDbgControlUnit.so,sha256=OE_jB8On356P0aRM1r_okHXirwY49xawKazjZZQrvdw,4538280
21
- maa/bin/libMaaFramework.so,sha256=alr2BaTPpjBxBDYS7usWCHnq3pnb-UsW4veuSfeOJXE,48367088
22
- maa/bin/libMaaToolkit.so,sha256=6gYU5tV0fC8Pgf8xYu78y7f6jwTd3a9YhH59bRVD_SE,15320496
23
- maa/bin/libMaaUtils.so,sha256=1x6UM9wSFa0oRLk-87xPQpgIoNi862AGkO5q6lIuzKM,6445664
24
- maa/bin/libfastdeploy_ppocr.so,sha256=ZC3P75Pme8zo6jZ69CTXF3CbD93oVQdVl_awgjYsJqo,6722040
25
- maa/bin/libonnxruntime.so.1,sha256=fNYTPb_6EfFcO9F0BFAPzbRoVn5LXNnwIZ02uToi4ns,22362896
26
- maa/bin/libopencv_world4.so.408,sha256=wxNzqg0Pk6cJdVHNWzYhsLNs7h3hORzaAQ-YTOVVwM4,21684224
27
- maafw-4.4.0b1.dist-info/licenses/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
28
- maafw-4.4.0b1.dist-info/METADATA,sha256=u6eY1Ea3cJATCaymxYiILgM47r50Uh6E5acWt8r215E,24356
29
- maafw-4.4.0b1.dist-info/WHEEL,sha256=ElIck4UKS1gfqi_USxboIISULsrnySUDnW4muwHK3us,104
30
- maafw-4.4.0b1.dist-info/RECORD,,